how to solve multi variable simultaneous equations
조회 수: 2 (최근 30일)
이전 댓글 표시
Hi all,
Please help me wiht this, I am new to matlab.
I want to solve two equattions which has five variable, so I want to provide ranges for three variables and get all the solutions.
3 variable with ranges are x4, x5 and z4, and I want to find corresponding solution for z5 and G. (Actually I have a formula which I nedd to equate with the real and imaginary part of a complex number)
I have tried this way-
x4=pi/36:pi/9:pi/2;
x5=pi/6:pi/9:pi/2;
z4=60:20:80;
for a=1:length(z4)
for b=1:length(x4)
for c=1:length(x5)
ZL=61.5-1i*47.4;
YL=1/ZL; % to be equated with its conjugate
GL=real(YL);
BL=imag(YL);
syms z5 real
syms z55 real
assume( z5 > 0)
syms G real
assume( G>0)
y4=1./z4;y5=1./z5;
ya(a,b)= -1i.*y4(a).*cot(x4(b)) % Formula -I
yb(c)=vpa((y5).*(G + 1i.*y5.*tan(x5(c)))./(y5+ 1i.*G.*tan(x5(c)))) %Formula-2
yeq(a,b,c)=ya(b)+yb(c) %sum
yeqR=real(yeq)
yeqI=imag(yeq)
eqn=[yeqR==GL, yeqI==-BL]
var=[G z5]
s=solve(eqn, var)
G1=s.G
z55=s.z5
end
end
end
댓글 수: 3
KSSV
2018년 11월 13일
What are the unknowns in the above? YOu can solve it with hand first..equate complex and real parts...and these two parts should be solved for unknowns.
답변 (1개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!