How to input two signals to one transfer function?
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm trying to simulate a dynamic model using matlab but I have problem with inputs to lsim function. There are two transfer functions (AM1 and AM2) and their output (f1 and f2) are input signals to the slider (that is a transfer function as well) which I don't know how to input them there.
clear;clc;
k=1.2; k0=1; ke=0.05; ke0=0.005; w=sqrt(12.177e6/0.10059); w0=sqrt(0.011e6/0.11613); miu=.3; k_s=0.5; d0=2;
T=5; Fs=5000; dt = 1/Fs; t = 0:dt:T-dt;
u1 = sawtooth(2*pi*t); %input signal1
u1 = (u1 + 1).*50;
AM1=tf([k*w^2],[1 2*ke*w w^2]);
y1=lsim(AM1,u1,t);
if y1<=d0
f1=0
else
f1=miu*k_s*(y1-d0);
end
u2 = sawtooth(2*pi*t+pi); %input signal2
u2 = (u2 + 1).*50;
AM2=tf([k*w^2],[1 2*ke*w w^2]);
y2=lsim(AM2,u2,t);
if y2<=d0
f2=0
else
f2=miu*k_s*(y2-d0);
end
slider=tf([k0*w0^2],[1 2*ke0*w0 w0^2]);
y3=lsim(slider,????,t); % f1 and f2 should be the inputs of this lsim function
0 个评论
回答(1 个)
Paresh yeole
2020-9-6
编辑:Paresh yeole
2020-9-6
I would suggest to create a state space system for the slider and then convert it to transfer function model.
While defining state space system make sure the B matrix has to columns (for two inputs).
Once you convert the state space system into transfer function model, use lsim as:
lsim(slider, [f1;f2], t)
I am sure there may be different ways, but this is what i could think of.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!