Get Help

Turn on suggestions

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

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Newbie problem solving system of 3 ODE's

Options

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

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

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
03:02 PM

02-04-2019
03:02 PM

Hello,

I was able (with some help from the community 🙂 to solve a single ODE using a MathCAD 5.0 Solve Block but now I want to solve a system of 3 ODE's but I am getting an error (see attached file).

I suspect I am making some newbie error. If someone can enlighten me as to what that error is and tell me how to do the calculation correctly, it would be much appreciated.

TIA,

--Doug

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
05:48 PM

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
04:13 PM

02-04-2019
04:13 PM

Re: Newbie problem solving system of 3 ODE's

You have to apply units, even if the value is zero.

So to be on the save side you should write px'(0 s)=...

But you have a unit problem/mismatch in your equations:

You have an expression (1-px(t)) which means px(t) is dimensionless!

So your equation MeOH'(t)=-px'(t) meanst that MeOH(t) must be dimensionless, too.

But one of your IC says MeOH(0 s)=a*rx and this would mean unit mol/Litre which is NOT dimensionless.

So that's a discrepancy.

Maybe the "1" in (1-px(t)) is not unitless? But then there would be other discrepancies, I think.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
04:40 PM

02-04-2019
04:40 PM

Re: Newbie problem solving system of 3 ODE's

OK, I found another error which caused the "unknown error" you experience. You typed a capital "P" instead of a lower case "p" as argument of odesolve.

The solve block still fails as of the aforementioned unit mismatches.

I tried your solveblock without any units at all and it works OK.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
04:42 PM

02-04-2019
04:42 PM

Re: Newbie problem solving system of 3 ODE's

Thanks for looking at this for me.

The "px" variable is a dimensionless fractional conversion.

You are correct that both the MeOH and VOH variables have units of mole/L (i.e. concentration) which meant that the MeOH' derivative was not correctly defined in my original file. I also added "min" to the IC specifications.

But I still get an error for the first IC spec.

I have uploaded a revised version with MeOH' defined correctly with units of mole/L and "min" added to the IC spec's.

Thanks again for looking at this for me.

--Doug

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
05:22 PM

02-04-2019
05:22 PM

Re: Newbie problem solving system of 3 ODE's

I did fix the typo with the capital "P" but then hit the new units of measure issue.

Thanks for point that out.

I am trying to solve this system for a colleague. I need to get back to him and get the units of measure issues resolved.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-04-2019
05:48 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-05-2019
11:02 AM

02-05-2019
11:02 AM

Re: Newbie problem solving system of 3 ODE's

Thanks very much for your help.

I spent some more time with my colleague (whose problem this is) until we got all the units of measures issues resolved.

Once we did that (and assigned units for all the IC's), MathCAD solved it properly (see attached file).

Thanks again!

--Doug

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

02-05-2019
12:48 PM

02-05-2019
12:48 PM

Re: Newbie problem solving system of 3 ODE's

Ah, I see the change in the equation (a was wrongly taken as factor originally).

Glad you are up and running!

Top Tags