كود:
% this program determines the current
% it computes the loop currents given the impedance
% matrix Z and voltage vector V
% Z is the impedance matrix
% V is the voltage matrix
% initialize the matrix Z and vector V
Z = [(Z_1+Z_12+Z_13) -Z_12 -Z_13;
Z_1 Z_2 Z_3;
0 1 -1];
V = [(E_12+E_13-E_1) (E_3-E_1-E_2) I_s]';
% solve for the loop currents
I = inv(Z)*V
هذا الكود على الماتلاب
انا اريد ان اكتب البرنامج ماهي الاوامر
مثل اول ماافتح البرنامج يقول لي ادخل قيمة Z_1, Z_2, .. etc
بعدين يطلع لي قيم التيارات I1,I2,I3