LabVIEW Control Design and Simulation Module

c_to_d (MathScript RT Module Function)

  • Updated2023-03-14
  • 2 minute(s) read

c_to_d (MathScript RT Module Function)

Owning Class: convert

Requires: Control Design and Simulation Module and MathScript RT Module

Syntax

SysDis = c_to_d(SysCon, Ts)

SysDis = c_to_d(SysCon, Ts, method)

SysDis = c_to_d(SysCon, Ts, 'prewarp', w)

[SysDis, Ic] = c_to_d(SysCon, Ts)

[SysDis, Ic] = c_to_d(SysCon, Ts, method)

[SysDis, Ic] = c_to_d(SysCon, Ts, 'prewarp', w)

Legacy Name: c2d

Description

Converts a continuous system model to a discrete model using the method you specify. This function also returns the initial condition conversion matrix. Refer to the LabVIEW Control Design User Manual for information about these conversion methods.

Examples

Inputs

Name Description
SysCon Specifies a continuous linear time-invariant (LTI) model in transfer function, zero-pole-gain, or state-space form.
Ts Specifies the sampling time of the discrete model SysDis. Ts is a real scalar.
method Specifies the method this function uses to convert the SysCon model to the SysDis model. method is a string that can take the following values:

'zoh' (Default) Converts the model using the Zero-Order-Hold method.
'tustin' Converts the model using Tustin's method.
'forward' Converts the model using the Forward Rectangular method.
'backward' Converts the model using the Backward Rectangular method.
'foh' Converts the model using the First-Order-Hold method.
'matched' Converts the model using the Matched Pole-Zero method.
'prewarp' Converts the model using the Prewarp method. If you enter this option, you also must specify the prewarp frequency w as an input to this function.
'z transform' Converts the model using the Z-Transform method.
w Specifies the prewarp frequency, in radians/second. The default value is 4. w is a real scalar.

Outputs

Name Description
SysDis Returns a discrete system with sampling time Ts in transfer function, zero-pole-gain, or state-space form.
Ic Returns the initial condition conversion matrix, which this function uses to discretize the continuous initial conditions vector. Ic is a real matrix.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

SysCon = ss(-1, 1, 2, 0)
[SysDis, Ic] = c_to_d(SysCon, 0.1, 'foh')

Related Topics

d_to_c
d_to_d