Finding the maxima/minima
    5 views (last 30 days)
  
       Show older comments
    
    Ikenna Iwudike
 on 2 Apr 2022
  
    
    
    
    
    Answered: Walter Roberson
      
      
 on 2 Apr 2022
            f(x, y) = e^x − sin (y) on the ellipse g(x, y) = x^2 + 3*y^2 = 1
I was told to parametrize the ellipse by x = cos(t), y = (1/sqrt(3))*sin(t),  Substitute it into the formula for f , get a function of the single variable t and find its maximum and minimum on the interval [0, 2π] using fminbnd. I was able to find the minimum but I'm having trouble finding the maximum. Here's what I have so far:
syms t
x = cos(t);
y = (1/sqrt(3))*sin(t);
f = exp(x) - sin(y);
f = @(t) exp(cos(t)) - sin((3^(1/2)*sin(t))/3);
tmin = fminbnd(f,0,2*pi)
fmin = exp(cos(tmin)) - sin((3^(1/2)*sin(tmin))/3)
0 Comments
Accepted Answer
  Walter Roberson
      
      
 on 2 Apr 2022
        [tmin, fmin] = fminbnd(f,0,2*pi)
nf = @(x)-f(x);
[tmax, fmax] = fminbnd(nf,0,2*pi)
0 Comments
More Answers (0)
See Also
Categories
				Find more on Calculus in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
