Finding the maxima/minima
6 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Walter Roberson
2022 年 4 月 2 日
[tmin, fmin] = fminbnd(f,0,2*pi)
nf = @(x)-f(x);
[tmax, fmax] = fminbnd(nf,0,2*pi)
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!