alright ive got to model a PMDC motor and a mechanical system attached to it(adsbygoogle = window.adsbygoogle || []).push({});

this is what i have so far for the equations part, which is where the problem is (im trying to graph the time histories of the 3 DE's)

the bolded part is where the problem is. if i substitute it for a constant number, say 10, the graphs are good. function Xdot=project(t,X)

global R L km B J M b k r

V=10; % step function: 10 Volts

% State equations (1st order differential equations)

% X(1) = theta = angular displacement of pinion

% X(2) = theta dot = angular velocity of pinion

% X(3) = I = current

% X(4) = I dot

Xdot1= X(2);

Xdot2= (1/(J-M*r^2))*(-B*X(2)+km*X(3)+b*r^2*X(2)+k*r^2*X(1));

Xdot3= (V-R*X(3)-km*X(2))/L;

% The differential equations must be put in a column vector

Xdot=[Xdot1; Xdot2; Xdot3];

i suck at matlab, never understood it, im confused, what do i do?

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab question

**Physics Forums | Science Articles, Homework Help, Discussion**