setTestValue
Description
Examples
Modify Test Value for Data Function
This example shows how to modify the test values for the data function of an LPV model.
For this example, consider dataFcnMaglev.m
data function which describes the dynamics of a magnetic levitation system.
Create the LPV model with default test values.
vsys = lpvss('h',@dataFcnMaglev);
This model is not valid for height = 0 as the A
matrix is not finite for (,) = (0,0).
A = vsys.DataFunction(0,0)
A = 2×2
0 1
Inf 0
Modify the test value to = 1.
h0 = 1; msys = setTestValue(vsys,0,h0)
Continuous-time state-space LPV model with 1 outputs, 1 inputs, 2 states, and 1 parameters. Model Properties
A = vsys.DataFunction(0,h0)
A = 2×2
0 1.0000
19.6200 0
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.
Specify a model whose data function must be validated at a different time. The software only lets you combine models with shared parameters when their data function is validated at the same value for that parameter.
t0
— Test value for time
scalar
New test value for time, specified as a scalar.
p0
— Test value for parameters
vector
New test value for parameter, specified as a vector with length equal to the number of parameters.
Output Arguments
msys
— Modified LTV or LPV model
ltvss
object | lpvss
object
LTV or LPV model with modified test values for data function, returned as an
ltvss
object or lpvss
object, respectively.
Version History
Introduced in R2023a
See Also
lpvss
| ltvss
| getTestValue
Beispiel öffnen
Sie haben eine geänderte Version dieses Beispiels. Möchten Sie dieses Beispiel mit Ihren Änderungen öffnen?
MATLAB-Befehl
Sie haben auf einen Link geklickt, der diesem MATLAB-Befehl entspricht:
Führen Sie den Befehl durch Eingabe in das MATLAB-Befehlsfenster aus. Webbrowser unterstützen keine MATLAB-Befehle.
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)