diff --git a/a1.py b/a1.py index 651dfde..c05ca95 100644 --- a/a1.py +++ b/a1.py @@ -105,9 +105,13 @@ def calc_speed_at_outlet(water_height: float) -> float: def calc_new_water_height(old_water_height: float, reservoir_area: float, outlet_area: float, time_inc: float) -> tuple[float, float]: + water_mass_out = outlet_area * calc_speed_at_outlet(old_water_height) \ + * time_inc * WATER_DENSITY + new_water_height = old_water_height - \ + (water_mass_out / (reservoir_area * WATER_DENSITY)) - return (0.0, 0.0) + return new_water_height, water_mass_out # See if I get what the task sheet wants @@ -117,7 +121,7 @@ def sheet_tasks(): (determine_power_used, (5e6, 250, 8, 85), 500.9191176470588), (determine_water_released, (300, 250, 8, 85), 2994495.4128440367), (determine_cost_to_pump, (300, 8, 0.02), 48), - (calc_speed_at_outlet, (30), 24.261079942986875), + (calc_speed_at_outlet, (30,), 24.261079942986875), (calc_new_water_height, (20, 40000, 1, 30), (19.985143183382704, 592567.1021442247)), )