Skip to main content
Best answer by Werner_E

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

Werner_E_0-1720450157555.png

as it seems to speed up the solve block significantly and produces a much clearer result.

Prime 9 sheet attached

2 replies

25-Diamond I
July 8, 2024

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.

Werner_E_0-1720445928593.png

 

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 ?

8-Gravel
July 8, 2024

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. 

25-Diamond I
July 8, 2024

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.

Werner_E_0-1720451028599.png