diff --git a/test/test_electrolyzer.jl b/test/test_electrolyzer.jl index 7098a58..9d4f1fe 100644 --- a/test/test_electrolyzer.jl +++ b/test/test_electrolyzer.jl @@ -208,6 +208,12 @@ end # Test that there are no quadratic constraints for SimpleElectrolyzer types @test isempty(all_constraints(m, QuadExpr, MOI.EqualTo{MOI.Float64})) finalize(backend(m).optimizer.model) + + # Test for stack lifetimes shorter than op_per_strat + 𝒯 = TwoLevel(8, 2, SimpleTimes(20, 1); op_per_strat=8760) + stack_lifetime = 8000 + # Run and test the model + m, case, modeltype = elec_test_case(𝒯; stack_cost, deficit_cost, stack_lifetime) end # Test set for the used load limits allowing for both production above and below capacity @@ -251,10 +257,20 @@ end 𝒯 = TwoLevel(8, 2, SimpleTimes(20, 1); op_per_strat=8760) deficit_cost = StrategicProfile([25, 25, 25, 25, 30]) stack_cost = FixedProfile(3e8) - stack_lifetime = 8000 # Run and test the model - m, case, modeltype = elec_test_case(𝒯; stack_cost, deficit_cost, stack_lifetime) + m, case, modeltype = elec_test_case(𝒯; stack_cost, deficit_cost) + + # Overwrite the modeltype + modeltype = InvestmentModel(Dict(co2 => FixedProfile(0)), Dict(co2 => FixedProfile(0)), co2, 0.07) + + # Create and run the model + m = create_model(case, modeltype) + set_optimizer(m, OPTIMIZER) + optimize!(m) + + # Test the penalties + penalty_test(m, case) end @testset "With investment data" begin # Specifying the input parameters