summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/withesis/derivs.m
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/withesis/derivs.m
Initial commit
Diffstat (limited to 'macros/latex/contrib/withesis/derivs.m')
-rw-r--r--macros/latex/contrib/withesis/derivs.m56
1 files changed, 56 insertions, 0 deletions
diff --git a/macros/latex/contrib/withesis/derivs.m b/macros/latex/contrib/withesis/derivs.m
new file mode 100644
index 0000000000..c723cdbbe4
--- /dev/null
+++ b/macros/latex/contrib/withesis/derivs.m
@@ -0,0 +1,56 @@
+function dPsi = derivs(t,Psi);
+% derivs computes the state derivatives for an induction machine
+% The machine is in the synchronous reference frame.
+% Eric Benedict, Spring 1996
+
+% Machine parameters...
+global Rs Rqr Rdr Xls Xlr Xm Xms J P We Wb Vs
+
+% rename state vector...
+Phqs=Psi(1);
+Phds=Psi(2);
+Phqr=Psi(3);
+Phdr=Psi(4);
+Wr=Psi(5);
+Theta=Psi(6);
+
+
+% Select Reference Frame...
+% Assume no angle differnce between a-axis and q-axis at t=0
+
+% Synchronous
+W=We;
+ThetaR=W*t;
+
+% Compute Machine Currents...
+Phmq=Xms*Phqs/Xls + Xms*Phqr/Xlr;
+Phmd=Xms*Phds/Xls + Xms*Phdr/Xlr;
+
+Iqs=(Phqs - Phmq)/Xls;
+Ids=(Phds - Phmd)/Xls;
+Iqr=(Phqr - Phmq)/Xlr;
+ Idr=(Phdr - Phmd)/Xlr;
+
+
+% Compute Torques...
+Te=3*P*(Phds*Iqs-Phqs*Ids)/(4*Wb); % Electrical Torque
+Tl=0; % Load Torque
+
+
+% Compute Voltages...
+Vqs=Vs*cos(We*t - ThetaR);
+Vds=-1*Vs*sin(We*t - ThetaR);
+Vqr=0;
+Vdr=0;
+
+% Compute new derivative of state vector...
+dPsi(1) = Vqs - Rs*(Phqs - Phmq)/Xls - W*Phds/Wb; % PHqs/Wb
+dPsi(2) = Vds - Rs*(Phds - Phmd)/Xls + W*Phqs/Wb; % PHds/Wb
+dPsi(3) = Vqr - Rqr*(Phqr - Phmq)/Xlr - (W-Wr)*Phdr/Wb; % PHqr/Wb
+dPsi(4) = Vdr - Rdr*(Phdr - Phmd)/Xlr + (W-Wr)*Phqr/Wb; % PHdr/Wb
+
+dPsi(5) = (Te - Tl)*P/(2*J*Wb); % Wr/Wb
+
+dPsi(6) = Wr/Wb; % Theta/Wb
+
+dPsi=Wb*dPsi;