Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
luca7084 committed Jun 28, 2023
1 parent d6fa789 commit 7c53090
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
7 changes: 5 additions & 2 deletions rocket_twin/notebooks/Visualisation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"metadata": {},
"outputs": [],
"source": [
"from rocket_twin.systems import Ground"
"from rocket_twin.systems import Ground\n",
"from rocket_twin.systems import Station"
]
},
{
Expand All @@ -17,7 +18,9 @@
"metadata": {},
"outputs": [],
"source": [
"ground = Ground('ground')"
"st1 = Station('st1')\n",
"st2 = Station('st2')\n",
"ground = Ground('ground', stations=[st1, st2])"
]
},
{
Expand Down
11 changes: 6 additions & 5 deletions rocket_twin/notebooks/test_sequences.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"source": [
"#Run fuelling sequence (transfers fuel from ground tank to rocket tank until it is full)\n",
"\n",
"s2 = [{'name' : 'fuel', 'type' : 'transient', 'init' : {'g_tank.flux' : 1.}, 'dt' : 0.1, 'Tf' : 5., 'stop' : 'rocket.tank.w_p == rocket.tank.w_max'}]\n",
"s2 = [{'name' : 'fuel', 'type' : 'transient', 'init' : {'g_tank.w_out_temp' : 1.}, 'dt' : 0.1, 'Tf' : 5., 'stop' : 'rocket.tank.weight_p == rocket.tank.weight_max'}]\n",
"run_sequences(sys, s2)"
]
},
Expand Down Expand Up @@ -142,8 +142,8 @@
"source": [
"#Run flight sequence (turns rocket on and discards rocket tank fuel until it is empty)\n",
"\n",
"s3 = [{'name' : 'flight', 'type' : 'transient', 'init' : {'rocket.tank.flux' : 0.5, 'g_tank.flux' : 0., 'rocket.dyn.switch' : True},\n",
" 'dt' : 0.1, 'Tf' : 10., 'stop' : 'rocket.tank.w_p == 0.'}]\n",
"s3 = [{'name' : 'flight', 'type' : 'transient', 'init' : {'rocket.tank.w_out_temp' : 0.5, 'g_tank.w_out_temp' : 0., 'rocket.dyn.switch' : True},\n",
" 'dt' : 0.1, 'Tf' : 10., 'stop' : 'rocket.tank.weight_p == 0.'}]\n",
"run_sequences(sys, s3)"
]
},
Expand Down Expand Up @@ -194,8 +194,9 @@
"\n",
"sequences = [\n",
" {'name' : 'start', 'design_method' : ['start'], 'type' : 'static'},\n",
" {'name' : 'fuel', 'type' : 'transient', 'init' : {'g_tank.flux' : 1.}, 'dt' : 0.1, 'Tf' : 5., 'stop' : 'rocket.tank.w_p == rocket.tank.w_max'},\n",
" {'name' : 'flight', 'type' : 'transient', 'init' : {'rocket.tank.flux' : 0.5, 'g_tank.flux' : 0.}, 'dt' : 0.1, 'Tf' : 10., 'stop' : 'rocket.tank.w_p == 0.'}\n",
" {'name' : 'fuel', 'type' : 'transient', 'init' : {'g_tank.w_out_temp' : 1.}, 'dt' : 0.1, 'Tf' : 5., 'stop' : 'rocket.tank.weight_p == rocket.tank.weight_max'},\n",
" {'name' : 'flight', 'type' : 'transient', 'init' : {'rocket.tank.w_out_temp' : 0.5, 'g_tank.w_out_temp' : 0., 'rocket.dyn.switch' : True},\n",
" 'dt' : 0.1, 'Tf' : 10., 'stop' : 'rocket.tank.weight_p == 0.'}\n",
"]\n",
"run_sequences(sys2, sequences)"
]
Expand Down
2 changes: 1 addition & 1 deletion rocket_twin/systems/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
from rocket_twin.systems.engine import Engine
from rocket_twin.systems.physics import Dynamics
from rocket_twin.systems.station import Station # isort : skip

from rocket_twin.systems.tank import Pipe, Tank # isort: skip
from rocket_twin.systems.rocket import Rocket, RocketGeom # isort: skip
from rocket_twin.systems.station import Station # isort: skip
from rocket_twin.systems.ground import Ground # isort: skip

__all__ = ["Engine", "Tank", "RocketGeom", "Rocket", "Pipe", "Dynamics", "Station", "Ground"]

0 comments on commit 7c53090

Please sign in to comment.