I'm trying to find the time, where the my function reaches its maximum value. But due to a local minimum in the beginning, mathcad is only giving me this value.
How can I get mathcad to give me the other value as well? I've tried defining t to be after the minimum, but it just gives me a lot of the same, first, value.
I really hope somebody in here, is a bit smarter than I! 🙂
Have a great day,
Your function is an exponential that rises to an asymptotic value (its maximum) at infinite time. Set an upper threshold, say 4.99V, and solve for when your function is equal to the threshold.
What Richard suggested is that you solve y(t)=4.99 (or whatever threshold may seem appropriate for your task) for t, The derivative will not be zero at that point. It never will be zero but at the value of t you already got. The absolute maximum (which is exactly 5) you are going for is reached at t=infinity - thats the nature of that kind of asymptotic behaviour.
I understand that, and I've tried. But it gives me a t-valye, wich is located at the negative x-axis instead for the positive part. I don't need that solution, I need the positve t-value (The time where y = 4.99) 🙂
Edit: Mathcad file added
I gave it a quick look and can confirm that you are right. At least the symbolic solve won't give us the positive solution. Probably you are pushing the symbolics to its numeric limits. Maybe the symbolics will do better if the equation is setup so that t will be in microseconds or even nanoseconds and not in seconds as it is now. Don't know as I haven't tried it.
But if you are interested in a numeric solution anyway, why do you use the symbolics. You may use a solve block with find() or even the root function as shown below. And I guess a precision around 10^-15 should be good enough for most calculations.
I tried what I suggested above (t in microseconds) and got this "funny" error message.
I guess thats not what should happen and so tend to call it a bug.
Ad root(). I guess that using a solve block would be easier and more natural, even though they are so clumsy and look so ugly in Prime. Root, used the way I did, expects the function values for the two limits given to be of different sign which happens to be in our case only by chance as y(0) seems to be negative because of roundoff errors (it should be zero).
BTW, you don't have to change the default value of TOL (its 10^-3). Just play around with it and watch the difference. You also can change TOL in the calculation ribbon.
In Mathcad 15 the original expression gives a negative solution, even with "assume, t>0". The rescaled expression just goes into an infinite loop. I let it run for about 30 minutes, after which I had to kill the Mathcad process to stop it. Maybe I'll let it run overnight just to see if it ever gives either an answer or an error.
I let it run for about 30 minutes, after which I had to kill the Mathcad process to stop it.
The rescaled expression just goes into an infinite loop.
Guess thats what the "MuPAD unresponsive" error in Prime was trying to tell me. Maybe they have implemented some kind of timeout.
Here is the solution using a solve block.
Again a strange, undesired effect when trying to use the solution in a symbolic calculation.
Not sure if its due to the fact that we cannot evaluate a solveblock find() symbolically as we are used to do in real Mathcad.
It looks like its exactly as I had feared it could be. Results from solve blocks can not be used in symbolical calculations. The reason is that the symbolics would try to symbolically evaluate the solve block - a feature which has been broken in Prime. What a scrap!
Workaround is to make an assignment using a numeric inline evaluation - thus breaking the connection of the value to the solve block and losing any higher precision the symbolics might be able to providide. Mathcad/Prime will always assign the most rightmost expression to the LHS and after an inline eval thats a numeric scalar. We could do the inline evaluation also already in the first assignment in the solve block - would work the same way
Here is the same thing in Mathcad 15.
In the last example we see the different algorithms applied to the same solve block dependent on the way it is evaluated.