Hi,
At first I am new here and new to Mathematica so sorry for any incomprehensions.
I want to solve numerically the system of two ordinary differential equations
y'[t] == -0.25 y[t] + (x[t])^2
x'[t] = -0.25 x[t] + y[t] - x[t] y[t]
When I try that following the NDSolve manual it returns me an error message. I tried to findout something but didn´t succeed.
Thanks for any help.
My code is attached.
mthiel
(Marco Thiel)
June 7, 2014, 11:57am
2
Hi Tomas,
it appears that you have typed a single equal sign for the equation of the x component. This here works:
NDSolve[{y'[t] == -0.25 y[t] + (x[t])^2, x'[t] == -0.25 x[t] + y[t] - x[t] y[t], x[0] == 1, y[0] == 1}, {x, y}, {t, 0, 10}]
If you plot this you get
sols =NDSolve[{y'[t] == -0.25 y[t] + (x[t])^2, x'[t] == -0.25 x[t] + y[t] - x[t] y[t], x[0] == 1, y[0] == 1}, {x, y}, {t, 0, 10}]
and
Plot[{x[t], y[t]} /. sols, {t, 0, 10}]
I hope this helps.
Cheers,
M.
Thank you for the quick help Marco and a little encouragement.
It works!