Skip to main content
GameDev.net gamedev.net
🔒 Locked

Solving DE's with maple

Started by MTT Mar 22, 2007 at 6:00 PM 2 replies 850+ views
Original Post
MTT
MTT
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.
--------------------------http://www.gamedev.net/community/forums/icons/icon51.gif ... Hammer time
grhodes_at_work
grhodes_at_work
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.
Graham Rhodes Moderator, Math & Physics forum @ gamedev.net
TheAdmiral
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

Edit: Thanks, Todo.

[Edited by - TheAdmiral on March 24, 2007 4:15:33 PM]
Ring3 Circus - Diary of a programmer, journal of a hacker.
Todo
Todo
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 ;-).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.