Message Boards Message Boards

differential equation solving numerically

Can i solve the following sets of equations in mathematica? xy'(t)+x'(t)y = (x^2)y + (y^2)x; (x^2)y'(t) + (y^3)x'(t) = (xy)+(x^2)y + (y^2)x; The in-built functions are the same as those for solving coupled sets of equations like NDsolve? Can i write the equations like this directly? or do i have to write it by solving it for x'(t) and y'(t)?

Hi,

this works as expected:

sols = NDSolve[{x[t] y'[t] + x'[t] y[t] == (x[t]^2) y[t] + (y[t]^2) x[t]; (x[t]^2) y'[t] + (y[t]^3) x'[t] == x[t] y[t] + (x[t]^2) y[t] + (y[t]^2) x'[t], x[0] == 0.1, 
y[t] == 0.1}, {x, y}, {t, 0, 1.}]

Plot it

Plot[{x[t] /. sols, y[t] /. sols}, {t, 0, 0.5}]

and you get:

enter image description here

Cheers, Marco

POSTED BY: Marco Thiel
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract