Introduction to CasADi
22 Sep 2022 Learning-notes, CasADiNotes on CasADi, especially the usage of variables in CasADi
Variables
SX
SX data type represent matrix: create a matrix $x \in R^{2 \times 2}$
x = SX.sym('x', 2, 2) # create a matrix $\in R^{2 \times 2}$
print(x)
output: [[x_0, x_2],
[x_1, x_3]]
y = x**2
print(y)
output: x^2
MX
Suitable for NLP model
evalf(DM) # MX to DM
DM
DM mainly used to save matrix and used as function input and output
DM.full() # show the DM value
DM return values, SX,MX return equation that contains variables
SX have all the elements of the matrix, MX only define the matrix itself
Recent Posts
[30 Aug 2024] Paper: Deep DeePC
[29 Aug 2024] Developed QYtool toolbox
[25 Apr 2024] Developed modlinear toolbox