misc/printme.py

This example looks at the printme method

View output (PDF) | source (python)

See also
casadi::printme();
1 
2 
3 
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 
24 from casadi import *
25 
26 a = SX.sym("a")
27 b = SX.sym("b")
28 
29 c = a+b
30 c = c.printme(13)
31 
32 d = c**2
33 
34 print(d)
35 
36 f = Function("f", [a,b],[d])
37 
38 
39 
40 
41 
42 f(4,3)
43 
44 dd_da = jacobian(d, a)
45 J = Function('J', [a,b], [dd_da])
46 
47 
48 
49 
50 J(2,9)
51 
52 d2d_da2 = jacobian(dd_da, a)
53 J = Function('J', [a,b], [d2d_da2])
54 
55 
56 
57 J(2,9)