Comments (4)
Thank you for reporting this Bug and creating an issue.
This was already detected and is being fixed by the hotfix PR #479 . A release containing this hotfix will be released in a few days.
Additionally, could you provide more information about which Tank
class produced this issue (or even a code sample) so we can check if the planned hotfix covers this case?
from rocketpy.
The Tank used was a MassFlowRateBasedTank.
Here is the code sample, which caused the bug:
Define fluids
oxidizer_liq = Fluid(name="LOX", density=1141)
fuel_liq = Fluid(name="ethanol", density=789)
pressurant_gas = Fluid(name="N2", density=1.034)
Define tanks geometry
eth_tank_shape = CylindricalTank(radius = 13 / 100, height = 0.345409407550068, spherical_caps = True)
lox_tank_shape = CylindricalTank(radius = 13 / 100, height = 0.28827610851596, spherical_caps = True)
pressurant_tank_shape = CylindricalTank(radius = 6 / 100, height = 0.22, spherical_caps = True)
Define tanks
oxidizer_tank = MassFlowRateBasedTank(
name="oxidizer tank",
geometry=eth_tank_shape,
flux_time=5,
initial_liquid_mass=4.695,
initial_gas_mass=0,#.1880196263187668,
liquid_mass_flow_rate_in=0,
liquid_mass_flow_rate_out=lambda t: 0.4815384615384616, #/ 3 * exp(-0.25 * t),
gas_mass_flow_rate_in=0,
gas_mass_flow_rate_out=0,
liquid=oxidizer_liq,
gas=pressurant_gas,
)
fuel_tank = MassFlowRateBasedTank(
name="fuel tank",
geometry=lox_tank_shape,
flux_time=5,
initial_liquid_mass=3.611538461538462,
initial_gas_mass=0,#.1880196263187668,
liquid_mass_flow_rate_in=0,
liquid_mass_flow_rate_out=lambda t: 0.626, #/ 3 * exp(-0.25 * t),
gas_mass_flow_rate_in=0,
gas_mass_flow_rate_out=0,
liquid=fuel_liq,
gas=pressurant_gas,
)
pressurant_tank = MassFlowRateBasedTank(
name="pressurant tank",
geometry=pressurant_tank_shape,
flux_time=5,
initial_liquid_mass=0,
initial_gas_mass=0.1980196263187668,
liquid_mass_flow_rate_in=0,
liquid_mass_flow_rate_out=0,
gas_mass_flow_rate_in=0,
gas_mass_flow_rate_out=lambda t: 2.397258605729897/63,
liquid=fuel_liq,
gas=pressurant_gas,
)
example_liquid = LiquidMotor(
thrust_source=lambda t: 2000,# - 100 * t**2,
dry_mass=2,
dry_inertia=(0.125, 0.125, 0.002),
nozzle_radius=13 / 100,
center_of_dry_mass_position=0.7,
nozzle_position=0,
burn_time=5,
coordinate_system_orientation="nozzle_to_combustion_chamber",
)
example_liquid.add_tank(tank=oxidizer_tank, position=1.5)
example_liquid.add_tank(tank=fuel_tank, position=0.8)
example_liquid.add_tank(tank=pressurant_tank, position=1.1)
example_liquid.add_tank(tank=pressurant_tank, position=1.8)
example_liquid.draw()
example_liquid.info();
By adding the Motor to the Rocket using:
hedy.add_motor(example_liquid, position=-1.255)
The following output is produced, when hedy.draw() is called:
The Method hedy.info(); returns the following:
Inertia Details
Rocket Mass: 25.000 kg (without motor)
Rocket Dry Mass: 27.000 kg (with unloaded motor)
Rocket Loaded Mass: 35.703 kg (with loaded motor)
Rocket Inertia (with unloaded motor) 11: 7.016 kgm2
Rocket Inertia (with unloaded motor) 22: 7.016 kgm2
Rocket Inertia (with unloaded motor) 33: 0.036 kgm2
Rocket Inertia (with unloaded motor) 12: 0.000 kgm2
Rocket Inertia (with unloaded motor) 13: 0.000 kgm2
Rocket Inertia (with unloaded motor) 23: 0.000 kgm2
Geometrical Parameters
Rocket Maximum Radius: 0.13 m
Rocket Frontal Area: 0.053093 m2
Rocket Distances
Rocket Center of Dry Mass - Center of Mass without Motor: 0.041 m
Rocket Center of Dry Mass - Nozzle Exit: 1.214 m
Rocket Center of Dry Mass - Center of Propellant Mass: 8125060076944.635 m
Rocket Center of Mass - Rocket Loaded Center of Mass: 1980500324599.361 m
Aerodynamics Lift Coefficient Derivatives
Nose Cone Lift Coefficient Derivative: 2.000/rad
Fins Lift Coefficient Derivative: 11.071/rad
Tail Lift Coefficient Derivative: -0.490/rad
Center of Pressure
Nose Cone Center of Pressure position: 2.799 m
Fins Center of Pressure position: -0.906 m
Tail Center of Pressure position: -1.224 m
Stability
Center of Mass position (time=0): -1980500324599.402 m
Initial Static Margin (mach=0, time=0): -7617308940765.757 c
Final Static Margin (mach=0, time=burn_out): -9130882444823.043 c
Rocket Center of Mass (time=0) - Center of Pressure (mach=0): 1980500324599.097 m
Parachute Details
Parachute Main with a cd_s of 10.0000 m2
Ejection signal trigger: 800 m (AGL)
Ejection system refresh rate: 105.000 Hz
Time between ejection signal is triggered and the parachute is fully opened: 1.5 s
Parachute Details
Parachute Drogue with a cd_s of 1.0000 m2
Ejection signal trigger: At Apogee
Ejection system refresh rate: 105.000 Hz
Time between ejection signal is triggered and the parachute is fully opened: 1.5 s
from rocketpy.
@theDiego21 , I think your error no longer persists on the latest rocketpy. Can you try running pip install rocketpy --upgrade
and test your code again please?
from rocketpy.
Just tested the same code sample again with latest version 1.1.3
and this is the new output:
I believe this solves the issue
from rocketpy.
Related Issues (20)
- DOC: Software in a Loop (SIL) example with parachute ejection systems
- DOC: update badges on our README
- DOC: stop cloning the whole repository just for examples HOT 1
- ENH: plot inertia tensor components in a single plot
- ENH: display both power_off_drag and power_on_drag in a single plot
- ENH: adds `axial_acceleration` attribute to the Flight class HOT 2
- MNT: EmptyMotor class inherits from Motor(ABC)
- MNT: delete tools.cached_property
- DOC: convert notebooks to .rst files in the documentation
- ENH: Support for Meteomatics API
- ENH: give me a scissor or apply `Function.clip` and `Function.crop`
- BUG: Invalid Center of Pressure for Rockets with Variable Diameter
- Incorrect/incomplete docstring in environment.py HOT 4
- MNT: save ref_factor value when adding aero surfaces to a Rocket
- ENH: Allow saving plots instead of showing them HOT 3
- BLD: change setup.py to pyproject.toml HOT 1
- ENH: Use eng files to define additional motor parameters HOT 2
- ENH: Create a "create_enemble" function
- BUG: RailButtons does not have rocket_radius attribute HOT 1
- BUG: TypeError when creating nose cones with bluffness between 0 and 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rocketpy.