Message Boards Message Boards

0
|
3459 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Solving two second order ordinary differential equations

Posted 10 years ago

I have two differential equations I'd like to solve and plot. Following documentation, I tried to implement DSolve like this:

 DSolve[y''[t]==w^2*y[t]-2w*x'[t],y[t],t] 

and am not getting a useful result. My question is if DSolve is the correct function to use. Should I use DSolve, or, perhaps, NDSeries?'

P.S. the other equation is

DSolve[x''[t]==w^2*x[t]+2w*y'[t],x[t],t]
POSTED BY: anon nanon
4 Replies

You need to have both equations in a single DSolve function--otherwise there is no way for DSolve to know that there are two simultaneous equations. Also note that your wx'[t] should be w x'[t]: i.e., a space between the w and the x. Similarly for the wy'[t].

With that said, here is the form for DSolve that you want to use for these two simultaneous differential equations in x[t] and y[t]:

DSolve[
{y''[t] == w^2 y[t] - 2 w x'[t], 
  x''[t] == w^2 x[t] + 2 w y'[t]}, 
{y[t], x[t]}, t]

This gives a result in terms of unknown integration constants C[1], C[2], C[3], and C[4]. If you have initial conditions you can include them in the first argument list of the DSolve and the integration constants will be determined in the soluttion.

POSTED BY: David Reiss
Posted 10 years ago

Thank you, this is very helpful. I do have initial conditions, so I have switched to NDSolve. My code is in the screenshot. What is the problem with the way I have input the initial conditions? screenshot

POSTED BY: anon nanon
Posted 10 years ago

As an update, when I input the initial conditions like 'x[0] == x0' I get 'True', even having cleared x.

POSTED BY: anon nanon
  1. yes, you need to use the == (double equal sign) instead of assignment
  2. make sure you use the Clear at the beginning of your program so you don't "memorize" your mistakes
  3. you call NDSolve twice but you should ca;ll it only once and solve for x and y simultaneously

enter image description here

POSTED BY: Kay Herbert
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