- 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.
16 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commento
Mathieu NOE
il 1 Dic 2023
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 ,
Risposte (1)
sai charan sampara
il 6 Dic 2023
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 Commenti
Vedere anche
Categorie
Scopri di più su Time and Frequency Domain Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!