Message Boards Message Boards

2 Replies
0 Total Likes
View groups...
Share this post:

How to solve 2nd order ODE with Mathematica?

Posted 10 years ago

For example , what to write to solve this ? y''+4y'+8y=3xcosx And how do I plot direction field for this? Thanks!!

POSTED BY: Altin Guberi
2 Replies

now how to draw the phase portrait of this?/

POSTED BY: Altin Guberi

Perhaps, this will help.

DSolve[y''[x] + 4 y'[x] + 8 y[x] == x 3 x Cos[x], y, x]

Now, the solution is a bit large. As you did not provide any boundary condition, I choose the integration constants to be 1.

StreamPlot[{x,E^(-2 x) Cos[2 x] + E^(-2 x) Sin[2 x] +1/10985003 (48334 Cos[x] Cos[2 x] - 87880 x Cos[x] Cos[2 x] +54925 x^2 Cos[x] Cos[2 x] + 2250 Cos[2 x] Cos[3 x] -39000 x Cos[2 x] Cos[3 x] + 63375 x^2 Cos[2 x] Cos[3 x] -8788 Cos[2 x] Sin[x] + 65910 x Cos[2 x] Sin[x] -109850 x^2 Cos[2 x] Sin[x] + 8788 Cos[x] Sin[2 x] -65910 x Cos[x] Sin[2 x] + 109850 x^2 Cos[x] Sin[2 x] -11500 Cos[3 x] Sin[2 x] + 16250 x Cos[3 x] Sin[2 x] +42250 x^2 Cos[3 x] Sin[2 x] + 48334 Sin[x] Sin[2 x] -87880 x Sin[x] Sin[2 x] + 54925 x^2 Sin[x] Sin[2 x] +11500 Cos[2 x] Sin[3 x] - 16250 x Cos[2 x] Sin[3 x] -42250 x^2 Cos[2 x] Sin[3 x] + 2250 Sin[2 x] Sin[3 x] -39000 x Sin[2 x] Sin[3 x] + 63375 x^2 Sin[2 x] Sin[3 x])}, {x, 0, 10}, {y, -30, 10}]

enter image description here

The plot is

Plot[y, {x, 0, 200}]

enter image description here

Sincerely, Suvadip

POSTED BY: suvadip mandal
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract