Why my imaginary graph is straight line?
Afficher commentaires plus anciens
clc
clear
close all
syms t s I1 I2
% KVL equations
KVL1 = (2*s^2+s+1)*I1-(s+1)*I2 == 1;
KVL2 = (s+1)*I1-(s^2+4*s+1)*I2 == 2;
Eqns = [KVL1 KVL2] ;
Vars = [I1 I2] ;
% Solving equations
Soln = solve(Eqns,Vars) ;
I1(s) = Soln.I1 ;
I2(s) = Soln.I2 ;
% Finding i1(t) and i2(t) using Inverse Laplace Transform
i1(t) = ilaplace(I1(s),s,t) ;
i2(t) = ilaplace(I2(s),s,t) ;
figure
subplot(2,1,1)
fplot(t,real(i1(t)),'LineWidth',1.5)
xlabel('t')
ylabel('Re[i_1(t)]')
title('Real Part of i_1(t)')
grid on
subplot(2,1,2)
fplot(t,imag(i1(t)),'LineWidth',1.5)
xlabel('t')
ylabel('Im[i_1(t)]')
title('Imaginary Part of i_1(t)')
grid on
figure
subplot(2,1,1)
fplot(t,real(i2(t)),'LineWidth',1.5)
xlabel('t')
ylabel('Re[i_2(t)]')
title('Real Part of i_2(t)')
grid on
subplot(2,1,2)
fplot(t,imag(i2(t)),'LineWidth',1.5)
xlabel('t')
ylabel('Im[i_2(t)]')
1 commentaire
John D'Errico
le 24 Oct 2021
I'm sorry, but this needs to be said. If it is imaginary, then just pretend it is curved. :)
Réponses (1)
John D'Errico
le 24 Oct 2021
fplot(t,imag(i1(t)),'LineWidth',1.5)

To my eyes, this does not look straight. But then I may need new glasses.
Catégories
En savoir plus sur Specialized Power Systems dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!