solve the equation for a large frequency range

4 次查看(过去 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;

回答(1 个)

Walter Roberson
Walter Roberson 2021-9-26
Rsh=0.01*pi
Rsh = 0.0314
Lsh=5*10^-9
Lsh = 5.0000e-09
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
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;

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by