- use step to simulate your state space system with a force step input
- use lsim to simulate your state space system with a force sine input
Bode Plot for a State Space with two inputs, one constant one oscillating between 0 and 15.
12 次查看(过去 30 天)
显示 更早的评论
I need to find a way to calculate the frequecy reponse using a Bode Plot for a system with a constant downward force (gravity) and a on and off or oscillating thrust force of arbiraty value. Any help is appreciated.
clear
m = 1
k = 2
b = 3
g = 9.81
N = 15
A = [0 1 ;
-k/m -b/m]
B = [0;
N]
C = [1 0;
0 1]
D = [0;
0]
N = 10
sys = ss(A,B,C,D)
tf = tf(sys)
bode(tf)
[mag,phase,wout] = bode(tf)
1 个评论
Mathieu NOE
2023-12-1
hello
your code does already compute the Bode plot (visualisation of transfer from input(s) to output(s) in frequency domain)
what I understand from your request is the forced output to some specific input (gravity = a constant input, thrust force on/off could be step , if oscillating this would be a sine input, etc ...
where is the problem ? for example ,
回答(1 个)
sai charan sampara
2023-12-6
Hello Brandon,
I understand that you are trying to create a bode plot of a state space with multiple inputs.
Transfer function is a mathematical function relating the output or response of a system to the input. The transfer function for a MIMO system will be a matrix of transfer functions. There will be a transfer function for every input and output pair or combination. The function “bode” can be used for creating bode plot of any dynamic system. If “sys” is a multi-input, multi-output (MIMO) model, then “bode(sys)” produces an array of Bode plots, each plot showing the frequency response of one I/O pair.
In your case the “sys” variable hence has two state space models and “bode(tf)” gives two sets of bode plots which is expected behaviour. The individual state space models can be obtained by indexing through the “sys” variable. The functions like “lsim” can be used to simulate the system for arbitrary inputs.
You can also refer to the following resources for more information:
- https://www.mathworks.com/matlabcentral/answers/291589-how-can-i-do-a-transfer-function-for-a-mimo-system
- https://www.mathworks.com/help/ident/ref/dynamicsystem.bode.html
- https://www.mathworks.com/help/ident/ug/dynamic-system-models.html
- https://www.mathworks.com/help/control/ref/dynamicsystem.lsim.html
- https://www.mathworks.com/help/ident/ref/dynamicsystem.step.html
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Get Started with Control System Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!