Skip to main content
15-Moonstone
January 10, 2021
Question

Stiff ode solvers

  • January 10, 2021
  • 2 replies
  • 3163 views

I previously posted a version of this question, but did not get any response. So I decided to rephrase and try again.

 

I have been trying to compare the solvers (BDF, Radua, Stiffr and Stiffb) for stiff odes. Could be doing something stupid but BDF is the only one that I can get to run consistently. For the others I get error messages I do not understand (in this context):

"The return value of this function must match the problem size"

"This value must be real"

(BTW. Documentation says Stiffb does not work for more than 8 equations, but it seems like it should be "8 or more". 7 worked. 8 did not.)

Thanks to anyone who chimes in. 

If you run the worksheet, be patient. It takes a while to calculate. 

 

2 replies

24-Ruby III
September 23, 2021

What is the initial setting of the problem that you want to solve with the program?

 

P.S. Crosspost: https://community.ptc.com/t5/PTC-Mathcad/Error-messages-in-solving-a-system-of-ode-s/m-p/704764

21-Topaz II
September 24, 2021

The constant tp is neither defined nor initialized anywhere. How does the processor calculate sin (2πt / tp)?

25-Diamond I
September 24, 2021

@-MFra- wrote:

The constant tp is neither defined nor initialized anywhere. How does the processor calculate sin (2πt / tp)?


The solve block is evaluated symbolically and the result is assigned to a function D which has tp (substituted by y[5) as one of its arguments. So all is OK and when you let the sheet run it works OK (at least with BDF and Radau & IC21).

BTW, VladimirN  had unearthed a more than 8 months old question and obviously no one had an idea so far why the solvers other than BDF fail.

21-Topaz II
September 24, 2021

Although you work in symbolic, don't you have to initialize the variables first and then reset them for symbolic computation? otherwise if you write tp = ? before the Given, it marks it in red. As a result nothing changes, on this I agree.