Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

** Community Tip** - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more!
X

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Dec 08, 2021
01:33 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 08, 2021
01:33 PM

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.

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Dec 09, 2021
08:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 09, 2021
08:43 AM

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:

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.

6 REPLIES 6

Dec 08, 2021
03:55 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 08, 2021
03:55 PM

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.

Dec 08, 2021
04:23 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 08, 2021
04:23 PM

Hi Mr. Werner,

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

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

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

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

I would appreciate your detailed explanation.

Regards,

Nicolas.

Dec 08, 2021
06:16 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 08, 2021
06:16 PM

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

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

1) You define in front of the solve block

and in the solve block you use

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

2) Use

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

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

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

Dec 09, 2021
12:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 09, 2021
12:00 AM

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.

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

Dec 09, 2021
08:43 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 09, 2021
08:43 AM

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:

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.

Dec 14, 2021
10:25 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator

Dec 14, 2021
10:25 PM

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.