$gdxin basis_modell_input *$gdxin GAMS\basis_modell_input Sets A, N, T; $load A N T Parameters NachP(N,T), AngP(A), AngM(A,T), NachM(N,T); $load NachP AngP AngM NachM Parameters x_L(A,T), y_L(N,T),SpL_L(T), SpW_L(T) $gdxin basis_modell_output_mit_Speicher $load x_L y_L spL_L SpW_L Variables x(A,T) Einsatzmenge Technologietyp a in Zeitsegment T y(N,T) Bedarfsdeckung Verbrauchergruppe n in Zeitsegemtn T SpL(T) Einsatz von Speicher in Periode T SpW(T) Speicherstand zum Zeitpunkt T z Gesamtwohlfahrt Positive variable x Positive variable y; x.L(A,T) = x_L(A,T); y.L(N,T) = y_L(N,T); SpL.L(T) = SpL_L(T); SpW.L(T) = SpW_L(T); SpL.Up(T) = 200; SpL.Lo(T) = -200; SpW.Up(T) = 500; SpW.Lo(T) = 0; x.Up(A,T) = AngM(A,T); y.Up(N,T) = NachM(N,T); Alias(T,T2) Equations Wohlfahrt Zielfunktion zur Wohlfahrtmaximierung Bilanz(T) Bilanzgleichung Angebot = Nachfrage Bilanz_Sp(T) Bilanzgleichung Angebot = Nachfrage mit Speicher Speicherstand(T) Füllmenge Dummy_ZF Dummy_ZF; Wohlfahrt.. z =e= sum((N,T),y(N,T)*NachP(N,T))-sum((A,T),x(A,T)*AngP(A)); Bilanz(T).. sum(A, x(A,T)) =e= sum(N, y(N,T)); Bilanz_Sp(T).. sum(A, x(A,T)) =e= sum(N, y(N,T))+SpL(T)/0.8; Speicherstand(T).. SpW(T) =e= sum(T2$(ord(T2) < ord(T)),SpL(T2)); Dummy_ZF.. z =e= 0; Model Basis_Modell / Dummy_ZF, Bilanz_Sp, Speicherstand / ; Model Basis_Modell_mit_Speicher / Wohlfahrt, Bilanz_Sp, Speicherstand / ; Basis_Modell.optfile = 1 ; Solve Basis_Modell using lp maximize z ; Basis_Modell_mit_Speicher.optfile = 1 ; Solve Basis_Modell_mit_Speicher using lp maximize z ; Parameter p(T) *x_L(A,T) *y_L(N,T) *spL_L(T) *spW_L(T) ; p(T) = smax(A$x.l(A,T),AngP(A)); p(T)$(not p(T)) = EPS; x_L(A,T) = x.L(A,T); y_L(N,T) = y.L(N,T); SpL_L(T) = SpL.L(T); SpW_L(T) = SpW.L(T);