Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Translate the entire conversation x

Non-converging ode calculation

JohnRudnicki
15-Moonstone

Non-converging ode calculation

I am solving an ode. The calculation converges for some parameters but not for others. My problem is I cannot figure out why. There seem to be no obvious causes, e.g. like a denominator going to zero. I have looked at a number of other aspects without success. I am not mathematically adept enough to tease something out analytically, but maybe some one else is. If anyone has any insights or suggestions, I would appreciate it.

 

I have attached a worksheet. It is MathCad 11. I know there are some others out there using legacy versions like me (still using MC14). 

 

Also sometimes instead of the non-converging error message, mc flags the rhs of the ode and says "The return value of this function must match the problem size." What does this mean?

3 REPLIES 3
LucMeekes
23-Emerald III
(To:JohnRudnicki)

There's no tau in the set of differential equations:

LucMeekes_0-1742421312549.png

It results in no y2 in the set D(t,y):

LucMeekes_1-1742421424478.png

Could that be a ( or, the ) problem?

 

Success!
Luc

Using your IC03 seems to fail for t.end larger than the value seen in the picture below.

Looks like the derivative is exceeding numerical limit and going in direction infinity at this position.

Werner_E_0-1742426051659.png

BTW, you know that writing TOL=10^-12 has no effect!? The default value (10^-3) still is in effect. You would have to use the three bars global definition "equal" sign if you wanted to see the effect of changing the value of this system variable.

 

Luc and Werner,

 

Thanks for taking a look and for the suggestions. In case you are interested.....It turns out the problem was with the function Dc which goes to zero with large V and causes the solution to blow up (as you noticed). In this case, the problem actually becomes ill-posed - no stable solution exists.  Because of this the non-convergence is not surprising. So the problem really had nothing to do with MathCad (except it helped revealing and tracking down the problem). I alleviated the problem by replacing Dc, which was a linearly decreasing function of ln(V)V (on the basis of experimental observations) by an exponential which agrees with the linear function for small ln(V) but does not go to zero.

 

Thanks again for taking a look.

 

Werner: Thanks for the info about TOL. I should have know that but even after using MCAD for more than 20, I am still a neophyte with syntax.

Announcements

Top Tags