Hi there.. i have a set of differential equations given by the following. But i am not able to solve them as it says the expression cannot begin with (x(t)*y(t))^2..
[{x’[t]== 0.5x[t]y[t][1+x[t]][2-x[t]],
y’[t]==[x[t]^2][y[t]^2]-0.5[y[t]^2][x[t]+1][x[t]+2],x[0]==4,y[0]==10000},{x,y},{t,1000}]
And it also says
Expression cannot begin with “[x[t]y[t]]^2”.
syntax::tsntxi: “[x[t]y[t]]” is incomplete; more input is needed.
Can you please help me in this regard?
Hi,
try this:
NDSolve[{x'[t] == 0.5 x[t] y[t] (1 + x[t]) (2 - x[t]), y'[t] == x[t]^2 (y[t]^2) - 0.5 (y[t]^2) (x[t] + 1) (x[t] + 2), x[0] == 4, y[0] == 10000}, {x, y}, {t, 0, 1000}]
You should use the [ ] only for functions. If you want to set normal parenthesis, use ( ).
Plotting the result
Plot[{x[t] /. sols, y[t] /. sols}, {t, 0, 10}]
gives
Cheers,
Marco.
Thanks a lot Marco sir…
