Skip to content

Polynomial Functions

Torbjørn Cunis edited this page Dec 11, 2025 · 2 revisions

This page is under construction.

Syntax for polynomial functions

The class casos.Function provides functions of which the input and/or output are polynomial expressions.

casos.Function('f',{p1 ... pN},{q1 ... qM})

creates a function named 'f' mapping the M outputs to N inputs. Outputs may be any expressions of types casadi.DM, casadi.SX, casos.PD, or casos.PS whereas inputs must be symbolic expressions of types casadi.SX or casos.PS.

casos.Function('f',{p1 ... pN},{q1 ... qM},{'a1' ... 'aN'},{'b1' ... 'bM'})

creates a function named 'f' as described above but also assigns names to input and outputs.

Calling functions

Suppose f is a casos.Function object.

[s1,...,sM] = f(r1,...,rN)

calls the function f with arguments r1 through rN assigned to its inputs and returns the output values s1 through sM.

If the function f has named inputs and outputs, the following call syntax is also possible.

out = f('a1',r1,...,'aN',rN)

calls the function f with arguments r1 through rN assigned to inputs with names 'a1' through 'aN', respectively. In this case, the functionn call returns a structure with fields out.b1 through out.bM with corresponding output values.

Polynomials are not functions

It is important to note that polynomial themselves are not functions but mathematical objects. As such, CaΣoS' polynomial data types can be part of optimization problems. For evaluating a polynomial as function, the polynomial should first be converted to a CasADi function.

Quick links

Cite us

If you use CaΣoS, please cite us.

CaΣoS logo

Clone this wiki locally