Finding the maxima/minima

5 visualizaciones (últimos 30 días)
Ikenna Iwudike
Ikenna Iwudike el 2 de Abr. de 2022
Respondida: Walter Roberson el 2 de Abr. de 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)

Respuesta aceptada

Walter Roberson
Walter Roberson el 2 de Abr. de 2022
[tmin, fmin] = fminbnd(f,0,2*pi)
nf = @(x)-f(x);
[tmax, fmax] = fminbnd(nf,0,2*pi)

Más respuestas (0)

Etiquetas

Productos


Versión

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by