Maximize and root issues with ODESOLVE solution
- October 22, 2023
- 2 replies
- 1677 views
Hi,
I'm having problems with using MathCAD to extract the time at which the maximum value of a function happens. I've attached a file with the example.
In the attached file, after some initial setup of parameters etc on page 1, on page two I define 2 ODEs in a solve block and solve them with ODESOLVE. This seems to work, and I have plotted the outputs in several graphs. They look as I expect. At some time I get a single peak produced on the graph of f(t). I want Mathcad to tell me at what t this peak happens.
I've tried using Maximize, and this gives me incorrect answers for t.
I've then tried differentiating f(t) and attempting to find the root that corresponds to the peak of f(t). This works for some sets of parameters and I thought I'd cracked it. But then I change one of the parameters slightly and root stops working, giving me the error message "The ODE solution is calculated over a limited range. Choose a value within this range or expand the range".
Any suggestions?
Thanks,
Steve

