sampling time causes scaling of simulation results.
14 次查看(过去 30 天)
显示 更早的评论
I am trying to model a dynamic system's response against a generated signal.
i modeled the system properly on simulink and it worked fine, but for the purpose of my work i needed to replicate the same simulation in a less abstract manner because i need to control the parameters of the simulation and solution a bit further.
I've managed to do so on matlab but i am facing a problem caused by sampling time scaling.
I know and understand that sampling time affects the accuracy of the simulation but at a certain threshold sampling time should be small enough that it doesn't affect the results any more.
the problem i am facing is that changing sampling time causes direct scaling of the end results of the simulation.
For example
a sample time of .001 gives the same result as a sample time of .01 only it is multiplied by 10^-1.
My question is
- is their a way to eliminate the scaling relation between sampling time and results ?
- if i am trying to manually do the math for the simulation (which i am trying to do) is their a way to manually do variable time sampling ?
- if the scaling effect is a fact i have to accept, how to choose the best possible sample time.
thanks in advance and sorry for the long question
t = 0:0.025:15;
for i = 1:length(t)
if t(i) >= 1 %Front wheel bump at 1 seconds
wf(1,i) = 0.1;
end
if t(i) >= 5 %Rear wheel bump at 5 seconds
wf (2,i) = 0.1;
end
end
% input differentiation
wf1 = wf (1,:); wf2 = wf (2,:);
w = [diff(wf1) , 0 ; diff(wf2) , 0];
Susp_sys = ss((A-B*K),G,C,D);
[Y,T,x] = lsim (Susp_sys,w,t);
0 个评论
采纳的回答
Star Strider
2020-11-27
It may be appropriate to specify the the sampling time in the ss call. See Create Discrete-Time State-Space Model.
Another possibility is that there could be a difference in the assumed time units in the model and the assumed time units in the simulation.
6 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Stability Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!