DC motor

function omd = dcmot(t,om);
% this function represents the model of a DC motor

% — Parameters of the motor:
Ra = 20;                % armature resistance, Ohm
Kt = 0.03;              % torque sensitivity, Volt/rad/s
Js = 1.0e-5;            % inertia (rotor + fly-wheel), Kg*m^2

Ea = 15;                % e.m.f., Volt

Eb = Kt*om;             % back e.m.f.
Ed = Ea-Eb;
Ia = Ed/Ra;             % armature current
Tm = Kt*Ia;             % torque
omd= Tm/Js;             % angular acceleration