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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

Translate the entire conversation x

Runaway Reaction Problem: ODE Solve

EA_14382939
2-Explorer

Runaway Reaction Problem: ODE Solve

MathCAD Experts,

I'm trying to implement a model of a runaway reaction in MathCAD and I am stuck. I have tried everything including rewriting it several times to make sure that I don't have inconsistent units. I used the same variable definitions and then evaluated the derivative terms to make sure they were properly defined before defining them as functions. I thought I'd solved all my problems and now it's telling me that my initial conditions "aren't valid differential equations." Any advice would be most helpful. 

 

I am using MathCAD 9.0.0

Sincerely,

Erik 

5 REPLIES 5
Werner_E
25-Diamond I
(To:EA_14382939)

Problem are not the units but your "implicit functions". They have no effect.

I have not tried but you may succeed if you include all these function in the odesolve command additionally to the five functions you are actually looking for.

 

In the attached Prime 9 sheet I used a different approach I defined these functions in front of the solve block and with the (currrent) values of T, P, etc. as their arguments.

Werner_E_0-1761867129536.png

These functions now are used in the ODE's in the solve block.

Werner_E_1-1761867288764.png

This works OK but I am not sure if the results are as you expected

Werner_E_2-1761867429216.png

 

 

I'll double check the textbook to see if the I used were correct. But just to confirm, when defining implicit functions like this in ODE's those should be done outside of the solve block and they don't need to be of just the main independent variable?

Werner_E
25-Diamond I
(To:EA_14382939)

As these implicit functions are used by the ODE's they have to be defined in front of the solve block (using normal definitions :=). But as these functions are using the current values of the unknown functions we are looking for, these current values have to be provided via arguments.

None of these functions depends on the time t, they just depend on current values of CA,CB, CS, T and P, So there is no need to add t to the argument list.

But what I did was just one way which came into my mind to deal with the problem.  Another might (you will have to give it a try) be as already said to let the definitions the way you wrote them inside the solve block but add their function names in the "odesolve" command. It might work (I am not sure about that) even though these functions are not ODE's.

A third way could be to get rid of these functions altogether and use their expressions when defining the ODE's. But I guess this would look quite ugly and confusing.

 

Werner_E
25-Diamond I
(To:Werner_E)

I tried the second method and it also works OK.

 

Had to fix some of your typos:

P(t) instead of just P in the definition of F.Vent

missing arguments (t) in the definitions of r.1 and r.2

missing unit second in the argument "20" in odesolve.

 

We also must provide initial values for the "implicit functions" which is a bit annoying as they have to be derived from the initial values of the other five functions.

 

At the end the result is the very same as in my first approach.

 

BW it should not surprise that the function C.A, C.B and C.S look approximately constant (the aren't).

The slope of, for example, C.A is really very very tiny

Werner_E_1-1761873523269.png

 

Personally I would prefer my first approach, but you have the choice now.

 

Prime 9 sheet attached

 

 

Hello EA_14382939,

 

It looks like you have some responses from a community champion. If it helped you solve your question please mark the reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

Announcements

Top Tags