Skip to main content
15-Moonstone
March 19, 2026
Solved

Probem with ODE solvers with units

  • March 19, 2026
  • 1 reply
  • 102 views

I normaly use odesolve in a solve block.

 

However, I.m struggling to learn how to use the other ODE solvers with units. I asked AI to provide an example. Sadly, the AI example also failed. Typical (cryptic error messages:

 

 
 

ODE errors.png

Mathcad Prime 11 file attached.

Best answer by Werner_E

I am not sure if these stand alone solvers are meant to work with units.

I experienced some discrepancies:

1) For rkfixed to work OK the matrix D must be made dimensionless, the initial conditions can be supplied with units

grafik.png

 

2) For RKadapt to work OK, the initial conditions must be dimensionless but D can be used as it is

grafik.png

 

In both cases s0 is (erroneously) dimensionless, but the results for s1 and s2 come out with the correct units when rkfixed is used.
Both functions don't seem to care about the units used in x.start and x.end. It doesn't matter if we apply units here or not.

Quite inconsistent. But as we don't know, if these functions are meant to be used with units (the help is not helpul, just talking about real values and scalars but isn't mentioning units) we can't say if we are experiencing bugs or just side effects because of incorrectly using the functions with units.

 

BTW, I found a 14 year old thread which also covers inconsistencies of the stand alone solvers when using units -> Units in the rkfixed function

 

And because you mentioned AI. I don't believe much in AI, and the accuracy of the answers you get from it is, at the very least, highly questionable. Nevertheless, here is the answer provided by Google's AI:

grafik.png

1 reply

Werner_E25-Diamond IAnswer
25-Diamond I
March 19, 2026

I am not sure if these stand alone solvers are meant to work with units.

I experienced some discrepancies:

1) For rkfixed to work OK the matrix D must be made dimensionless, the initial conditions can be supplied with units

grafik.png

 

2) For RKadapt to work OK, the initial conditions must be dimensionless but D can be used as it is

grafik.png

 

In both cases s0 is (erroneously) dimensionless, but the results for s1 and s2 come out with the correct units when rkfixed is used.
Both functions don't seem to care about the units used in x.start and x.end. It doesn't matter if we apply units here or not.

Quite inconsistent. But as we don't know, if these functions are meant to be used with units (the help is not helpul, just talking about real values and scalars but isn't mentioning units) we can't say if we are experiencing bugs or just side effects because of incorrectly using the functions with units.

 

BTW, I found a 14 year old thread which also covers inconsistencies of the stand alone solvers when using units -> Units in the rkfixed function

 

And because you mentioned AI. I don't believe much in AI, and the accuracy of the answers you get from it is, at the very least, highly questionable. Nevertheless, here is the answer provided by Google's AI:

grafik.png

25-Diamond I
March 19, 2026

In the thread I linked to above Viktor Korobov mentioned that Radau worked OK, so I gave it a try.

It looks like Radau can be used with units and the results come with correct units as well.

grafik.png

I asked Googles AI and the answer was the same as with rkfixed - "No, the radau function in Mathcad Prime cannot be used with units."