For this example, the dataFcnMaglev.m data function describes the dynamics of a magnetic levitation system.
This model is not valid for height = 0. Create an LPV model with a different value for the test height. For this model set t0 = 0 because the parameters do not depend explicitly on time.
h0 = 1;
sys = lpvss('h',@dataFcnMaglev,0,0,h0)
Continuous-time state-space LPV model with 1 outputs, 1 inputs, 2 states, and 1 parameters.
Get the test values lpvss used to validate dataFcnMaglev.m.
[t0,p0] = getTestValue(sys)
t0 =
0
p0 =
1
The function returns the same value that was used to validate the data function when you created the LPV object.
View the data function code.
type dataFcnMaglev.m
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = dataFcnMaglev(~,p)
% MAGLEV example:
% x = [h ; dh/dt]
% p=hbar (equilibrium height)
mb = 0.02; % kg
g = 9.81;
alpha = 2.4832e-5;
A = [0 1;2*g/p 0];
B = [0 ; -2*sqrt(g*alpha/mb)/p];
C = [1 0]; % h
D = 0;
E = [];
dx0 = [];
x0 = [p;0];
u0 = sqrt(mb*g/alpha)*p; % ibar
y0 = p; % y = h = hbar + (h-hbar)
Delays = [];
Test value of time, returned as a scalar. This is the value ltvss
and lpvss uses to evaluate the data function.
p0 — Parameter test values vector
Test values of parameters, returned as a vector of length equal to the number of
parameters in the model. These are the values lpvss uses to evaluate
the data function.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: United States.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.