cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

SOLVED
15-Moonstone

## SYMBOLIC Differential Equation and System of Differential Equation

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.

44 REPLIES 44
24-Ruby IV
(To:Werner_E)

Maybe my reply was done too fast.

It looks like your sheet is working OK despite of the errors noted.

I attach a pdf print of your file after recalculation and after separating the overlapping regions.

Nice work, indeed!

23-Emerald I
(To:Werner_E)

Ha, that's nice. Thanks for checking.

I have one implementation in Mathcad 11 that allows:

And on the other LODE it returns:

So I guess it's done.

Well, almost... I'd like to make sure that the coefficients of the derivatives don't contain the independent variable. Because if they do, you get the wrong answer. Prof. Birkeland's polynome does not account for that, and I'm certain it's not easy to implement support for it..

Example:

this is not the solution.

In the attached file is a routine GetODEparts, with some examples next to it.

Please check if it runs in Mathcad 15. These are the expected results:

Thanks,

Luc

24-Ruby IV
(To:LucMeekes)

Looks good, here's the pdf

23-Emerald I
(To:Werner_E)

Thanks!

Does not look good, unfortunately. The result on Page3 does not meet my expectations.

The P1 and P5 values are OK.

The result for F1 should be just sin(x) and should NOT include any (derivative of) y_(x).

Similarly for F5, it should only be exp(tau).

Apparently MuPad, when requested to provide the coefficients for y_(t_), includes the derivatives of y_(t) with the other stuff that's not dependent of y_(t_). Maple doesn't do that:

(Where -1 is the coefficient of u(x), and -sin(x) is everything independent of u(x))

Though I must say, I can't blame MuPad for doing that. It may be the correct answer.

But it does mean that it's going to be harder to filter the particular function out of the LODE expression.

Does Mathcad 15 provide for a symbolic lhs() function (That takes the left-hand-segment of an expression, everything that is to the left of := or =  ) and the rhs() function (or symbolic keyword)? If that's the case, it may be possible to supply the LODE as:

and do:

If not, the differential equation solver function will (need to) require that the particular function is supplied as a separate argument (as it does in Prof. Birkeland's function).

Luc

24-Ruby IV
(To:LucMeekes)

I see the problem and I fear that Mathacd does not provide a LHS or RHS function/operator (similar to numer() and denom()). I would have needed them quite a couple of times when trying to automate the manipulations of an equation.

And you are correct about the working of the coeffs keyword and I, too, think that is correct from a math point of view. On the other hand - its wrong if u(x)=exp(f(x)), for example 🙂
Its not possible to give a correct result without knowing u(x), in fact.

23-Emerald I
(To:Werner_E)

Now I wonder if this works.

Luc

24-Ruby IV
(To:LucMeekes)

Clever!

Seems to work OK.
Here's the pdf

23-Emerald I
(To:Werner_E)

Hello @Werner_E ,

can you please convert the two files to (Mathcad 15) .xmcd files, check if the functions still work, and then attach them in a reply?

Thanks!
Luc

The final result is posted here:https://community.ptc.com/t5/PTC-Mathcad/Solving-Ordinary-Differential-Equations-symbolically/m-p/68...

24-Ruby IV
(To:LucMeekes)

Fine work! Sure something to keep in ones toolbox.

Find attached the two files converted to MC15 *.xmcd and also the pdf print of the example file.
I had to vertically separate the regions in the LM_... file so they won't overlap.

23-Emerald I
(To:CornelBejan)

It's done:

Now neat it up and transport to Mathcad 15.

Luc

23-Emerald I
(To:LucMeekes)

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

24-Ruby IV
(To:LucMeekes)

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

23-Emerald I
(To:Werner_E)

Hmm, now it becomes tapping in the dark.

Luc

24-Ruby IV
(To:LucMeekes)

Sorry! Same error again.

23-Emerald I
(To:Werner_E)

Installed a trial of Mathcad 15 and found out that, where this is posible in Mathcad 11: