Jump to content
  • Advertisement
Sign in to follow this  
MTT

Solving DE's with maple

This topic is 4080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a couple of differential equations I need to solve, or rather just check my solution to, so I am wondering how I could use maple either solve the differential equations for me, or plug in my solution and see if it works.

Share this post


Link to post
Share on other sites
Advertisement
Maple can sometimes solve DE's for which there is an analytic solution. Its been a while (years) since I used Maple for this, so I remember nothing and can't advise on how to do it.

I can say that although Maple can do this for you, its solution often is not presented in the most simple form. Unless your problem is quite simple, the Maple symbolic solution is likely to be extremely difficult to compare with something you've done, and presumbly simplified, by hand. I'd give it at best a 10% chance of producing something clean. The numerical solutions may be much better, but you'd have to have a way to plot or evaluate your own solution to compare against Maple's numerical solution.

Share this post


Link to post
Share on other sites
Indeed, hidden monsters lurk within. Nevertheless, some code to solve an ODE goes along the lines of:
> ODE1 := diff(y(x), x$2) - x*diff(y(x), x) = y(x);
> dsolve(ODE1);
This will solve y''' -xy' = y for y(x). Obviously, there's a lot more to Maple than this, but there's nothing like an example to get you started.

Suppose I wanted to verify that z(x) = Aeix is a solution to z''' = -z, I would do something like:
> z := x -> A*exp(I*x);
> ddz := x -> diff(z(x), x$2);
> simplify(ddz(x) + z(x));
or equivalently, using the implicit D operator,
> z := x -> A*exp(I*x);
> ddz := D(D(z));
> simplify(ddz(x) + z(x));
and ensure that the result is zero (in either case).

Good luck
Admiral

Edit: Thanks, Todo.

[Edited by - TheAdmiral on March 24, 2007 4:15:33 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by TheAdmiral
Indeed, hidden monsters lurk within. Nevertheless, some code to solve an ODE goes along the lines of:
> ODE1 := diff(y(x), x$2) - x*diff(y(x), x) = y(x);
> dsolve(ODE1);
This will solve y'''' -xy' = y for y(x). Obviously, there's a lot more to Maple than this, but there's nothing like an example to get you started.

Suppose I wanted to verify that z(x) = Aeix is a solution to z'''' = -z, I would do something like:
> z := x -> A*exp(I*x);
> ddz := x -> diff(z(x), x$2);
> simplify(ddz(x) + z(x));
or equivalently, using the implicit D operator,
> z := x -> A*exp(I*x);
> ddz := D(D(z));
> simplify(ddz(x) + z(x));
and ensure that the result is zero (in either case).

Good luck
Admiral


A small correction due to the forum killing of pairs of single quotes ;-).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!