### MX_CTODPA – Discretizes continuous model given by (A,B) to (Ad,Bd) using Pade approximations

Block SymbolLicensing group: STANDARD

Function Description

This function block discretizes a continuous state space model using Padé approximations of matrix exponential and its integral and scaling technique ([5]). The used technique is similar to method 3 Scaling and squaring described in [8].

The output references yA, yB, yAd, yBd, yP , yQ and yR are always set to the corresponding input references uA, uB, uAd, uBd, uP, uQ and uR. If HLD = on then nothing is computed otherwise the function mCtoD is called internally:

mCtoD(nRes, uAd, uBd, uA, uB, N, M, is, Ts, eps, uP, uQ, uR);

where parameters of mCtoD are set in the following way:

- nRes is return code from the function mCtoD.
- N is number of rows of the square system matrix referenced by uA.
- M is number of columns of the input matrix referenced by uB.
- Ts is sampling period for the discretization, which is equal to sampling period of the task containing this function block.

The error flag E is set to on if:

- the reference uA or uB or uAd or uBd or uP or uQ or uR is not defined (i.e. input uA or uB or uAd or uBd or uP or uQ or uR is not connected),
- number of columns of the matrix referenced by uA is not equal to N,
- number of rows of the matrix referenced by uB is not equal to N,
- number of elements of any matrix referenced by uAd, uP, uQ or uR is less than $\mathtt{\text{N}}\ast \mathtt{\text{N}}$,
- number of elements of the matrix referenced by uBd is less than $\mathtt{\text{N}}\ast \mathtt{\text{M}}$,
- the return code nRes of the function mCtoD is not equal to zero.

Inputs

uA | Input reference to matrix A | Reference |

uB | Input reference to matrix B | Reference |

uAd | Input reference to discretized matrix A | Reference |

uBd | Input reference to discretized matrix B | Reference |

uP | Input reference to a helper matrix | Reference |

uQ | Input reference to a helper matrix | Reference |

uR | Input reference to a helper matrix | Reference |

HLD | Hold | Bool |

Parameters

is | Pade approximation order $\downarrow $0 $\uparrow $4 $\odot $2.00E+00 | Long (I32) |

eps | Approximation accuracy $\downarrow $1e-20 $\uparrow $0.001 $\odot $1e-15 | Double (F64) |

Outputs

yA | Output reference to matrix A | Reference |

yB | Output reference to matrix B | Reference |

yAd | Output reference to discretized matrix A | Reference |

yBd | Output reference to discretized matrix B | Reference |

yP | Output reference to a helper matrix | Reference |

yQ | Output reference to a helper matrix | Reference |

yR | Output reference to a helper matrix | Reference |

E | Error indicator | Bool |

[Previous] [Back to top] [Up] [Next]

2020 © REX Controls s.r.o., www.rexygen.com