# Thread: Questions regarding solving an ODE

1. ## Questions regarding solving an ODE

Is it possible to use Euler's method to numerically approximate the solution of this system of ODEs:

dx/dt = -y + x(p - x^2 - y^2)

dy/dt = x + y(p - x^2 - y^2)

where p is a parameter/constant

The only tutorial examples i have seen on the internet involve one dependent and one independent variable. In this case it has 2 dependent variables and 1 independent variable (making it an ODE rather than a PDE).

If it is possible to solve it with the Euler method could someone please advise me about approaching the problem. If it isn't could someone suggest an alternative method.

Cheers

2. Of course, you can't apply any numerical method to find a general solution- you need "boundary conditions" or, preferably, "initial conditions" to specify a specific function. The difficulty is that with partial differential equations, those conditions are typically prescribed functions, not numbers so the problem of numerical solution is much harder. What kind of conditions would you have here?

3. Well I am attempting to write a program that plots a hopf bifurcation of the system above as I vary the parameter p - So plots of y vs. p and x vs. p. I have used the Newton-Raphson method to determine y vs. p and x vs. p over a range of p's - while using the eigen values of the Jacobian to determine the parameter value after which the system bifurcates. In this case that parameter value is 0 and the x and y values are both 0 at the point of bifurcation. I wanted to use euler's method to solve the ODEs from that point onwards and establish a limit cycle ~ which would then translate into a maximum and minimum y vs t and x vs t value that I assume i could then use for plotting as x and y vs. p in the phase diagram plots.

I hope I am clear in what i am trying to describe.

4. I see quite a few people have subsequently viewed this thread, but no advice? I have been trawling through the net for hours trying to find a method to do this. Help is appreciated at least to get me on track.

5. As per HallsofIvy's post, you CANNOT solve any ODE numerically on a computer without boundary conditions or initial conditions. What are they for your system? Also, I would probably go with Runge-Kutta methods over Euler's. It'll be more accurate.

6. I would have thought the initial condition for time = 0, y & x = 0 too.

7. ...would have thought...
You mean you don't know? How very singular (pun intended).

So, is $\displaystyle t=0$ at the point of bifurcation?

8. Ok I haven't explained things really well. Given the system above, I have used the Newton Raphson method to approximate the 'steady part' (prior to bifurcation) of the graph by solving the algebraic non linear equations for f1(x,y) = 0 & f2(x,y) = 0. The code gives a solution for x & y at every 'p' parameter value while simultaneously calculating the eigenvalues of the jacobian to determine the systems stability at each parameter value. At a parameter value of 0 the system bifurcates. Prior to that the system is stable for p <= 0 and unstable for p > 0. Now the x and y points for p <= 0 are a straight line, where x = 0 & y = 0 on a plot of x on the y - axis vs. p on the x - axis & y on the y - axis vs. p on the x - axis.

What I am trying to do now is calculate the x & y values vs. time by solving the system of ODEs numerically for each particular parameter value. So this part of the code only kicks off at p > 0. So for p = 1, I want to find the x and y values vs. time and for p = 2 and p = 3 and so on... What I think should occur, as this system exhibits a hopf bifurcation, is that for each parameter value there should be a limit cycle i.e. an oscillation of x vs. time & y vs. time where the maximum and minimum values of that oscillation represent the upper and lower branch of the hopf bifurcation as plotted in the x vs. p & y vs. p phase portraits - if thats what they are called. I haven't studied nonlinear dynamics and chaos for a long time. So I know at p = 0 a hopf bifurcation takes place and I thought that by solving the ODE for t = 0, y = x = 0 at each parameter value - i could get the limit cycle and then use that data to plot the maximum and minimum y/x values vs. that parameter in the hopf bifurcation plot. Am I making any sense or talking nonsense?

9. Hmm. I'm not sure I fully understand all the chaos theory you're doing (I've studied it a bit, but it was out of Marion and Thornton's Classical Dynamics of Particles and Systems, and most people agree that the chaos chapter isn't the brightest point of the book.)

I will say this: if you do need to solve the system with the t=0=x=y initial conditions, then I'd recommend Runge-Kutta 4 as a good general-purpose solver. You have a system, so you should be aware that the y, the f, the k1 - k4's are all vector quantities, though t and h are scalars.