Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
Hello,
I have a function like this:
The Plot of this function looks like this:
I want to find the maximum value of this function within time range of t= 0 sec to 0.1 sec. If I put initial guess of 0.03 s the maximize function gives the maximum value within the cycle at 0.03s. How do I find maximum of different cycles within a range. Any help is appreciated very much. I have attached my work sheet here.
Thank you very much for your valuable response
I Thank you very very much, This one is much more shorter than previous. Appreciate it.
Fred's is nice, I agree.
But it's not actually shorter. You must manually step to find the peaks, or you might miss one. Also, If you want the max absolute value, then you must add to the program and have even more steps.
If all you want is the maximum positive value, then creating a vector of values,v and using the max(v) is as short as you get and does not require any manual intervention.
But, depends how much information and how automated you want.
Both nice example, very neat indeed.
Mike
Fred,
How can I get the value of time,x corresponding to the maximum value z.
Thanks!!!
I'm sorry, I had to get involved. I've used a pre-defined function in my sheet, but hey, that's why they were written.
Mike
Slightly improved.
Mike
How is that slightly improved? By using a non-standard function? Paste that into a clean worksheet and report what the answers are.
If you want a vector, build a vector.
And where do you define "step"?
How is that slightly improved? By using a non-standard function? Paste that into a clean worksheet and report what the answers are.
It's slightly improved on my own version, I'm not comparing it to your's or Wayne's.
Yes, non standard functions have been written because of Mathcad's flaws. I do not make functions universal, never. If someone wants to paste the function into a clean worksheet, they will also have to paste the predefined vec function. No big deal IMO.
If you want a vector, build a vector.
And where do you define "step"?
Step is defined above the function as shown in the Mathcad sheet I posted.
Mike
I spent a little more time and extended to find all of the roots and the local extrema between the roots, and the locations. But once the functions have been defined, only have two functions, one for zeros and one for local extrema.
Here is a worksheet which has been passed in the forum several times.
Mike
Thanks Mike.