SPF-OST / pytrnsys

Package that provides functionality to run and process, plot and report TRNSYS simulations
https://pytrnsys.readthedocs.io
GNU General Public License v3.0
11 stars 8 forks source link

Automate the creation of certain printers/plotters #175

Open ahobeost opened 10 months ago

ahobeost commented 10 months ago

As a user, I would like to create printers and plotters more easily. This could look like the following: Given a ddck. Identify the parameters, inputs, and outputs of a unit Create a ddck with printers and/or plotters for these parameters, inputs, and outputs.

From type991_example.ddck

unit 1 type 991
PARAMETER 3
par1
par2
par3
INPUTS 2
input1
input2
*** initial values
input1 input2

EQUATIONS 3
output 1 = [1,1]
output 2 = [1,2]
output 3 = [1,3]

When given this ddck and the desired printer (type65) with certain arguments (nPlotsPerSim, axisMinMax, etc.) Would generate e.g.:

UNIT 89 TYPE 65      ! type991_example parameters
PARAMETERS 12     
3               ! 1: Nb. of left-axis variables
5               ! 2: Nb. of right-axis variables
0               ! 3: Left axis minimum
5               ! 4: Left axis maximum
0               ! 5: Right axis minimum
500                  ! 6: Right axis maximum
1                      ! 7: Number of plots per simulation
12          ! 8: X-axis gridpoints
1               ! 9: Shut off Online w/o removing
-1          ! 10: Logical unit for output file
0               ! 11: Output file units
0               ! 12: Output file delimiter
INPUTS 8
par1 par2 par3 input1 input2  ! left axis values
output1 output2 output3 ! right axis values
!
par1 par2 par3 input1 input2  ! left axis names
output1 output2 output3 ! right axis names

The user can then copy this into a desired ddck (plot_991.ddck, or printer_991.ddck) and tweak according to their needs.