Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

realp

Real tunable parameter

Syntax

p = realp(paramname,initvalue)

Description

p = realp(paramname,initvalue) creates a tunable real-valued parameter with name specified by paramname and initial value initvalue. Tunable real parameters can be scalar- or matrix- valued.

Input Arguments

paramname

Name of the realp parameter p, specified as a character vector such as 'a' or 'zeta'. This input argument sets the value of the Name property of p.

initvalue

Initial numeric value of the parameter p. initvalue can be a real scalar value or a 2-dimensional matrix.

Output Arguments

p

realp parameter object.

Properties

Name

Name of the realp parameter object, stored as a character vector. The value of Name is set by the paramname input argument to realp and cannot be changed.

Value

Value of the tunable parameter.

Value can be a real scalar value or a 2-dimensional matrix. The initial value is set by the initvalue input argument. The dimensions of Value are fixed on creation of the realp object.

Minimum

Lower bound for the parameter value. The dimension of the Minimum property matches the dimension of the Value property.

For matrix-valued parameters, use indexing to specify lower bounds on individual elements:

 p = realp('K',eye(2));
 p.Minimum([1 4]) = -5;

Use scalar expansion to set the same lower bound for all matrix elements:

p.Minimum = -5;

Default: -Inf for all entries

Maximum

Upper bound for the parameter value. The dimension of the Maximum property matches the dimension of the Value property.

For matrix-valued parameters, use indexing to specify upper bounds on individual elements:

 p = realp('K',eye(2));
 p.Maximum([1 4]) = 5;

Use scalar expansion to set the same upper bound for all matrix elements:

p.Maximum = 5;

Default: Inf for all entries

Free

Boolean value specifying whether the parameter is free to be tuned. Set the Free property to 1 (true) for tunable parameters, and 0 (false) for fixed parameters.

The dimension of the Free property matches the dimension of the Value property.

Default: 1 (true) for all entries

Examples

collapse all

This example shows how to create a low-pass filter with one tunable parameter a:

$$F = \frac{a}{{s + a}}$$

You cannot use tunableTF to represent F, because the numerator and denominator coefficients of a tunableTF block are independent. Instead, construct F using the tunable real parameter object realp.

Create a tunable real parameter with an initial value of 10.

a = realp('a',10);

Use tf to create thetunable filter F.

F = tf(a,[1 a]);

F is a genss object which has the tunable parameter a in its Blocks property. You can connect F with other tunable or numeric models to create more complex control system models. For example, see Control System with Tunable Components.

Create a matrix with tunable diagonal elements and with off-diagonal elements fixed to zero.

Create a parametric matrix whose initial value is the identity matrix.

p = realp('P',eye(2));

p is a 2-by-2 parametric matrix. Since the initial value is the identity matrix, the off-diagonal initial values are zero.

Fix the values of the off-diagonal elements by setting the Free property to false.

p.Free(1,2) = false;
p.Free(2,1) = false;

More About

collapse all

Tips

  • Use arithmetic operators (+, -, *, /, \, and ^) to combine realp objects into rational expressions or matrix expressions. You can use the resulting expressions in model-creation functions such as tf, zpk, and ss to create tunable models. For more information about tunable models, see Models with Tunable Coefficients in the Control System Toolbox™ User's Guide.

See Also

| | |

Introduced in R2011a

Was this topic helpful?