cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Plotting a function that is determined by a Solve block and find Max/Min values

Einhorn
1-Newbie

Plotting a function that is determined by a Solve block and find Max/Min values

Hello,

I would like to plot a function, f(t) in which I previously used a Solve block to find the max/min value for the function. Since I had to put in an intial guess for the function in my Solve block the plot won't plot unless I move it above the solve block. Two questions then...

1. Is there a better way to determine the max/min values for a continous function over a given domain? I am not really sure how to set up the Maximize function for a problem like this.

2. Is there a way to reset a variable to be undefined once you have set it?

See attached example with the questions highlighted in yellow.

Thanks,

Mike

7 REPLIES 7
MikeArmstrong
5-Regular Member
(To:Einhorn)

How about the attached for undefining the variable?

Mike

That is interesting...I would have thought that defining t as a global variable would have kept the solve block from working.

Any thoughts on using the Maximize function to find the local value for t where the function is a Max?


Thanks,

Mike

MikeArmstrong
5-Regular Member
(To:Einhorn)

I'm sure there is another way to undefine but cannot think at the moment.

There has been many worksheets past within the forum to find maximum and minimum values. Unfortunately I don't have time at the moment - try searching maxima or minima, you might find the sheets I am referring too.

If you don't find them I'll try and dig them out later.

Mike

Michael Einhorn wrote:

Any thoughts on using the Maximize function to find the local value for t where the function is a Max?

Just put Maximize(P,t) immediately after your initial guess for t (you might have to change the initial guess if you want the result to represent the second peak on your graph though).

Alan

Change the variable name for the solve block.

Of course that works I thought he wanted to keep the variable name.

Mike

Thanks All,

I was able to get the Maximize function to work and now I have some good options for the plots.

Mike

Top Tags