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.
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:
|
||||||||||||||||
| 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')