why am i getting ans = Empty sym: 0-by-1

조회 수: 2 (최근 30일)
MARTINS Preimanis
MARTINS Preimanis 2021년 12월 8일
답변: Star Strider 2021년 12월 8일
clc
%variables
syms X Y;
solve (cos(X+0.5)+Y==0.8,X)
solve (sin(Y)-2*X==1.6,Y)
%convergence
G1(Y)=-acos(4/5 - Y) - 1/2;
G2(X)=pi - asin(2*X + 8/5);
%Derivative
G1X=diff(G1,X)
G1Y=diff(G1,Y)
G2X=diff(G2,X)
G2Y=diff(G2,Y)
%convergence limits
solve(-2/(1 - (2*X + 8/5)^2)^(1/2)==1)
solve(-2/(1 - (2*X + 8/5)^2)^(1/2)==-1)
solve(-1/(1 - (Y - 4/5)^2)^(1/2)==1)
solve(-1/(1 - (Y - 4/5)^2)^(1/2)==-1)
after convergence limits i am getting ans = Empty sym: 0-by-1, why is this and how to fix it
ans =
Empty sym: 0-by-1
ans =
- (3^(1/2)*1i)/2 - 4/5
(3^(1/2)*1i)/2 - 4/5
ans =
Empty sym: 0-by-1
ans =
4/5

채택된 답변

Star Strider
Star Strider 2021년 12월 8일
There’s no “there” there!
When in doubt, plot! The plot of a funciton tells essentially everything that needs to be known about its behaviour.
The first and third functions never reach +1 so there is no solution to either of them.
%variables
syms X Y;
solve (cos(X+0.5)+Y==0.8,X)
ans = 
solve (sin(Y)-2*X==1.6,Y)
ans = 
%convergence
G1(Y)=-acos(4/5 - Y) - 1/2;
G2(X)=pi - asin(2*X + 8/5);
%Derivative
G1X=diff(G1,X)
G1X(Y) = 
0
G1Y=diff(G1,Y)
G1Y(Y) = 
G2X=diff(G2,X)
G2X(X) = 
G2Y=diff(G2,Y)
G2Y(X) = 
0
%convergence limits
eq1 = -2/(1 - (2*X + 8/5)^2)^(1/2)-1
eq1 = 
figure
fplot(eq1,[-2 0])
grid
ylim([-25, 5])
solve(-2/(1 - (2*X + 8/5)^2)^(1/2)==1, X)
ans = Empty sym: 0-by-1
solve(-2/(1 - (2*X + 8/5)^2)^(1/2)==-1)
ans = 
eq2 = -1/(1 - (Y - 4/5)^2)^(1/2)-1
eq2 = 
solve(-1/(1 - (Y - 4/5)^2)^(1/2)==1)
ans = Empty sym: 0-by-1
figure
fplot(eq2,[-0.5 2])
grid
ylim([-25, 5])
solve(-1/(1 - (Y - 4/5)^2)^(1/2)==-1)
ans = 
.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numeric Solvers에 대해 자세히 알아보기

태그

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by