Skip to content

Commit

Permalink
updated solve with new time units
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjamesgarza committed Mar 26, 2024
1 parent e13b7ee commit a2888c4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
11 changes: 2 additions & 9 deletions src/box_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,11 +269,6 @@ def solve(self):
"""
# TODO: Implement the logic to solve the box model simulation.
# Update the internal state of the BoxModel instance to reflect the simulation results.


#simulation time in seconds
sim_length_seconds = self.box_model_options.simulation_length * 60 * 60
print(sim_length_seconds)

#sets up initial conditions to be current conditions
curr_conditions = self.initial_conditions
Expand All @@ -292,12 +287,10 @@ def solve(self):
next_conditions_index = 0
next_conditions = self.evolving_conditions.conditions[0]
next_conditions_time = self.evolving_conditions.times[0]

print(self.box_model_options.chem_step_time)

#runs the simulation at each timestep
curr_time = 0

while(curr_time < sim_length_seconds):
while(curr_time <= (self.box_model_options.simulation_length)):
print(curr_concentrations)

#iterates evolvings conditons if enough time has elapsed
Expand Down
2 changes: 1 addition & 1 deletion src/music_box_model_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def from_UI_JSON(cls, UI_JSON):
@classmethod
def from_config_JSON(cls, config_JSON):

chem_step_time = utils.convert_time(config_JSON['box model options'], 'chemistry time step') * 60 * 60
chem_step_time = utils.convert_time(config_JSON['box model options'], 'chemistry time step')
output_step_time = utils.convert_time(config_JSON['box model options'], 'output time step')
simulation_length = utils.convert_time(config_JSON['box model options'], 'simulation length')

Expand Down

0 comments on commit a2888c4

Please sign in to comment.