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

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

ODE Solve - Too few initial conditions

NA_10137510
4-Participant

ODE Solve - Too few initial conditions

Hi, 

I'm trying to solve some ODE equations system to determine behavior of species, temperature and pressure for a plug flow reactor.

 

I already put all equations, relations between all terms and also the initial conditions, but on odesolve block i receive a message that says: "Too few initial conditions".

 

Thanks in advance for your help.

 

1 ACCEPTED SOLUTION

Accepted Solutions

Whenever Mathcad shows an error you can rightclick the erroneous position and get the option for error tracing. But in your case there seems to be nothing to trace.

I guess the error is because you still have a number of undefined functions in your ODE solve block which you don't solve for:

Werner_E_0-1639057232081.png

Not sure if I caught them all.

You are using these undefined functions and their derivatives in the solve block and so Mathcad expects you to provide guess values for them and also that you solve for them.
So either add what Mathcad is expecting or maybe you can find another way to set up your model equations using less functions.

View solution in original post

6 REPLIES 6

You use a lot of undefined functions - all those x.---, h and MW.mix and other MW.---

You have to solve for ALL the unknown functions and also provide initial conditions.
Or you try to formulate the system using fewer functions.

NA_10137510
4-Participant
(To:Werner_E)

Hi Mr. Werner,

I dont know what you really mean... for example for MW.mix

NA_10137510_0-1638998307666.png

now when I include thay on derivatives for odesolve...:

NA_10137510_1-1638998427135.png

As I see is totally constrained, for initial stage...

 

All MW functions MW.CH4, MW.O2.... etc are constants...

NA_10137510_2-1638998606196.png

 

 

I would appreciate your detailed explanation.

 

Regards,

Nicolas.

 

All the functions you use in the solve block must either be defined before the solve block or must be included in the closing odesolve(...) statement. You must solve for those functions even if they are only intermedeate functions you are not interested in finally.

I was wrong about most of the MW.--- as you actually never used them as functions.

But this does not apply to MW.mix which you use as function. But I can't see that this function is used anywhere (maybe I overleooked something). So I think it could be deleted. BTW, when you write the derivative of MW.mix(x) (which seems not to be used anywhere, too) it should read MW.mix(x)^-2 rather than MW.mix(x)^2.

 

EDIT: I overlooked that MW.mix is used in the ODE for function P(x).

I would suggest to replace these functions by their definition and write

Werner_E_0-1639004002941.png

 

If you don't like this idea, there are two alternatives, though:

1) You define in front of the solve block

Werner_E_1-1639004144696.png

Werner_E_2-1639004374553.png

and in the solve block you use
Werner_E_3-1639004587212.png

Not really better, I know. But you get the idea.

 

2) Use
Werner_E_4-1639004736745.png

as you did initially anyway and delete what you wrote for the derivative of MW.mix (Mathcad knows how to build a derivative anyway).

Add an initial condition for MW.mix

Werner_E_5-1639004999944.png

and add MW.mix to list of functions to solve for:

Werner_E_6-1639005092977.png

 

You will have to find similar solutions for all other functions which are not defined but used in the solve block.

 

NA_10137510
4-Participant
(To:Werner_E)

Hi Mr. Werner,

I have checked all suggestions that you made. At least mathcad now tries to solve a little time, but the error keeps the same.

NA_10137510_0-1639025987110.png

 

Maybe there is a way to detect which variable is faulting? or some way to trace the error or debug it?

Whenever Mathcad shows an error you can rightclick the erroneous position and get the option for error tracing. But in your case there seems to be nothing to trace.

I guess the error is because you still have a number of undefined functions in your ODE solve block which you don't solve for:

Werner_E_0-1639057232081.png

Not sure if I caught them all.

You are using these undefined functions and their derivatives in the solve block and so Mathcad expects you to provide guess values for them and also that you solve for them.
So either add what Mathcad is expecting or maybe you can find another way to set up your model equations using less functions.

NA_10137510
4-Participant
(To:Werner_E)

Hi Mr Werner,

I checked the model, sadly it doesnt work for me. thanks for take your time to try an answer for me.

 

Regards,

Nicolàs.

Top Tags