Hi all,
I want to solve equation containing complex numbers.
The goal is to find R (Resistance value >0) that gives |Zeq| = 84 Omhs using solve function.
Following Matlab script should return 2 solutions:
solution #1 : close to 24 Ohms
solution #2 : close to 57 Ohms
but when I run the script , solve function returns no solution.
clc
clear
syms R Real;
C=5e-14;L=1.5e-10;Lc=3e-10;Cg=5e-14;Z1=50;Z2=50;
f=50e9;
w=2*pi*f;
Zp=2*1i*Lc*w + (R+1i*w*(L-R^2*C-L^2*C*w^2))/(1+C*((w^2*(R^2*C-2*L)+L^2*C*w^4)));
Yg=1i*Cg*w;
A=1+Yg*Zp;
B=Zp;
CC=Yg*(Yg*Zp+2);
D=A;
DEN=A*Z2+B+CC*Z1*Z2+D*Z1;
S11=(A*Z2+B-CC*Z1*Z2-D*Z1)/DEN;
Zv=84;
Zeq=abs((2*Z1*S11)/(1-S11));
solve(Zv==Zeq,R)
For information , I solved graphically this equation and solution #1 and #2 are found when the target value is |Zeq|=84.
Any suggestions ?

 채택된 답변

Star Strider
Star Strider 2019년 6월 23일

0 개 추천

I cannot figure out the reason solve is not solving for those values.
I ended up with this:
Rfcn = matlabFunction(Zeq)
Rr(1) = fzero(@(R)Rfcn(R)-Zv, 1);
Rr(2) = fzero(@(R)Rfcn(R)-Zv, 100)
producing:
Rr =
23.823647889981203 57.458880414574708

댓글 수: 2

MGuillaume
MGuillaume 2019년 6월 30일
Thank you very much.
It works perfectly.
Star Strider
Star Strider 2019년 6월 30일
As always, my pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품

릴리스

R2017a

질문:

2019년 6월 23일

댓글:

2019년 6월 30일

Community Treasure Hunt

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

Start Hunting!

Translated by