Category:Exam - Francisco Almeida

Runge-Kutta Code
A Runge-Kutta of 4th order integration method for two variables was used to write the following program in c:

http://dl.dropbox.com/u/50202759/trial.pdf

It solves the system x' = Ax, where

$$A=\begin{bmatrix}1 & -2\\2 & 1\end{bmatrix}$$

which has exact solutions

$$x(t)=0.1e^{t}cos(2t)-0.2e^{t}sin(2t)$$ $$y(t)=0.1e^{t}sin(2t)+0.2e^{t}cos(2t)$$

given initial conditions (0.1, 0.2).

This seemed to work fairly well.

Fitz-Hugh-Nagumo Model
In the exam we were given the following equations to solve numerically:

$$\dot{x}=c(x+y-\frac{x^{3}}{3}+z)$$ $$\dot{y}=\frac{-(x-a+by)}{c}$$

This was done using the Runge-Kutta 4th order method as shown before, but adapted to this problem.

http://dl.dropbox.com/u/50202759/exam.pdf

For the code as described above the numerical solution yielded the following phase diagram:



It is possible to observe a periodi oscillation around the origin.

They have a stationary point at (0, 0) when all parameters are zero (except for c = 1), this was observed. Changing the starting points:



All seem to converge nicely to the same path.

Now changing the parameter a only, holding the others to where they where before.



At a point where a becomes large enough the solutions shoot off.

Now varying parameter b.



For larger values of b the oscillations become tighter. Eventually the paths no longer become oscillatory as seen by b = 5.0.

Its time to vary c.



The maximum value of y in the orbit seems to increase with c. The speed of convergence seems to decrease with increasing c.

And the last parameter to be changed is z.



The point around which the oscillation takes place seems to decrease with increasing z.