function
LinearAlgebra.quadraticFormDerivative
Time derivative of x' P x for supplied x_dot and P_dot
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | x | Real | [:] | |
| input | xDerivative | Real | [size(x, 1)] | |
| input | P | Real | [size(x, 1), size(x, 1)] | |
| input | PDerivative | Real | [size(x, 1), size(x, 1)] = zeros(size(x, 1), size(x, 1)) | |
| output | valueDerivative | Real | |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function quadraticFormDerivative
"Time derivative of x' P x for supplied x_dot and P_dot"
input Real x[:];
input Real xDerivative[size(x, 1)];
input Real P[size(x, 1), size(x, 1)];
input Real PDerivative[size(x, 1), size(x, 1)] = zeros(size(x, 1), size(x, 1));
output Real valueDerivative;
protected
Real symmetricP[size(x, 1), size(x, 1)];
algorithm
symmetricP := LinearAlgebra.symmetrize(P);
valueDerivative := 2.0 * xDerivative * (symmetricP * x)
+ x * (LinearAlgebra.symmetrize(PDerivative) * x);
end quadraticFormDerivative;