In [67]:
from sympy.abc import*
from sympy import *
from tools import*
from nlcontrol import*
s = Symbol('s')
c = Symbol('c')
a1 = Symbol('a1')
a2 = Symbol('a2')
a3 = Symbol('a3')
a4 = Symbol('a4')
In [14]:
solve(a1 - 3,a1)
Out[14]:
In [19]:
M = Matrix([a1,a2,a3]).T
M
g = Matrix([[c, 0],[s,0], [0,1]])
m = M*g
solve(m[0],a1)
Out[19]:
In [51]:
from sympy import Matrix, solve_linear_system
x, y, z = symbols('x, y, z')
A = Matrix(( (c, s, 0, 0), (0, 0, 1, 0) ))
solve_linear_system(A, x, y, z)
In [57]:
solve([Eq(a1*c + a2*s, 0), Eq(a3, 0)], [a1,a2,a3])
Out[57]:
In [53]:
x1, x2, x3, x4 = symbols('x_1, x_2, x_3, x_4')
u1, u2, u3, u4 = symbols('u_1, u_2, u_3, u_4')
#M = Matrix([cos(x3), 0],[sin(x3), 0], [tan(x4), 0], [0, 1] )
In [81]:
solve([Eq(a1*cos(x3) - a3*tan(x4), 0)], [a1])
Out[81]:
In [73]:
A = Matrix(( (c, s, 0, 0), (0, 0, 1, 0) ))
solve_linear_system(A, x1, x2, x3)
M = Matrix([[cos(x3), 0],[sin(x3), 0], [tan(x4), 0], [0, 1]] )
M.nullspace()
Out[73]:
In [84]:
f = 1 -x2 - (x3**2)/(1+x1)**2
f
Out[84]:
In [85]:
simplify(f)
Out[85]:
In [86]:
Out[86]:
In [87]:
expand(f)
Out[87]:
In [88]:
expand((x1+1)**2)
Out[88]:
In [90]:
f2 = (2+x1)/(1+x1)*(-x3 + (x2*x3)/(1+x1**2) +u1)
f2
Out[90]:
In [91]:
simplify(f2)
Out[91]:
In [92]:
expand(f2)
Out[92]:
In [93]:
solve(a1*(2 + x1) -1 -x1, a1)
Out[93]:
In [ ]: