The PTC Community is on temporary read only status in preparation for moving our community to a new platform. Learn more here
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:
Mathcad Prime 11 file attached.
Solved! Go to Solution.
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
2) For RKadapt to work OK, the initial conditions must be dimensionless but D can be used as it is
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:
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
2) For RKadapt to work OK, the initial conditions must be dimensionless but D can be used as it is
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:
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.
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."
Thanks Werner -- you da Man!
