blogfast25
Thoughtprovoking Teacher
Posts: 10334
Registered: 322008
Location: Old Blighty
Member Is Offline
Mood: No Mood


Wolfram Alpha's "DSolve"
Does anyone here have any experience with Wolfram Alpha's DSolve computational database for solving ODEs?
http://reference.wolfram.com/language/tutorial/DSolveOvervie...
A few quick initial tests got me quite excited.


Metacelsus
International Hazard
Posts: 2055
Registered: 26122012
Location: Minneapolis, Minnesota, USA
Member Is Offline
Mood: Double, double, toil and trouble


I've used Mathematica's DSolve function before, and it's quite good.
As below, so above.


blogfast25
Thoughtprovoking Teacher
Posts: 10334
Registered: 322008
Location: Old Blighty
Member Is Offline
Mood: No Mood


Thanks for queuing in an orderly fashion to answer my question!
[Edited on 332015 by blogfast25]


Oscilllator
International Hazard
Posts: 659
Registered: 8102012
Location: The aqueous layer
Member Is Offline
Mood: No Mood


I used MAPLE a bit at my university for questions like this, before switching to wolfram alpha because it has a much more user friendly interface that
can tolerate a missing semicolon.


sparkgap
International Hazard
Posts: 1222
Registered: 1612005
Location: not where you think
Member Is Offline
Mood: equilibrated


Speaking as a heavy Mathematica user: DSolve[] does pretty well for almost all linear
ODEs and some nonlinear ODEs. If your ODE is listed in the Handbook of Exact Solutions for Ordinary Differential Equations, or is convertible into a form listed there, DSolve[] can likely deal with it. (Certainly, don't expect the function to be able to handle, say, the Painlevé or Chazy
equations!)
sparky (~_~)
P.S. PDEs are a different kettle of fish, as you might already know.
"What's UTFSE? I keep hearing about it, but I can't be arsed to search for the answer..."


blogfast25
Thoughtprovoking Teacher
Posts: 10334
Registered: 322008
Location: Old Blighty
Member Is Offline
Mood: No Mood


It's supposed to do PDEs as well, no?
http://reference.wolfram.com/language/ref/DSolve.html
I still haven't found a direct way to integrate f(x) between say x<sub>1</sub> and x<sub>2</sub>, though...


annaandherdad
National Hazard
Posts: 362
Registered: 1792011
Member Is Offline
Mood: No Mood


What do you mean by a direct way? Do you want a formula, or a numerical answer? Packages like Mathematica will do both, although of course a formula
isn't always available. If you want to know how the numerical integration works, try reading Numerical Recipes for starters. Romberg integration
works well on analytic integrands, and is very interesting too.
Any other SF Bay chemists?


blogfast25
Thoughtprovoking Teacher
Posts: 10334
Registered: 322008
Location: Old Blighty
Member Is Offline
Mood: No Mood


Do I sound like someone who doesn't know that?
I haven't found the DSolve syntax for ∫f(x)dx between x<sub>1</sub> and x<sub>2</sub> yet.
Integrating y'(x) = f(x) with DSolve is no problem.
[Edited on 432015 by blogfast25]


annaandherdad
National Hazard
Posts: 362
Registered: 1792011
Member Is Offline
Mood: No Mood


Sorry, didn't mean any offense.
However, to repeat, Romberg integration is very cool, and there's a beautiful theory underlying it.
[Edited on 432015 by annaandherdad]
Any other SF Bay chemists?


sparkgap
International Hazard
Posts: 1222
Registered: 1612005
Location: not where you think
Member Is Offline
Mood: equilibrated


It can do PDEs, but not very elaborate ones. So, don't expect it to be able to deal with something like Kortewegde Vries. Separable PDEs ought to be
a snap.
Romberg is certainly neat, but that algorithm is in the context of definite integration as opposed to the integration of differential
equations. The Richardsonian method that is the direct analog of Romberg for differential equations is the BulirschStoer method. Completely analogous
to Romberg, one starts with approximations to the solution with increasing step fineness, and then uses polynomial extrapolation to obtain a
(supposedly) more accurate estimate.
The method is numerical and not symbolic, but then again, there aren't that many DEs that admit closedform solutions.
sparky (~_~)
"What's UTFSE? I keep hearing about it, but I can't be arsed to search for the answer..."


annaandherdad
National Hazard
Posts: 362
Registered: 1792011
Member Is Offline
Mood: No Mood


Thanks for the note, I didn't know that about Bulirsch Stoer. In my work we use symplectic integrators, but they only work for Hamiltonian ode's.
But you're making me wonder if a Hamiltonian version of the RombergBulirschStoer idea is known.
Of course pde's are another game. Our group has been thinking lately about multisymplectic integrators for nonlinear pde's.
One reason I find Romberg integration interesting is that if you start with the Poisson sum formula for a periodic delta function, you can get an
explicit remainder term for the trapezoidal rule, which reveals a lot of information about the approximation. For example, there are interesting
games you can play, playing the log function (integral of 1/x) against the harmonic sum.
Any other SF Bay chemists?


sparkgap
International Hazard
Posts: 1222
Registered: 1612005
Location: not where you think
Member Is Offline
Mood: equilibrated


Quote: Originally posted by annaandherdad  Thanks for the note, I didn't know that about BulirschStoer. In my work we use symplectic integrators, but they only work for Hamiltonian ode's. But
you're making me wonder if a Hamiltonian version of the RombergBulirschStoer idea is known. 
I've seen attempts, but I've no experience with them.
sparky (~_~)
"What's UTFSE? I keep hearing about it, but I can't be arsed to search for the answer..."


smaerd
International Hazard
Posts: 1262
Registered: 2312010
Member Is Offline
Mood: hmm...


blogfast we used DSolve in my ODE course after we learned the graphical means of solving ODE's. It's quite powerful I play with it once and a while on
my raspberrypi (Mathematica is free for the device).
As far as symbolic integration Mathematica has been doing this for a long time with clean integrals. Obviously not all integrals are solvable. It's
how I used to check my calculus 2 homework. Edit  granted it often takes the long way around, and can give weird variants of solutions(sometimes in
awful forms). Explicit integration is definitely possible I forget the syntax but even wolframalpha.com can do it.
A few months back I started attempting to write some code that gave symbolic taylor and mclauren expansions for solving some basic ODE's via power
series etc. Very cumbersome process and I had to abandon it out of a lack of a clean way to express the mathematical language in syntax.
I tried teaching myself PDE techniques a year or so ago. It's hard to find a good book about it. It seemed to me that there is no real general means
once a PDE is not seperable and is more of an art in applying all of the worlds mathematics in a case by case basis, and obscure transformations. If
anyone has any suggestions for texts or resources please let me know. I'm very interested in numerical solutions and simulations for fluid
mechanics(openFOAM, etc) especially in the presence of external fields (magnetohydrodynamics).
[Edited on 3082015 by smaerd]


blogfast25
Thoughtprovoking Teacher
Posts: 10334
Registered: 322008
Location: Old Blighty
Member Is Offline
Mood: No Mood


I've been using DSolve quite a bit by now and it's quite amazing what it can do. And for my kind of use I've probably not even pushed the capability
envelope.
I got some nice DSolve results with second order DEs, like Schrodinger's equation for various types of bound electrons.


aga
Forum Drunkard
Posts: 7028
Registered: 2532014
Member Is Offline


Quick check : you're all still speaking English right ?


smaerd
International Hazard
Posts: 1262
Registered: 2312010
Member Is Offline
Mood: hmm...


Think I might of found some ODE's that Mathematica can't solve! Solver has been running for 20 minutes without returning anything. Not good as this
was an expected problem in my Kinetics course...


blogfast25
Thoughtprovoking Teacher
Posts: 10334
Registered: 322008
Location: Old Blighty
Member Is Offline
Mood: No Mood


Quote: Originally posted by smaerd  Think I might of found some ODE's that Mathematica can't solve! Solver has been running for 20 minutes without returning anything. Not good as this
was an expected problem in my Kinetics course... 
Which problem?
A couple of days ago it gave up on a nonlinear DE of mine too.
[Edited on 2392015 by blogfast25]


annaandherdad
National Hazard
Posts: 362
Registered: 1792011
Member Is Offline
Mood: No Mood


Quote: Originally posted by smaerd 
A few months back I started attempting to write some code that gave symbolic taylor and mclauren expansions for solving some basic ODE's via power
series etc. Very cumbersome process and I had to abandon it out of a lack of a clean way to express the mathematical language in syntax.

Is this the kind of thing you were trying to do?
http://www.sciencedirect.com/science/article/pii/08981221940...
Chang is a friend of mine, I'm kind of familiar with what he did.
Any other SF Bay chemists?


smaerd
International Hazard
Posts: 1262
Registered: 2312010
Member Is Offline
Mood: hmm...


@blogfast  it's a brutal ODE. I had to use a NewtonRaphson solver to find a hairy cubic root of a trinomial which had a symbolic value in it
(artifact of a substitution). Then I grabbed the only real root and chucked that into a rate equation and asked mathematica to try and solve it. No
dice, and I've checked my preliminary steps fastidiously (not a gaurantee to be free from error but not very likely). No clue how this will copy and
paste,
Quote:  sol = DSolve[{Z'[t] ==
2*k3*(0.005747126436781609` (5000.` 
29.` Z[t]) + (3.991060025542784`*^31 \
(3.60000112752`*^39  4.2486624`*^37 Z[t] 
1.21104`*^35 Z[t]^2))/(1.25000058725`*^23 +
2.2128453406053803`*^21 Z[t] +
1.2834501386019`*^19 Z[t]^2 + 2.3367185`*^16 Z[t]^3 +
150.68842025849233` \[Sqrt](5.062677114182215`*^28 
6.524644065161255`*^31 Z[t] 
2.1021533165696234`*^34 Z[t]^2 
1.1499480491088463`*^34 Z[t]^3 
1.9986292528062663`*^32 Z[t]^4 
1.15510429551571`*^30 Z[t]^5 
2.149028325`*^27 Z[t]^6))^(1/3) 
5.747126436781609`*^7 (1.25000058725`*^23 +
2.2128453406053803`*^21 Z[t] +
1.2834501386019`*^19 Z[t]^2 + 2.3367185`*^16 Z[t]^3 +
150.68842025849233` \[Sqrt](5.062677114182215`*^28 
6.524644065161255`*^31 Z[t] 
2.1021533165696234`*^34 Z[t]^2 
1.1499480491088463`*^34 Z[t]^3 
1.9986292528062663`*^32 Z[t]^4 
1.15510429551571`*^30 Z[t]^5 
2.149028325`*^27 Z[t]^6))^(1/3))^2  k33*Z[t],
Z[0] == 0}, Z[t], t] 
@anaandherdad  Chang succeeded and went miles over where I ended up. I'll have to read the paper to see how they handled these problems more in depth
but what they did at first glance is interesting. I'm not seeing how they handled symbolic notation yet though.
Is there any work around methods to plotting a Ratelaw expression without integrating/solving the ODE? Like can I use the right hand side of a rate
expression to denote the change and somehow step that through time?
[Edited on 2392015 by smaerd]

