예제 #1
0
# The method receive the name of the function, the f(y,x_1,x_2,...,x_n) 
# function, the g(y,x_1,x_2,...,x_n) function, and a list with tuples 
# representing the args that call the function (this is a hack, 
# because the actual matching system is not as good as i want).

# State function
sys.f(Matrix(
        [u[0]/A_1 -K_1 / A_1 * pow(x[0], 2.475),
         (K_1 / A_c) * pow(x[0], 2.475) - (K_c * b_c / A_c) * pow(x[1], 1.8),
         (K_c * b_c / A_2) * pow(x[1], 1.8) - (K_2 / A_2) * x[2]
         ])
      )

# Output function
sys.h(Matrix([x[2]]))

# Linearization!!!
A,B,C = sys.linearize(x, u)


print "A ="
print(A)

print "B ="
print(B)

print "C ="
print(C)


예제 #2
0
파일: Test.py 프로젝트: jorgeecardona/tesis
    [(x[0],)]
    )

# State function
sys.f(Matrix(
        [x[1],
         9.81 - 2 * T(rho(L(beta(x[0])),x[2])) * sin(beta(x[0]))/M_p - k_f * x[1] / M_p,
         A * r * (rho_e * u[0] - rho(L(beta(x[0])),x[2]) * u[1] )
         ])
      )

# Output function
sys.h(Matrix([x[0]]))

# Linearization!!!
A,B,C = sys.linearize(Matrix([0.5,0,0.01417]), Matrix([5, 5.7690]))


print "A ="
print(A)

print "B ="
print(B)

print "C ="
print(C)

print latex(A)
print latex(B)
print latex(C)