How to shift state space models by equilibrium points using ss and lsim?

조회 수: 8 (최근 30일)
Hi everybody,
I linearized the nonlinear ODEs describing the dynamics of the planar quadrotor at the equilibrium point: xe = [y1 z1 0 0 0 0]. Then I proceeded to put my equations in state space form x_dot = Ax + Bu and y = Cx. I obtained my A,B,C,D matrices and pass them to Matlab function ss like so:
Sys = ss(A,B,C,D). Then I pass it to lsim to simulate like so:
[Outputs, time, states] = lsim(sys, u, time, x0).
My question is: how do I make sure that all my states and my initial conditions are shifted by the equilibrium points? I understand that my state variables are now written in terms of deviation from the equilibrium point and so: y_tilde = y - ye, z_tilde = z - ze, and for the other 4 state variables x_tilde = x, since xe = 0 for all the other states.
Do I have to manually shift the initial condition x0 to make it x0_tilde before passing it to ss(A,B,C,D)? And how about the outputs from lsim do I have to shift those by xe? Please ask if I can clarify anything I understand how to define the state space system on paper but have no idea how matlab deals with it. Thanks!

채택된 답변

Paul
Paul 2021년 3월 28일
The states, inputs, and outputs of Sys are all perturbations from the equilibrium solution. The intiial condition to lsim (x0) would then be an intiial perturbation from the equilibrium condition. The Outputs and States from the call to lsim are the perturbations to the equilibrium outputs and states. The input u to lsim is the perturbation to the equilibrium solution input.
  댓글 수: 6
Paul
Paul 2021년 3월 28일
Right. You found an equilibrium point at some particular value of the state vector xe. Though unstated, presumably the input at the equilibrium is ue = 0. The output at equilibrium is ye. Now linearize around the xe and ue and ye to develop the LTI state space model sys. The state, input, and output of sys are perturbations to xe, ue, and ye respecitvely. After running lsim, the "global" state xglobal is approximated by xe + x, where x is the state variable of sys. Similarly for yglobal and uglobal. These approximations are valid for small perturbations from the equilibrium point.
Ashwin Vadivel
Ashwin Vadivel 2021년 3월 28일
Yes makes perfect sense thanks for the help!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Gain Scheduling에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by