# Plot "Day Mean" grid-tied behind-the-meter storage simulation. # Damon Hart-Davis licenses this file to you # under the Apache Licence, Version 2.0 (the "Licence"); # you may not use this file except in compliance # with the Licence. You may obtain a copy of the Licence at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the Licence is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the Licence for the # specific language governing permissions and limitations # under the Licence. # # Author(s) / Copyright (s): Damon Hart-Davis 2018 # Prepare graph with a command similar to: #sh script/storesim/batsim1.sh GRAPHOUT=daymean > .work/tmp/batsim1-daymean.dat.tmp && gnuplot -e "title='Outturn'" graphing/storesim/batsim1-daymean-1.txt # # Consists of a mean values of key parameters for each minute of the day. # (If the cycling loads have exactly 1440 sampled then they will be steady.) # # Input format: #G daymean HH:MM 00:00 n 31 flow|W -52 SoC|% 19 #G daymean HH:MM 00:01 n 31 flow|W -49 SoC|% 18 #G daymean HH:MM 00:02 n 31 flow|W -48 SoC|% 18 #G daymean HH:MM 00:03 n 31 flow|W -48 SoC|% 18 # # Fields/columns (label is followed by the value): # * HH:MM is (UTC or solar time) hour:minute of day. # * n is number of samples for that minute/ # * flow|W is the mean flow for that minute (W); -ve is import from grid. # * SoC|% is the usable State of Charge of the battery (%). # Derived from graphing/gnuplotBattVRPi.txt 20180729. # Input filename supplied as: # gnuplot -e "infilename='in.dat'" if (!exists("infilename")) infilename='.work/tmp/batsim1-daymean.dat.tmp' # Output filename supplied as: # gnuplot -e "outfilename='out.png'" if (!exists("outfilename")) outfilename='batsim1-daymean.png' # X-axis format supplied as: # gnuplot -e "xafmt='%Hh'" if (!exists("xafmt")) xafmt='%Hh' # Title if (exists("title")) set title title if (!exists("title")) set title "Daily Mean Battery Simulation" set terminal png set output outfilename set grid #set key bottom left horizontal #set key below horizontal set xdata time set y2range [0:100] set timefmt x "%H:%M" set y2tics #set timefmt x "%H:%M" set format x xafmt set format y "%gW" set format y2 "%g%%" #set style fill transparent solid 0.1 border #set style fill transparent pattern 4 border # Omit some 'bad' (-1) data values from the display. # Setting lw 2 for export W to make easier to read for red/green colourblind. plot infilename using 4:10 title "SoC %" with lines axes x1y2, \ "" using 4:8 title "export W" with lines lw 2