Closed jnangle closed 9 years ago
The array given in PVWattsv5.xml does not work with the library since the format is not recognized. If you change it to
<response>
<inputs>...</inputs>
<errors type="array"/>
<warnings type="array"/>
<version>1.2.0</version>
<ssc-info>...</ssc-info>
<station-info>
<lat type="float">40.016666412353516</lat>
<lon type="float">-105.25</lon>
<elev type="float">1634.0</elev>
<tz type="float">-7.0</tz>
<location>94018</location>
<city>BOULDER</city>
<state>CO</state>
<solar-resource-file>94018.tm2</solar-resource-file>
<distance type="integer">38036</distance>
</station-info>
<outputs>
<ac-monthly type="float">[9707.1943359375, 10191.212890625, 14889.302734375, 15481.29296875, 16531.017578125, 16387.6953125, 16299.7412109375, 15908.3876953125, 14523.0478515625, 12817.548828125, 9812.5400390625, 9209.373046875]
</ac-monthly>
</outputs>
</response>
it works as expected.
This is now fixed in v1.0.4, i.e. both xmlfile.getRealArray1D("outputs.ac-monthly",12)
and xmlfile.getRealArray1D("outputs.ac-monthly.ac-monthly",12)
work on your original XML file PVWattsv5.xml.
A little background on what I'm attempting to accomplish:
I am using XML and JSON files output from NREL's PVWatts API and other web services to get solar PV data for a given geographic location, and use it in Modelica models. I thought this would be a quicker approach than trying to re-create PVWatts in Modelica. Once I get this code working, I will be using it for wind data as well.
The Modelica code I'm using is:
The two lines that read the station lat and lon work just fine. I run into trouble when attempting to read an array of 12 values from the XML file into the pvMonthly array. I've looked at the function code for getRealArray1D and I think I'm calling it correctly. Once this is working, I will be loading an array of 8760 values of hourly PV data.
The log file dump from Dymola when I run the above code is:
The XML data I'm using is:
Apologies if this is a simple fix. I'm new to Modelica, but I have experience in Java and VBA.
Thank you in advance for your help.