getTestValue
Description
Examples
Get Test Value for LPV Model
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 = [];
Input Arguments
vSys
— LTV or LPV Model
ltvss
object | lpvss
object
LTV or LPV model, specified as an ltvss
or lpvss
object, respectively.
Output Arguments
t0
— Time test value
scalar
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.
Version History
Introduced in R2023a
See Also
lpvss
| ltvss
| setTestValue
Ouvrir l'exemple
Vous possédez une version modifiée de cet exemple. Souhaitez-vous ouvrir cet exemple avec vos modifications ?
Commande MATLAB
Vous avez cliqué sur un lien qui correspond à cette commande MATLAB :
Pour exécuter la commande, saisissez-la dans la fenêtre de commande de MATLAB. Les navigateurs web ne supportent pas les commandes MATLAB.
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: .
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.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)