Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
# do not edit, generated by pymoca
from __future__ import print_function, division
import sympy
import sympy.physics.mechanics as mech
from pymoca.backends.sympy.runtime import OdeModel
from sympy import sin, cos, tan
class Quad(OdeModel):
def __init__(self):
super(Quad, self).__init__()
# states
phi, theta, psi_, P, Q, R, x, y, z, U, V, W = mech.dynamicsymbols('phi, theta, psi_, P, Q, R, x, y, z, U, V, W')
self.x = sympy.Matrix([phi, theta, psi_, P, Q, R, x, y, z, U, V, W])
self.x0 = {
phi : 0,
theta : 0,
psi_ : 0,
P : 0,
Q : 0,
R : 0,
x : 0,
# do not edit, generated by pymoca
from __future__ import print_function, division
import sympy
import sympy.physics.mechanics as mech
from pymoca.backends.sympy.runtime import OdeModel
from sympy import sin, cos, tan
class Aircraft(OdeModel):
def __init__(self):
super(Aircraft, self).__init__()
# states
body__x, body__v_x = mech.dynamicsymbols('body.x, body.v_x')
self.x = sympy.Matrix([body__x, body__v_x])
self.x0 = {
body__x : 0,
body__v_x : 0,
}
# variables
body__f_x, body__a_x, accel__a_x, accel__ma_x, accel__b_x__u, accel__b_x__y = mech.dynamicsymbols('body.f_x, body.a_x, accel.a_x, accel.ma_x, accel.b_x.u, accel.b_x.y')
self.v = sympy.Matrix([body__f_x, body__a_x, accel__a_x, accel__ma_x, accel__b_x__u, accel__b_x__y])
# do not edit, generated by pymoca
from __future__ import print_function, division
import sympy
import sympy.physics.mechanics as mech
from pymoca.backends.sympy.runtime import OdeModel
from sympy import sin, cos, tan
class SpringSystem(OdeModel):
def __init__(self):
super(SpringSystem, self).__init__()
# states
x, v_x = mech.dynamicsymbols('x, v_x')
self.x = sympy.Matrix([x, v_x])
self.x0 = {
x : 1.0,
v_x : 1.0,
}
# variables
spring__x, spring__f, damper__v, damper__f = mech.dynamicsymbols('spring.x, spring.f, damper.v, damper.f')
self.v = sympy.Matrix([spring__x, spring__f, damper__v, damper__f])
# do not edit, generated by pymoca
from __future__ import print_function, division
import sympy
import sympy.physics.mechanics as mech
from pymoca.backends.sympy.runtime import OdeModel
from sympy import sin, cos, tan
class Estimator(OdeModel):
def __init__(self):
super(Estimator, self).__init__()
# states
x = mech.dynamicsymbols('x')
self.x = sympy.Matrix([x])
self.x0 = {
x : 0,
}
# variables
y = mech.dynamicsymbols('y')
self.v = sympy.Matrix([y])