Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Hi Folks,
I have a system of three coupled ODEs that I'm trying to solve in Prime 10. I seem to have a syntax error, but the help files are so terse, I can find an example to follow. I'm sure I'm making a basic mistake, but I can't figure it out from the documentation.
I'd be most obliged if someone could point me in the right direction.
The attached file actually has two different solution attempts in it. The first is a state space solution with rkfixed. I followed a short example from the documentation, but it doesn't work. The second is the uses odesolve in a solve block.
I'd be happy if I could get either one to work, but the solve block version seems like it takes better advantage of Prime's features.
Edit: I figured out the problem with the odesolve solution. I defined three of the initial conditions incorrectly. I wrote x1'(t)=0 rather than x1'(0)=0. That just leaves the state space solution. I still don't know what's wrong with it.
Solved! Go to Solution.
When defining matrix D you should you have to omit the argument (t) when you use z
Your end-value t1 is much too large, the values calculated for the function values are going beyond the numerical limit.
But using 0.1 instead of 1 as in the variant with "odesolve" works OK
The results of odesolve and rkfixed pretty much look the same.
First row shows a lin-log plot which is the reason x3 had to be negated. You see that the values go up as hight as 10^120.
Second row shows a lin-lin plot but limits the time range to a max of 0.005
BTW, I'm in agreement with your evaluation of the help's effectiveness, particularly concerning the absence of substantial examples. In my opinion, there should be much more and at least one concrete example directly adjacent to the explanation of a command, eliminating the necessity to navigate to other links.
At the bottom of the Help home page you will find a note stating that the PTC documentation team accepts feedback and suggestions by e-mail. Perhaps it makes sense for you to write to Mathcad-documentation@ptc.com and tell them about your experience with the help system,
Prime 10 sheet attached
When defining matrix D you should you have to omit the argument (t) when you use z
Your end-value t1 is much too large, the values calculated for the function values are going beyond the numerical limit.
But using 0.1 instead of 1 as in the variant with "odesolve" works OK
The results of odesolve and rkfixed pretty much look the same.
First row shows a lin-log plot which is the reason x3 had to be negated. You see that the values go up as hight as 10^120.
Second row shows a lin-lin plot but limits the time range to a max of 0.005
BTW, I'm in agreement with your evaluation of the help's effectiveness, particularly concerning the absence of substantial examples. In my opinion, there should be much more and at least one concrete example directly adjacent to the explanation of a command, eliminating the necessity to navigate to other links.
At the bottom of the Help home page you will find a note stating that the PTC documentation team accepts feedback and suggestions by e-mail. Perhaps it makes sense for you to write to Mathcad-documentation@ptc.com and tell them about your experience with the help system,
Prime 10 sheet attached
Hi Werner,
Thanks much for your prompt and helpful response. I don't think this is the first time you've solved a problem for me. When I become king of PTC, you will be my first hire 🙂
Mark