Skip to main content
1-Visitor
May 23, 2013
Solved

Problems with solving a system of 5 differential equations 1st order

  • May 23, 2013
  • 3 replies
  • 11296 views

Hello PTC Community,

I have problems solving a system of 5 differential equations simultaneously by using ODESOLVE in Mathcad Prime 2.0. I tried other solvers too, but i have the most experience with odesolve. I just don't get the solver to work, no matter what I do. Could you please take a look at my file and tell me, if I have some Syntax-mistakes or anything like it.

The equations should be able to calculate the dispersion of gas, leaking out of a ruptured vessel in a cylindric form.

u represents the speed of the flowing gas

b is the radius of the cylinder

Theta is the angle between the direction of the gas and the horizon

c is the concentration of the leaking gas

T is the temperature of the flow

All those five dependent varibles depend on the independant variable sL, which represents the distance of the center of the cylindric flow to its origin at the ruptured vessel.

Am i maybe using the wrong solver? Any help or suggestions are greatly appreciated.

Tim

Best answer by AlanStevens

In spite of my earlier comment I have had a go at rearranging the equations. The process I followed was:

1. Collect together all terms multiplying a given derivative on the RHS.

2. Define ancillary functions for each of these.

3. Because dtheta/dw doesn't depend on the other derivatives replace this in the other equations by the functions on its RHS.

4. There are three equations that now contain only du/dw, db/dw and dT/dw, so solve for each of these explicitly (ie solve for du/dw, db/dw and dT/dw)

5. Create functions from each of these solutions (they have a common denominator)

6. Now odesolve works.

See attached.

I will almost certainly have made a midtake somewhere along the line, so you will need to repeat the process, rather than relying on my results. I've plotted the results, but I've no idea if they look sensible or not.

Alan

PS I'll have a quick look at your latest attempts shortly.

3 replies

25-Diamond I
May 23, 2013

I couldn't spot a severe syntax error on first sight.

When I first open the file directly from you post I get an error telling me that the matrix of derivatives could not be created.

When I let the file recalculate or on saving it and reopening I get a different error: " Unknown error: exp%_too%_large".

So maybe its a bug in Prime or a limitation which should be dealt with. Prime is a work in progress, a rather unfinshed product and by no means can live up tp prior Mathcad versions like 15 or 14 (or 11 of course).

Unfortunately there is no way to save a file in MC15 format from within Prime and there is no converter available, so, as I'm not really that idle that I would retype the whole sheet, I cannot try if it would work in Mathcad 15.

tsiebert1-VisitorAuthor
1-Visitor
May 23, 2013

Thank you for your fast answer,

yes those are the two errors i do get as well. Do you have any idea how i can find those limitations? Or do I have to look at each term in separate?

25-Diamond I
May 23, 2013

I am not sure. As you have possibly guessed I don't like Prime and so I lack experience using it. I'll stay with Mathcad 15 as long as possible.

I am not sure about the Prime bug or limitation and don't know how to verify unless someone from PTC will confirm.

Maybe you can try to simplify your huge expressions just to see if its a syntax issue. If the system gets somehow unsolveable at least the error message should change.

Its a pity we cannot try in MC15 as there is no converter available.

24-Ruby IV
May 23, 2013

We have problems with odesolve:

- in Mathcad 15 we can not work with units

- in Prime we have problems with lables of variables, functions and constants (find and see please my messages here about it).

And some litle remarks

- g is built-in constant

- do not use the = operator after the odesolve function

25-Diamond I
May 23, 2013

- in Mathcad 15 we can not work with units

which is rather annoying indeed as we have to use some nasty and unsatisfyable workarounds.

- in Prime we have problems with lables of variables, functions and constants (find and see please my messages here about it).

I remember that problem from some other threads. I looked over the expressions (but not with the necessary meticulousness, though) and didn't spot anything of that kind. Did you find some of these inconsistancies in Tim's file?

According to the error mesages thrown I guess the error to be something else.

- g is built-in constant

Tim redefined it at the top which should not do any harm.

- do not use the = operator after the odesolve function

Agreed, but deleting it does not change the situation.

Do you have the same problem in your Prime3 installation?

24-Ruby IV
May 24, 2013

Sometime I use an open program to see a part of ODEs solution:

http://twt.mpei.ac.ru/ochkov/Mathcad_12/5_13_My_rkfixed.png

tsiebert1-VisitorAuthor
1-Visitor
May 25, 2013

Hello Valery,

I am sorry, but I do not understand, what you are trying to tell me. Is this just an example of your open program, or is it specifically a part of one of my equation?

So your goal here is to find parts of an equation, that tend to go to infinity, am I right?