## Question

Problem 2. (80 points) Recall the logistic growth equation:

(1) dx

------ = kx − αx²

dt

with k, α > 0 positive constants. Consider the case α = 1, k = 1 for simplicity.

Use:

a) Euler’s tangent method,

b) the modified Euler method, and then also

c) the 4th order Runge-Kutta method

in order to plot values of x(t) (pick some initial starting values for x(0)). Use a Legend to clearly demarcate each graph.

In order to carry out the computations, you will need to play with the step size h; try several values for h.

Alongside your approximate solutions (use separate graphs if need be to avoid overcrowding), plot out the exact solution to Eqn (1). How small do you need to pick h in each case a, b, c above to be within 1% of the exact solution over a fixed time interval (to be specified by you)?

At what values of h do the approximate solutions show oscillations as t → ∞ instead of approaching an equilibrium solution as might be expected of exact solutions? Note that these dynamics of the approximations do not contradict the theory; rather they are artifacts due to numerical integration.

Problem 5. (80 points) Develop a framework (think: vectorize and linear algebra) to make sense of the Runge-Kutta approximation method for systems of ODE’s. Write down a 4th order approximation method for a three-dimensional system. In the specific case of the Lorenz equations, what do you obtain?

## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

function [t, w] = euler( f,a,b,N,alpha )%[ w] = euler( f,a,b,N,alpha )

%INPUTS

% f -- function f(t,x)

% a -- begin point interval

% b -- end point interval

% N -- number of steps

% alpha -- initial condition x(a)

%OUTPUTS

% t -- the vector of times t_i

% w -- the vector of solutions at the times t_i

h=(b-a)/N;

w(1)=alpha;

for i=1:N+1;

t(i)=a+(i-1)*h;

end

for i=1:N

w(i+1)=w(i)+h*f(t(i),w(i));

end

return;...