This transfer function is to control the position of Permanent Magnet DC motor. I was able to get the transfer function and now I need to analyze the output for the tuned closed loop for a given input function.
To solve this problem, my solution was cross multiply the equation and take the inverse Laplace transformation and after solve it as a differential equation. So I've written a MATLAB code and that MATLAB code gives me an error message. Can anyone help me to identify my error in the code or the way I've chosen to solve this problem?
MATLAB Code
t = 0:0.0001:1/180;
kp = 10;
kd = 1.3;
eqn ='0.00072*D3x+0.07206*D2x+(0.7274*kd+0.44244)*Dx+0.7274*kp*x=(0.7274*kd*Dt+0.7274*kp*t)*60*t';
inits = 'x(0)=0,Dx(0)=60,D2x(0)=0,t(0)=0';
x = dsolve(eqn,inits,'t');
z = eval(vectorize(x));
plot(t,z),grid on
You are not using the capabilities of MATLAB correctly.
I will give an example. You can define the transfer function (from MATLAB documentation)
$$G(s) = \dfrac{8s^2+2s+32}{3s^3+6s^2+14s+24}$$
by the following line in MATLAB
Then you can get the system responses by
or use an arbitrary time input (e.g. $\sin(10 t)$)
EDIT: Constructing piecewise defined functions. In order to define the piecewise function
$$f(t) = \begin{cases} f_1(t)&\quad \text{, for } t \leq t_1 \\ f_2(t)&\quad \text{, for } t_1 < t \leq t_2\\ f_3(t)&\quad \text{, for } t_2 < t \leq t_3\\ f_4(t) &\quad \text{, for } t_3 < t \end{cases}$$
we can use the Heaviside step function. In your case $f_4(t)=0$. You can construct your input as