Dears,
The error appears when I changed the boundary from 10^3 to 10^5 in Odesolve block.
May you help to fix this issue please.I am using Prime 9.0
Thanks in advance
BR
Solved! Go to Solution.
If the last suggestion (using the absolute value and the sign function, which keeps the derivative at zero instead of letting it rise again) is of any value to you, you should replace it by this equivalent function
as it seems to speed up the solve block significantly and produces a much clearer result.
Prime 9 sheet attached
I ave no explanation for this error.
I found that t.end=7613.203 to be the last value for t where the solve block still works. The value is also dependent on the intervals number, which I left unchanged from the 10^6 you had chosen.
My first guess was that it may be due to the if statement in the definition of C(s), but this seems not the case as s is way over 50000 and the solve block still works. We also clearly see the effect of this if-statement in the plot of the derivative.
The root in the definition of C(s) will yield non-real results if s is over 10^5 and this may cause problems, but the values of s(t) are way below this threshold, so this could not be the culprit, too.
Sorry, but at the moment I can't see a reason for the block failing
BTW, is there any reason your start value for t is 10^-5 and not 0 ?
Thanks all the same for your reply.
The interval number can be modified if it would be useful to solve this equation.What I have to solve is the value of t when s(t)=10^5.
If the Odesolve could not work,I am wondering if any other approach can solve this equation taking into account the defined condition.
PS:t from 0 if OK for me and no special reaseans since it seems both of them could work.
OK, upon further looking it seems that the definition of C(s) and especially the root seems to be the cause for the error.
You may also reconsider the limit t=10^5
If t exceeds 14539.68 then s(t) exceeds 10^5 and the expression in the root gets negative, which means a non-real value for the derivative!!
I "fixed" the problem by adding an absolute value but you sure must check if the results for t>14539 are of any value.
Here is the derivative function in the region of t=15000. We clearly see the effect of the absolute value and I guess this is not what you intended.
I am not sure if adding the sign function in the definition of C(s) would make sense.
This effectively would draw the derivative to zero after t=14539.68 and limits s(t) to 10^5.
You have to decide if that is what you want to happen.
Prime 9 sheet attached
If the last suggestion (using the absolute value and the sign function, which keeps the derivative at zero instead of letting it rise again) is of any value to you, you should replace it by this equivalent function
as it seems to speed up the solve block significantly and produces a much clearer result.
Prime 9 sheet attached
excellent,your solution fixed the issue. Thanks a lot for your professional proposal.
One additional remark.
In Prime 10 we can chose among different algorithms used for odesolve (we also could so so in good old real Mathcad).
The default "Adams/BDF" and also "Radau" fail, but "fix" and "Adaptive" work well if t.end does not exceed the critical value for t as explained in my previous postings. If t exceeds this value all algorithms must fail as you basically demand for a non-real derivative.