csnlp.core.data.cs2array#

csnlp.core.data.cs2array(x)[source]#

Converts the symbolic variable x to a numpy array of scalar symbolic variables (see array2cs for the opposite functionality).

Inspired by the implementation in MPCTools.

Parameters:
xcasadi.SX or MX

A symbolic variable (with multiple entries).

Returns:
numpy array of casadi.SX or MX

The array containing the symbolic variable scalars.

Return type:

ndarray

Examples using csnlp.core.data.cs2array#

Comparison of CasADi’s and csnlp’s sensitivity computations

Comparison of CasADi's and csnlp's sensitivity computations