rl-institut / multi-vector-simulator

Multi-vector Simulation Tool assessing and optimizing Local Energy Systems (LES) for the E-LAND project
GNU General Public License v2.0
21 stars 10 forks source link

[Bug] Objective Value not in the simulation results #900

Closed smartie2076 closed 3 years ago

smartie2076 commented 3 years ago

The objective value of the simulation is not outputted. Is this identical to the annuity?

Checklist to make sure that the bug report ist complete:

smartie2076 commented 3 years ago

Tatsächlich ist der Wert der Objective Funktion nicht in dem automatischen Report, und auch nicht unbedingt equivalent zur Annuität des Gesamtsystems.

Scheinbar gibt es einen Bug, der macht dass der in C0.simulating() abgegriffene OBJECTIVE_VALUE (l. 334) später durch die log messages überschrieben wird. Wenn das behoben wird, kann er im json file ausgegeben oder auch dem Report zugefügt werden.

Der z.T. existierende Unterschied vom objective value und der total annuity rührt daher, dass in der Annuity auch die fixen Kosten ("development_costs") des Gesamtsystems und der Assets enthalten sind. Während der objective value sich nur auf die Werte bezieht, die tatsächlich minimiert werden können.

smartie2076 commented 3 years ago

Also: Leider kannst du den objective value nicht aus dem json ablesen :(

Es gibt zwei Ansätze: Entweder du schreibst den Satz wie unten hin.

Oder du simulierst einmal, lässt dir mit print(OBJECTIVE_VALUE) den Wert ausgeben und rechest manuell nach, ob

OJECTIVE_VALUE == sum(CAP*simulation_annuity(i)) + sum(i,t)(dispach(i,t)*DISPATCH_PRICE(i))

Mit allen i assets des Systems (vgl. energy system graph, alle Daten aus dem json file).

Wenn das einmal passt, kannst du diese Rechnung automatisieren mit einem python script für all deine Simulationen, indem du durch die component_groups und assets loopst.

Du könntest auch schauen ob

OJECTIVE_VALUE == sum(CAP*simulation_annuity(i)) + sum(i,t)(dispach(i,t)*DISPATCH_PRICE(i)) == sum (annuities(i)-development_costs(i))
smartie2076 commented 3 years ago

Ah, no, actually the annuity_total, even if without any fix development costs in assets or the project, does not have to be equal to the objective_value: If only one day is simulated, the objective value represents the costs to supply this one day with electicity, not the whole year.

smartie2076 commented 3 years ago

@FredericHirschmueller I now fixed the issue and found out: If the evaluated_period==365 in simulation settings and there are no entries in fix_costs.csv and in all assets development_costs==0 as well as installed_cap==0, the annuity_total is equal to the objective value.