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

Translate the entire conversation x

Return value of this function must match problem size

JohnRudnicki
15-Moonstone

Return value of this function must match problem size

Solving ode's I have run into this error before:

 

https://community.ptc.com/t5/Mathcad/Return-Value-of-this-function-must-match-the-problem-size/m-p/727295/highlight/true#M195799

 

I managed to get around it by switching solvers from Radau to BDF, but I still do not know what the message means and changing solvers does not work this time. As shown in the attached (MCAD 11 - converted from MCAD14) worksheet, the denominator of dv does get small but never reaches zero because of the damping factor eta (Increasing eta does help but does not eliminate the problem. and eta should by ~10^{-12} on physical grounds. Setting p0 = 0 in the denominator does eliminate the problem,  although I do not see why. So, it does seem like the denominator is the problem, but, if so, I would have expected to get a "calculation does not converge" message. Tried playing around with other parameters to no avail. 

Any comments or suggestions would be appreciated.

ACCEPTED SOLUTION

Accepted Solutions

Don't know why but decreasing the tolerance argument from 10^-5  to 10^-6 makes BDF work (Radau still would fail, though).

Werner_E_0-1742858394859.png

 

View solution in original post

3 REPLIES 3

Don't know why but decreasing the tolerance argument from 10^-5  to 10^-6 makes BDF work (Radau still would fail, though).

Werner_E_0-1742858394859.png

 

That worked. I thought I tried this, but evidently not. I did have to keep decreasing the tolerance for larger amplitudes (epsilon) but it worked for the largest values. 

 

Do you know what that error message ("return value ...) actually means? 

 

Thanks.



Do you know what that error message ("return value ...) actually means? 

 


Unfortunately, no.

I searched the forum, but just to find out that you asked that question already a few years ago 😉

 

I noticed that you can also omit that sixth optional tolerance parameter and BDF would work OK.

This parameter can also be a vector and you can specify a different tolerance for each of the variables. It seems that its the first variable which needs the smaller tolerance value:

Werner_E_0-1742946765502.png

 

Announcements

Top Tags