diff --git a/energy_models/core/investments/disciplines/independent_invest_disc.py b/energy_models/core/investments/disciplines/independent_invest_disc.py index 35e55a9a..e8ed5c93 100644 --- a/energy_models/core/investments/disciplines/independent_invest_disc.py +++ b/energy_models/core/investments/disciplines/independent_invest_disc.py @@ -294,6 +294,16 @@ def pimp_string(val: str): new_chart_energy = TwoAxesInstanciatedChart(GlossaryEnergy.Years, 'Invest [G$]', chart_name=chart_name, stacked_bar=True) + + # max budget constraint charts + max_budget_df = self.get_sosdisc_inputs(GlossaryEnergy.MaxBudgetValue) + max_budget = max_budget_df[GlossaryEnergy.MaxBudgetValue].values + years = max_budget_df[GlossaryEnergy.Years].values + if max_budget.max() > 0: + serie_max_budget = InstanciatedSeries(list(years), list(max_budget), GlossaryEnergy.MaxBudgetValue, + 'dash_lines') + new_chart_energy.add_series(serie_max_budget) + energy_list = self.get_sosdisc_inputs(GlossaryEnergy.energy_list) ccs_list = self.get_sosdisc_inputs(GlossaryEnergy.ccs_list) @@ -373,23 +383,6 @@ def pimp_string(val: str): instanciated_charts.insert(1, new_chart_energy_ratio) - #max budget constraint charts - max_budget_df = self.get_sosdisc_inputs(GlossaryEnergy.MaxBudgetValue) - max_budget = max_budget_df[GlossaryEnergy.MaxBudgetValue].values - years = max_budget_df[GlossaryEnergy.Years].values - if max_budget.max() > 0 : - - chart_max_budget = TwoAxesInstanciatedChart(GlossaryEnergy.Years, GlossaryEnergy.MaxBudgetDf['unit'], - chart_name=GlossaryEnergy.MaxBudgetConstraintValue, stacked_bar=True) - - serie_max_budget = InstanciatedSeries(list(years), list(max_budget), GlossaryEnergy.MaxBudgetValue, 'dash_lines') - chart_max_budget.add_series(serie_max_budget) - - energy_invests = self.get_sosdisc_outputs(GlossaryEnergy.EnergyInvestmentsWoTaxValue)[GlossaryEnergy.EnergyInvestmentsWoTaxValue].values * 1000 - serie_invests = InstanciatedSeries(list(years), list(energy_invests), "Invests", - 'bar') - chart_max_budget.add_series(serie_invests) - instanciated_charts.insert(1, chart_max_budget) return instanciated_charts diff --git a/energy_models/sos_processes/energy/MDA/energy_mix_optim_sub_process/usecase.py b/energy_models/sos_processes/energy/MDA/energy_mix_optim_sub_process/usecase.py index a95b402e..6854a9be 100644 --- a/energy_models/sos_processes/energy/MDA/energy_mix_optim_sub_process/usecase.py +++ b/energy_models/sos_processes/energy/MDA/energy_mix_optim_sub_process/usecase.py @@ -405,10 +405,10 @@ def make_dspace_utilisation_ratio(self) -> pd.DataFrame: def make_func_df(self): func_df = pd.DataFrame({ - "variable": [GlossaryEnergy.CO2EmissionsObjectiveValue, GlossaryEnergy.CO2EmissionsObjectiveValue, GlossaryEnergy.TargetProductionConstraintValue, GlossaryEnergy.MaxBudgetConstraintValue,], + "variable": [GlossaryEnergy.ObjectiveEnergyNonUseCapital, GlossaryEnergy.CO2EmissionsObjectiveValue, GlossaryEnergy.TargetProductionConstraintValue, GlossaryEnergy.MaxBudgetConstraintValue,], "parent": ["objectives", "objectives", "constraints", "constraints"], "ftype": [FunctionManagerDisc.OBJECTIVE, FunctionManagerDisc.OBJECTIVE, FunctionManagerDisc.INEQ_CONSTRAINT, FunctionManagerDisc.INEQ_CONSTRAINT], - "weight": [1.0, .0, .0, 100.0,], + "weight": [1.0, 1.0, .0, 100.0,], FunctionManagerDisc.AGGR_TYPE: [FunctionManager.AGGR_TYPE_SUM, FunctionManager.AGGR_TYPE_SUM, FunctionManager.INEQ_NEGATIVE_WHEN_SATIFIED_AND_SQUARE_IT, FunctionManager.INEQ_NEGATIVE_WHEN_SATIFIED_AND_SQUARE_IT,], "namespace": [GlossaryEnergy.NS_FUNCTIONS] * 4 })