TF&state-space

1
2
3
4
5
6
7
8
9
10
11
12
syms Y s y(t) t

laplace(10*diff(diff(y(t)))+0.4*diff(y(t))+4*y(t))
Y1=s*Y;
Y2=s*Y1;
sol=solve(10*Y2+0.4*Y1+4*Y-1,Y);
pretty(sol)

num=[1];
den=[10 0.4 4];
h=tf(num, den);
[A,B,C,D]=tf2ss(num, den)
Read more »

m=10kg, c=0.4Ns/m, k=4Nm(Mass-Spring-Damper System)

General solution, Natural response, Step response

1
2
3
4
5
6
7
8
9
10
11
12
13
14
syms x y;
u=dsolve('D2y+0.04*Dy+0.4*y=0','x')
U=dsolve('D2y+0.04*Dy+0.4*y=0','y(0)=1','Dy(0)=1','x');
subs_U=subs(U,x,0:0.1:250);
t=0:0.1:250;
plot_U=double(subs_U);
plot(t,plot_U)
hold on

figure
num=[1];
den=[10 0.4 4];
h=tf(num, den);
step(h)
Read more »

Transfer Function

tf?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
>> help tf
tf - Transfer function model

Use tf to create real-valued or complex-valued transfer function models, or to
convert dynamic system models to transfer function form.

sys = tf(numerator,denominator)
sys = tf(numerator,denominator,ts)
sys = tf(numerator,denominator,ltiSys)
sys = tf(m)
sys = tf(___,Name,Value)
sys = tf(ltiSys)
sys = tf(ltiSys,component)
s = tf('s')
z = tf('z',ts)
Read more »