List Archives > 
Maple User Group List Archive > 
Archive by date > 
This Month By Date > 
This Month By Topic
[MUG] Finding the maximum value of a function over a range
| [MUG] Finding the maximum value of a function over a range |
|
Author: Roush, Craig Ryan UMKC-Student
Posted: Wed, 17 Apr 2002 23:04:51 -0500
|
>> From: "Roush, Craig Ryan (UMKC-Student)" "crrea2"
I have a function that is dependent on a variable phi, where phi
ranges from 0 to 2*Pi, Is there a way I can calculate the maximum
value of the function over that range so I can normalize that function
to a unity value of 1? Thanks! Craig
|
| [MUG] Re: Finding the maximum value of a function over a range |
|
Author: Maple User Group
Posted: Mon, 22 Apr 2002 15:05:28 -0400
|
>> From: Maple User Group "maple_gr"
|> From: "Roush, Craig Ryan (UMKC-Student)" "crrea2"
| I have a function that is dependent on a variable phi, where phi
| ranges from 0 to 2*Pi, Is there a way I can calculate the maximum
| value of the function over that range so I can normalize that function
| to a unity value of 1? Thanks! Craig
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Sun, 21 Apr 2002 05:02:10 +0200
From: Helmut Kahovec "helmut.kahovec"
To: "maple-list"
Subject: Finding the maximum value of a function over a range
If you have Maple7 then look at the online help page of 'minimize'.
Kind regards
Helmut
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
From: "Willard, Daniel Dr DUSA-OR" "daniel.willard"
To: "''"
Subject: Finding the maximum value of a function over a range
Date: Thu, 18 Apr 2002 12:38:01 -0400
Calling the function F, solve dF/d(phi)=0. If no answer, try the
function <extrema>.
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 18 Apr 2002 10:25:16 -0700 (PDT)
From: Robert Israel "israel"
To: "maple-list"
Subject: Finding the maximum value of a function over a range
It depends. You could try
> maximize(f(phi), phi = 0 .. 2*Pi);
This uses the usual symbolic methods, which will generally require
solving the equation f'(phi) = 0. This may or may not be possible
in closed form, so you may not get an answer. In addition (depending
on which release of Maple you're using) maximize has a number of bugs.
To get a numerical approximation of an answer, you might try gmax from
my Maple Advisor Database, http://www.math.ubc.ca/~israel/advisor.
Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Subject: Finding the maximum value of a function over a range
Date: Thu, 18 Apr 2002 12:37:09 -0500
From: "Roush, Craig Ryan (UMKC-Student)" "crrea2"
To: "Robert Israel" "israel"
yes, it is not possible to solve the equations that I am using in
closed form, they are for the electric field of an antenna array. I
just need to normalize the function so that I have plots that I can
compare reasonably well, I have tried, gmax, findmax that I found
online, and not one of those would find the max of my equation. Any
other suggestions? Craig Roush
-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-
Date: Thu, 18 Apr 2002 11:25:04 -0700 (PDT)
From: Robert Israel "israel"
To: "Roush, Craig Ryan (UMKC-Student)" "crrea2"
Subject: Finding the maximum value of a function over a range
If you can plot the function on the interval, then you can extract the
maximum of the y-values of the plotted points. For example:
> P:= plot(f(phi), phi=0..2*Pi):
A:= remove(has, op([1,1],P), undefined):
MAX:= max(op(map(t -> t[2], A)));
Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
|
| [MUG] Re: Finding the maximum value of a function over a range |
|
Author: Theodore Kolokolnikov
Posted: Thu, 25 Apr 2002 15:56:25 -0700
|
>> From: Theodore Kolokolnikov "tkolokol"
> from: "Roush, Craig Ryan (UMKC-Student)" "crrea2"
> I have tried, gmax, findmax that I found online, and not one of
> those would find the max of my equation. Any other suggestions?
> Craig Roush
I've used "slink" program, available from:
http://www.maths.qmw.ac.uk/~fjw/public_maple/
It can minimize functions of many variables. It works in situations where
Maple's "minimize" doesn't.
Theodore.
|
| [MUG] Re: Finding the maximum value of a function over a rang e |
|
Author: Willard, Daniel Dr DUSA-OR
Posted: Tue, 30 Apr 2002 16:19:18 -0400
|
>> From: "Willard, Daniel Dr DUSA-OR" "daniel.willard"
Have you tried "extrema"?
> From: "Roush, Craig Ryan (UMKC-Student)" "crrea2"
> I have tried, gmax, findmax that I found online, and not one of
> those would find the max of my equation. Any other suggestions?
|
| [MUG] Re: Finding the maximum value of a function over a range |
|
Author: Jeff Wright
Posted: Thu, 9 May 2002 12:25:40 -0700
|
>> From: "Jeff Wright" "jhwright"
Based on suggestions from the group, I have successfully used something like
the following to get numerical extrema.
#Assume that f is defined externally, and return the value of z that
maximizes f.
maxf := proc(f, zmin, zmax)
local p1, points, maxval,maxpt;
p1 := plot(f(z), z=zmin .. zmax): #create plot structure from which to grab
results
points := op([1,1],p1): # extract list of points
maxval:= max(op(map(t -> t[2], points))): #find max value
maxpt := select(t-> t[2]=maxval, points)[]: # get ordered pair for max value
if(maxpt[2]<0) then maxpt[2]:=0; fi ;
return(maxpt):
end proc ;
------------------------------
Jeffrey H. Wright, Ph.D.
Department of Math and Computer Science
University of San Diego
5998 Alcala Park
San Diego, CA 92110-2492
"jhwright" 619-260-7491
|
Previous by date: [MUG] AW: Problems with solving systems of equations, Thomas Richard
Next by date: [MUG] Re: volume under the curve?, Maple User Group
Previous thread: [MUG] Debugging Procedures in Modules, David Levitt
Next thread: [MUG] volume under the curve?, Zlatko Savic
|