Nontrivial(Non-zero) solution of two nonlinear equations
이전 댓글 표시
I have two equations given in code. The two lines are cutting each other at (x,y)=(0.098, 2.26) and (0.4899, 2.448) roughly as I can see it when it will be plotted within the range of x [0, 1.2].
But I would like to get these points by solving numerically. By using 'vpasolve()' I am getting only one crossing point at x= - 0.499 (contains a neg. sign), y= 2.443 where the other crossing point is not produced at all. Pl somebody help me to do that. Here I attach my code of two equations.
clc;clear
syms x y
p=1.0;
q=0.5;
r=0.2;
l1=1;
l2=2;
o=sqrt(((p).^2)-(4.*((r).^2)));
m=sqrt((p+o)./(2.*o));
n=((p-o)./(2.*r)).*m;
e=(((x)./((2.*r)+p)).*(1+((p-o)./(2.*r)))).*m;
e1=((l1+(1./2)).*o)-(p./2)-(((x).^2)./((2.*r)+p));
e2=((l2+(1./2)).*o)-(p./2)-(((x).^2)./((2.*r)+p));
ee1=((l1-(1./2)).*o)-(p./2)-(((x).^2)./((2.*r)+p));
ee2=((l2-(1./2)).*o)-(p./2)-(((x).^2)./((2.*r)+p));
d1= (q./2).*(exp(-2.*((e).^(2)))).*(laguerreL(l1,(4.*((e).^2))));
d2=(q./2).*(exp(-2.*((e).^(2)))).*(laguerreL(l2,(4.*((e).^2))));
dd1=(q./2).*(exp(-2.*((e).^(2)))).*(laguerreL((l1-1),(4.*((e).^2))));
dd2=(q./2).*(exp(-2.*((e).^(2)))).*(laguerreL((l2-1),(4.*((e).^2))));
E1=e1 -d1;
E2=e2 -d2;
EE1=ee1 +dd1;
EE2=ee2 +dd2;
G=(EE1-E1)./2;
h=(EE2-E2)./2;
D1=(e.*q./sqrt(l1)).*exp(-2.*(e.^2)).*laguerreL((l1-1),1,(4.*(e.^2)));
D2=(e.*q./sqrt(l2)).*exp(-2.*(e.^2)).*laguerreL((l2-1),1,(4.*(e.^2)));
u=sqrt(((G).^2)+((D1).^(2)));
v=sqrt(((h).^2)+((D2).^(2)));
%x1(x)= 2.*(((l1-(((u) + (G))./(2.*u))).*(((m).^2)+(n).^2))+((((m-n).^2).*((e).^2))+(n).^2));
%x2(x)= 2.*(((l2-(((v)-(h))./(2.*v))).*(((m).^2)+(n).^2))+ (sqrt(l2)).*(e).*((m-n).^2).*(D2./(v)));
%x=linspace(0.0001,1.2,50);
%plot(x,x1(x),'r',x,x2(x),'b--')
%% Numerical part
eq1=y- 2.*(((l1-(((u) + (G))./(2.*u))).*(((m).^2)+(n).^2))+((((m-n).^2).*((e).^2))+(n).^2));
eq2=y- 2.*(((l2-(((v)-(h))./(2.*v))).*(((m).^2)+(n).^2))+ (sqrt(l2)).*(e).*((m-n).^2).*(D2./(v)));
sol=vpasolve([eq1,eq2],[x,y]);
xSol=sol.x
ySol=sol.y
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Linear Algebra에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!