Skip to main content
19-Tanzanite
September 3, 2020
Solved

SYMBOLIC Differential Equation and System of Differential Equation

  • September 3, 2020
  • 4 replies
  • 15934 views

Hello,

 

There is a function that can solve SYMBOLICALLY a differential equation and a system of differential equations automatically in Mathcad?

 

Or at least, how can I solve SYMBOLICALLY a differential equation or a system of differential equations (automatically) in Mathcad? But without using manually Laplace Transform for each term or Odesolve(-numeric/graphic), but rather something automatically...if exist...

 

Thank you.

Best answer by Werner_E

Heureka! Persistence sometimes pays off!

 

I guess the book you referred to is "Calculus and Algebra with Mathcad" by Byrge Birkeland. There was a version of the book for Mathcad 8 from 1999 and a later version for Mathcad 2000. Not sure if the MC8 version already included that chapter (4.3.2).

 

Anyway, here is a modified version of the described method which also works in Mathcad 15 (it will not work in Prime). As in the original version, the independent variable must be called "t" - this is mandatory!

Werner_E_0-1599211881028.png

 

 

 

4 replies

25-Diamond I
September 3, 2020

Unfortunately Mathcad does not provide any means to solve and ODE symbolically.
Best advice would have been to use Laplace which could be automated in older Mathcad versions MC11) but not in the current ones (neither in Mathcad 15 nor in Prime).

 

For symbolic solutions you will have to resort to programs like Maple or Mathematica.

Cornel19-TanzaniteAuthor
19-Tanzanite
September 3, 2020

So...the only solution is to apply Laplace Transform manually for solving symbolically differential equations and systems of differential equations in Mathcad?

25-Diamond I
September 3, 2020

@Cornel wrote:

So...the only solution is to apply Laplace Transform manually for solving symbolically differential equations and systems of differential equations in Mathcad?


Sure not the only solution, but Laplace seems to be the easiest way in many cases. But of course you could also solve the ODE(s) manually by integration and let Mathcad do the basic integration work.
Anyway, I don't know of a way to fully automatically get the symbolic solution for an ODE or a system of ODEs with Mathcad.

A long time ago I played around with the idea of writing functions to solve ODEs automatically in Mathcad using integration, but I only finished /to some part) linear first order ODEs and never took time to extend the method at least to second order ODEs (which I guess should be possible), let alone systems of ODEs.

As far as I remember, it was particularly tricky to find a way to use arbitrary names for the independent variable so as not to be set to just x or t.

In case you are interested and like to work along I attach the file. The comments mostly are in German but I guess you'll get the idea how to use the functions.

BTW - as the functions require symbolic evaluation inside of a program, they will not work in Prime any more.

23-Emerald IV
September 3, 2020

Given the right version of Mathcad (11), and some tweaking:

LucMeekes_0-1599171257767.png

But all this is unsupported.

 

Luc

25-Diamond I
September 3, 2020

Which means that you use Maple features not available in current Mathcad or Prime and which were never supposed to work in Mathcad the way you use them 😉

Werner_E25-Diamond IAnswer
25-Diamond I
September 4, 2020

Heureka! Persistence sometimes pays off!

 

I guess the book you referred to is "Calculus and Algebra with Mathcad" by Byrge Birkeland. There was a version of the book for Mathcad 8 from 1999 and a later version for Mathcad 2000. Not sure if the MC8 version already included that chapter (4.3.2).

 

Anyway, here is a modified version of the described method which also works in Mathcad 15 (it will not work in Prime). As in the original version, the independent variable must be called "t" - this is mandatory!

Werner_E_0-1599211881028.png

 

 

 

23-Emerald IV
September 4, 2020

Great!

 

In Mathcad 11 the construct with k<=i fails. As soon as I put that in, the function L forgets about the initial conditions, they're all set to 0.

Since its use is to limit k from going above i, this can also be accomplished by the upper limit of the inner summation. I also observed that the L function is not ORIGIN aware.

It appears that I can compact the DiffSolve function to a oneliner.

The result is:

LucMeekes_0-1599225321204.png

 

Luc

 

25-Diamond I
September 4, 2020

The one liner sure is possible only in MC11 but not in MC15.

 

The construct with *(k<=i) is necessary in MC15. I am not sure why, but the symbolic in MC15 seems not to like the "i" as an upper limit of the second sum.

The error message when trying to symbolically evaluating L(..) is "assumption impossible (property::Null)" ????

Otherwise your implementation would sure be more elegant and preferable. And yes, I agree that L should be written ORIGIN-aware 😉

23-Emerald IV
September 27, 2020

It's done:

LucMeekes_0-1601242519464.png

LucMeekes_1-1601242538317.png

Now neat it up and transport to Mathcad 15.

 

Luc

23-Emerald IV
October 1, 2020

@Werner_E 

Can you check if this works in Mathcad 15 with similar results to Mathcad 11 (pdf attached).

If it does work, please save both files as .xmcd.

 

Thanks
Luc

 

25-Diamond I
October 1, 2020

Unfortunately ODE systems don't work. The error message is an less helpful "pattern match exception".