Skip to main content
1-Visitor
January 20, 2012
Question

How to find Maximum Value of Sine function over a range of time.

  • January 20, 2012
  • 3 replies
  • 11574 views

Hello,

I have a function like this:

Eqn.bmp

The Plot of this function looks like this:

Graph.bmp

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.

3 replies

12-Amethyst
January 20, 2012
mesipa1-VisitorAuthor
1-Visitor
January 20, 2012

Thank you very much for your valuable response

23-Emerald I
January 20, 2012

Once again, brute force!

mesipa1-VisitorAuthor
1-Visitor
January 20, 2012

I Thank you very very much, This one is much more shorter than previous. Appreciate it.

12-Amethyst
January 20, 2012

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.

12-Amethyst
January 22, 2012

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.

1-Visitor
January 23, 2012

Here is a worksheet which has been passed in the forum several times.

Mike

12-Amethyst
January 23, 2012

Thanks Mike.