Skip to content

Commit

Permalink
Replace initial condition to evolving condition (#277)
Browse files Browse the repository at this point in the history
* initial condition changed

* fixed test
  • Loading branch information
montythind authored Dec 2, 2024
1 parent 383e938 commit 89d1627
Show file tree
Hide file tree
Showing 3 changed files with 4,270 additions and 4,262 deletions.
7 changes: 5 additions & 2 deletions src/acom_music_box/music_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@ def solve(self, callback=None):
next_conditions_time = 0
next_conditions_index = 0
if (len(self.evolving_conditions) != 0):
if (self.evolving_conditions.times[0] != 0):
if(self.evolving_conditions.times[0] == 0):
initial_concentration = curr_conditions.species_concentrations
evolving_concentrations = self.evolving_conditions.conditions[0].species_concentrations
initial_concentration.update({k: float(v) for k, v in evolving_concentrations.items() if k in initial_concentration})
elif (self.evolving_conditions.times[0] != 0):
next_conditions_index = 0
next_conditions = self.evolving_conditions.conditions[0]
next_conditions_time = self.evolving_conditions.times[0]
Expand Down Expand Up @@ -130,7 +134,6 @@ def solve(self, callback=None):
curr_time = 0
next_output_time = curr_time
# runs the simulation at each timestep

simulation_length = self.box_model_options.simulation_length
with tqdm(total=simulation_length, desc="Simulation Progress", unit=f" [model integration steps ({self.box_model_options.chem_step_time} s)]", leave=False) as pbar:
while curr_time < simulation_length:
Expand Down
Loading

0 comments on commit 89d1627

Please sign in to comment.