non linear implicit equation

2 ビュー (過去 30 日間)
Gregory Cottone
Gregory Cottone 2020 年 10 月 23 日
コメント済み: Alan Stevens 2020 年 10 月 26 日
Good morning, I'm new in using Matlab and I would like to know if it is possible to solve the following implicit equation
sin(x)-y*sin(acos((3+sin(x))/y)) = 0
where: x = linspace(0,2*pi,50)
In particular I would like to explicit y and after plot y against x.
Thank you so much!

採用された回答

Alan Stevens
Alan Stevens 2020 年 10 月 23 日
Surprisingly, this has an explicit solution for y (I didn't use Matlab to get it as I don't have the symbolic toolbox to hand) . See the following code:
x = linspace(0,2*pi,50);
y = zeros(1,numel(x));
for i = 1:numel(x)
y(i) = yfn(x(i));
end
subplot(2,1,1)
plot(x,y),grid
xlabel('x'),ylabel('y')
subplot(2,1,2)
plot(x,sin(x),'b',x,y.*sin(acos((3+sin(x))./y)),'r--'),grid
xlabel('x'),ylabel('check functions')
legend('sin(x)','y.*sin(acos((3+sin(x))./y))')
function y = yfn(x)
y = sqrt(6*sin(x)-cos(2*x)+10);
if mod(x,2*pi)>pi
y = -y;
end
end
This results in
  4 件のコメント
Gregory Cottone
Gregory Cottone 2020 年 10 月 26 日
Thank you very much!!
One more last question: if I would find a numerical method as for example fsolve function, what I have to do to set the problem?
Alan Stevens
Alan Stevens 2020 年 10 月 26 日
fsolve is part of the Optimisation toolbox, which I don't have, so I'm not much help to you on that. I suggest you either type doc fsolve, or ask as a separate question in the forum (or both!).

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by