solve the equation for a large frequency range
조회 수: 5 (최근 30일)
이전 댓글 표시
I want to solve the below equation for the frequency range of 1Khz to 100MHz.
the equation is factor=Rsh/(Rsh+j*2*pi*frequency*Lsh)
here,
Rsh=0.01*pi
and
Lsh=5*10^-9
. But when I run the code it shows matrix mismatch
freq=1e+3:1e+8;%frequency range
Rsh=0.01*pi;
d=Rsh+(2*pi*freq*i*5*10^-9);
factor=Rsh/d;
댓글 수: 0
답변 (1개)
Walter Roberson
2021년 9월 26일
Rsh=0.01*pi
Lsh=5*10^-9
freq=1e+3:1e+8;%frequency range
Rsh=0.01*pi;
d=Rsh+(2*pi*freq*i*5*10^-9);
factor = Rsh ./ d;
In MATLAB, the / operator is "matrix right divide". Rsh/d is roughly equivalent to Rsh * pinv(d) but with some restrictions about the sizes; the * indicated here is algebraic matrix multiplication, "inner product".
What you wanted was element-by-element division, which in MATLAB is the ./ operator.
댓글 수: 3
Walter Roberson
2021년 9월 26일
Rsh=0.01*pi
Lsh=5*10^-9
freq=1e+3:1e+8;%frequency range
Rsh=0.01*pi;
d=Rsh+(2*pi*freq*i*5*10^-9);
factor = Rsh ./ d;
b = 2 .* pi .* 3.5e-12 .* i .* factor .* freq;
Note: if i is intended to represent the imaginary constant, then
b = 3.5e-12i .* 2 .* pi .* factor .* freq;
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!