Esempio n. 1
0
def test_instantiation_error():
    ambient = Ambient(temperature=0)
    with pytest.raises(ValueError) as e_info:
        air_density = ambient.air_density

    ambient = Ambient(humidity=104)
    with pytest.raises(ValueError) as e_info:
        air_density = ambient.air_density

    ambient = Ambient(pressure=-3)
    with pytest.raises(ValueError) as e_info:
        air_density = ambient.air_density
Esempio n. 2
0
def freebody_component():
    freebody_component = FreeBody(name='component',
                                  type='generic_component',
                                  mass=3.4,
                                  angle=math.radians(5),
                                  position_cg=Vector2(-0.7, 0.2),
                                  pitch_rot_inertia=30.0,
                                  ambient=Ambient())
    return freebody_component
Esempio n. 3
0
def plane():
    env = Ambient()
    plane = FreeBody(
        name='plane',
        type='plane',
        mass=23.4,
        position_cg=Vector2(-0.2, 0.02),
        pitch_rot_inertia=5.2,
        ambient=env,
    )
    return plane
Esempio n. 4
0
def freebody():
    env = Ambient()
    freebody = FreeBody(
        name='freebody',
        type='generic_freebody',
        mass=23.4,
        position_cg=Vector2(-0.2, 0.02),
        pitch_rot_inertia=5.2,
        ambient=env,
    )
    return freebody
Esempio n. 5
0
def base_ambient():
    base_ambient = Ambient(temperature=288.15, pressure=101325, humidity=30)
    return base_ambient
Esempio n. 6
0
import math
from vec import Vector2
from adr.World import Ambient
from adr.Components import FreeBody, AttachedComponent

ambient = Ambient()

plane = FreeBody(name='plane',
                 mass=0.0,
                 position_cg=Vector2(x=-0.05, y=0),
                 pitch_rot_inertia=30.0,
                 ambient=ambient)

wing = AttachedComponent(
    name='wing',
    relative_position=Vector2(x=-0.10, y=0),
    relative_angle=math.radians(+5),
    mass=0.370,
)

wing.set_parent(plane)

print(plane.wing.mass)