makeStateSpaceModel

バージョン 1.0.0.0 (6.09 KB) 作成者: Andrey Popov
Create state-space models from first principle
ダウンロード: 139
更新 2016/2/3

ライセンスの表示

The function assists the definition of state-space models based on first principles (i.e. when the state-equations are explicit).
Instead of trying to substitute the coefficients directly in the system matrices (which often results in confusing matrices and poor flexilbility), this function allows writing down the state-equations as they are. For this purpose variables corresponding to the states, inputs and outputs are generated in the workspace.
To use the function follow the steps below. As a running example, assume you want to model an L-C-R circuit, where L, R and C are defined in the workspace.

1. Specify the names of the states and inputs (as cell arrays) and evoke the function to generate corresponding variables in the workspace

X_names = [{'uC'}; {'iL'}];
U_names = [{'u_in'}];
makeStateSpaceModel( X_names, U_names )

This generates appropriate variables uC, iL and u_in the the workspace.

2. Use generated state and input variables to describe dx/dt (or x(k+1)) and the outputs. The state-change should be named ddt_(state-name)

ddt_iL = (u_in - uC) / L;
iR = uC / R;
ddt_uC = (iL - iR) / C;
u_out = uC;
Y_names = [{'u_out'}; {'iR'}];

3. Evoke the function once more to create the state-space model

G = makeStateSpaceModel( X_names, U_names, Y_names )

The function requires only the ss-function from the Control Systems Toolbox and can be used also under Octave (+ control toolbox).

引用

Andrey Popov (2024). makeStateSpaceModel (https://www.mathworks.com/matlabcentral/fileexchange/55234-makestatespacemodel), MATLAB Central File Exchange. 取得済み .

MATLAB リリースの互換性
作成: R2014b
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersDynamic System Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0

Update of the Description