Question 5 - Collapse Example
We investigate the blow-up behaviour of the following ODE:
Contents
5(a) - Direction field
We first plot the direction field of the ODE over and
:
dirfield(@collapseex, -1, 1, .01, 2);

5(b) - Simulation over various time periods
We now simulate the ODE over the time period (which stops before the collapse will occur)
[t,x] = ode23(@collapseex, [0, 2/3], 1); figure; plot(t, x); xlabel('t'); ylabel('x');

We now simulate the ODE over the time period (which hits the blowup behaviour), we note that the solve completes, but the plot throws an error because the solution has complex parts
[t,x] = ode23(@collapseex, [0, 1], 1); figure; plot(t, x); xlabel('t'); ylabel('x');
Warning: Imaginary parts of complex X and/or Y arguments ignored.
