Effacer les filtres
Effacer les filtres

solve the equation for a large frequency range

2 vues (au cours des 30 derniers jours)
Tasin Nusrat
Tasin Nusrat le 26 Sep 2021
Commenté : Tasin Nusrat le 26 Sep 2021
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;

Réponses (1)

Walter Roberson
Walter Roberson le 26 Sep 2021
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 commentaires
Walter Roberson
Walter Roberson le 26 Sep 2021
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;
Tasin Nusrat
Tasin Nusrat le 26 Sep 2021
Thanks a lot

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by