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

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

System of ODEs

DPEngineer
1-Visitor

System of ODEs

I came across this sytem of ODEs on a Differential Equations primer website, and am wondering if there is a way to model it in MathCAD (15)?

Thanks!

ACCEPTED SOLUTION

Accepted Solutions

As Harvey says, not a system, two seperate equations.

View solution in original post

15 REPLIES 15

That is not a system of equations. They are independent of each other. You can solve each equation independently using Mathcad's ODE solvers.

Good point, Harvey. This is not a system of equations. My terminology has gotten a little rusty over the years...

What I am having trouble with is determining (with MathCAD) the value of tm (which is known to be 35.475). Any advice?

So it looks like you want to find the value of t where Q1 = 500? And then you solve the next equation for Q2 starting at that time, tm?

Exactly...

The way I would do it is to solve, by hand, the first equation in symbolic form. Mathcad doesn't solve ODE's symbolicly. Then I would set the symbolic expression for Q1 to equal 500 and solve for t. This latter step can be done using the Find block or possibly other ways.

An alternative that I haven't used is to solve the first ODE using Laplace methods which I think Mathcad can do. This would save you the manual step of solving the first equation.

If you wait long enough, someone will do this for you. I like to give guidance instead of doing everything.

Thank you, Harvey. The Laplace method might be an interesting path to go down. While I appreciate that the first equation can be solved by hand (symbolically), my fascination with this problem (and subsequently MathCAD) is in the potential to automate this calculation. This problem describes a two-stage problem where the second stage kicks in when a certain value is reached (Q1=500 in this case). While this particular problem has no application to my line of work, I could envision similar (multi-stage) problems that do. To have a MathCAD worksheet that would automate this calculation would be quite a time-saver. I will poke around at the Laplace methods and see what they can do. Thanks again!

David,

A totally automated numerical approach is probably possible using the programming structure. However, you would probably have to create the numerical integration scheme for the first equation so that it could be done with a check on the value of Q1 at each step. Once Q1=500, then the program moves on to solve the second equation.

You might be able to use a loop structure for solving the first equation using Rkadapt, etc by increasing tend slowly until the Q1=500 is reached. However, this will add computation time as compared to a single integration using your own numerical method.

These methods would be useful if you have an equation 1 that can't be solved by Laplace method.

Let me know how the Laplace approach turns out.

As Harvey says, not a system, two seperate equations.

You make it look too easy. Thanks! Your point is noted regarding the terminology.

Nice work Fred. I hadn't thought of doing the first equation with the numerical-Find method.

Your version is not fully correct according to the original problem with regards to the right hand side of the second equation.

Yet another approach to calculate the values for t.m and t.e automatically. Kind of brute force, though and unprecise with respect to t.e.

Here's another variant.

Alan

Werner_E
25-Diamond I
(To:AlanStevens)

Nice way.

q1 could be a one-liner: q1(tm):=Q1fn(tm,tm)

Werner Exinger wrote:

Nice way.

q1 could be a one-liner: q1(tm):=Q1fn(tm,tm)

Yes. I guess this is a matter of personal taste.

Also, I was wrong to write in the worksheet that Q2 is valid from 0 to te. As written, it's only valid from tm to te.

Alan

The Laplace method worked, but it required one manual cut and paste to obtain the transformed equation, so it wasn't totally automated.

Announcements

Top Tags