C
Curbie
I'm porting NREL's pvwatts.c (version 1) to Visual Basic for
Applications (VBA) so I can use Typical Meteorological Year version 3
(TMY3) data for 1020 reporting stations. Summaries of TMY3 data along
with the ported pvwatts code are intended for use in an Excel
spread-sheet, hence the VBA port.
I choose pvwatts so I verify my code against a known standard before
using the ported functions for my spread-sheet's needs. The ported
code's monthly results seems to match NREL's results given compiler
float point differences, but the ported code's daily results are off?
My questions are:
1) Has anyone done this port before, is this the best results I
can expect given compiler float point differences?
2) Does this look like a porting bug or just float point
differences?
Any help would be appreciated.
Thanks,
Curbie
My Results <<<<<<<<<<<<<<<<<<<<<<<<<<
Station Identification
WBRS#: 26451
City: Anchorage
State: Alaska
Latitude(deg): 61.16667
Longitude(deg): -150.0167
Elevation(m): 35
PV System Specifications
AC Rating(kW): 4
Array Type: Fixed Tilt
Array Tilt(deg): 61.16667
Array Azimuth(deg): 180
Energy Cost(cents/kWh): 0.124
Energy Production
Month Rad. AC kWh
(kwh) (kwh) cost
1 0.83 095 11.78
2 2.16 245 30.38
3 3.74 469 58.16
4 4.31 506 62.74
5 4.82 569 70.56
6 4.68 511 63.36
7 4.45 496 61.50
8 3.75 418 51.83
9 3.25 362 44.89
10 1.88 218 27.03
11 1.39 163 20.21
12 0.61 066 08.18
----------------------------
Yearly 2.99 4111 509.76
1 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0
6 0 0 0 0 0 1 1 0 0 0 0 0
7 0 0 0 0 1 1 1 1 0 0 0 0
8 0 0 1 1 1 1 1 1 0 0 0 0
9 0 1 8 3 8 9 5 2 1 1 1 0
10 1 5 23 15 22 23 16 13 10 4 4 1
11 6 22 40 31 36 35 28 22 21 14 19 2
12 11 34 47 47 49 45 41 35 35 22 27 12
13 20 42 60 56 61 50 49 46 42 28 31 16
14 19 42 57 62 62 56 53 47 46 32 26 15
15 16 38 60 60 65 52 54 47 48 29 22 9
16 7 28 48 54 55 50 50 46 41 27 10 2
17 1 12 28 48 47 47 43 37 34 17 1 0
18 0 1 11 33 35 33 35 29 21 7 0 0
19 0 0 1 16 20 21 23 15 10 1 0 0
20 0 0 0 3 5 8 8 3 1 0 0 0
21 0 0 0 1 1 2 1 1 1 0 0 0
22 0 0 0 0 1 1 1 1 0 0 0 0
23 0 0 0 0 0 1 1 0 0 0 0 0
24 0 0 0 0 0 0 0 0 0 0 0 0
NREL Results <<<<<<<<<<<<<<<<<<<<<<<<<<
Station Identification
WBAN#: 26451
City: ANCHORAGE
State: AK
Latitude(deg): N 61.17
Longitude(deg): W150.02
Elevation(m): 35
PV System Specifications
AC Rating(kW): 4.0
Array Type: Fixed Tilt
Array Tilt(deg): 61.1
Array Azimuth(deg): 180.0
Energy Cost(cents/kWh): 12.4
Energy Production
1 0.83 95 11.78
2 2.16 244 30.26
3 3.77 469 58.16
4 4.35 506 62.74
5 4.88 569 70.56
6 4.74 511 63.36
7 4.51 495 61.38
8 3.78 417 51.71
9 3.28 361 44.76
10 1.88 216 26.78
11 1.39 163 20.21
12 0.61 66 8.18
Year 3.02 4112 509.89
1 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0
6 0 0 0 0 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 0 0
8 0 0 0 0 0 1 0 0 0 0 0 0
9 0 0 7 2 7 8 4 1 0 0 0 0
10 0 4 23 15 22 22 16 12 9 3 4 0
11 6 21 40 31 35 34 28 22 21 14 19 2
12 11 33 46 47 48 45 40 35 34 21 26 11
13 19 41 60 56 60 49 49 46 41 27 31 15
14 19 42 57 61 62 56 52 46 45 31 25 15
15 15 37 59 59 64 51 53 46 47 29 21 9
16 6 27 48 54 55 50 50 45 40 26 9 1
17 1 11 27 47 47 47 42 37 33 17 0 0
18 0 1 10 33 35 33 34 29 20 6 0 0
19 0 0 0 15 19 20 22 14 9 0 0 0
20 0 0 0 2 5 8 8 3 0 0 0 0
21 0 0 0 0 0 1 1 0 0 0 0 0
22 0 0 0 0 0 0 0 0 0 0 0 0
23 0 0 0 0 0 0 0 0 0 0 0 0
24 0 0 0 0 0 0 0 0 0 0 0 0
Applications (VBA) so I can use Typical Meteorological Year version 3
(TMY3) data for 1020 reporting stations. Summaries of TMY3 data along
with the ported pvwatts code are intended for use in an Excel
spread-sheet, hence the VBA port.
I choose pvwatts so I verify my code against a known standard before
using the ported functions for my spread-sheet's needs. The ported
code's monthly results seems to match NREL's results given compiler
float point differences, but the ported code's daily results are off?
My questions are:
1) Has anyone done this port before, is this the best results I
can expect given compiler float point differences?
2) Does this look like a porting bug or just float point
differences?
Any help would be appreciated.
Thanks,
Curbie
My Results <<<<<<<<<<<<<<<<<<<<<<<<<<
Station Identification
WBRS#: 26451
City: Anchorage
State: Alaska
Latitude(deg): 61.16667
Longitude(deg): -150.0167
Elevation(m): 35
PV System Specifications
AC Rating(kW): 4
Array Type: Fixed Tilt
Array Tilt(deg): 61.16667
Array Azimuth(deg): 180
Energy Cost(cents/kWh): 0.124
Energy Production
Month Rad. AC kWh
(kwh) (kwh) cost
1 0.83 095 11.78
2 2.16 245 30.38
3 3.74 469 58.16
4 4.31 506 62.74
5 4.82 569 70.56
6 4.68 511 63.36
7 4.45 496 61.50
8 3.75 418 51.83
9 3.25 362 44.89
10 1.88 218 27.03
11 1.39 163 20.21
12 0.61 066 08.18
----------------------------
Yearly 2.99 4111 509.76
1 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0
6 0 0 0 0 0 1 1 0 0 0 0 0
7 0 0 0 0 1 1 1 1 0 0 0 0
8 0 0 1 1 1 1 1 1 0 0 0 0
9 0 1 8 3 8 9 5 2 1 1 1 0
10 1 5 23 15 22 23 16 13 10 4 4 1
11 6 22 40 31 36 35 28 22 21 14 19 2
12 11 34 47 47 49 45 41 35 35 22 27 12
13 20 42 60 56 61 50 49 46 42 28 31 16
14 19 42 57 62 62 56 53 47 46 32 26 15
15 16 38 60 60 65 52 54 47 48 29 22 9
16 7 28 48 54 55 50 50 46 41 27 10 2
17 1 12 28 48 47 47 43 37 34 17 1 0
18 0 1 11 33 35 33 35 29 21 7 0 0
19 0 0 1 16 20 21 23 15 10 1 0 0
20 0 0 0 3 5 8 8 3 1 0 0 0
21 0 0 0 1 1 2 1 1 1 0 0 0
22 0 0 0 0 1 1 1 1 0 0 0 0
23 0 0 0 0 0 1 1 0 0 0 0 0
24 0 0 0 0 0 0 0 0 0 0 0 0
NREL Results <<<<<<<<<<<<<<<<<<<<<<<<<<
Station Identification
WBAN#: 26451
City: ANCHORAGE
State: AK
Latitude(deg): N 61.17
Longitude(deg): W150.02
Elevation(m): 35
PV System Specifications
AC Rating(kW): 4.0
Array Type: Fixed Tilt
Array Tilt(deg): 61.1
Array Azimuth(deg): 180.0
Energy Cost(cents/kWh): 12.4
Energy Production
1 0.83 95 11.78
2 2.16 244 30.26
3 3.77 469 58.16
4 4.35 506 62.74
5 4.88 569 70.56
6 4.74 511 63.36
7 4.51 495 61.38
8 3.78 417 51.71
9 3.28 361 44.76
10 1.88 216 26.78
11 1.39 163 20.21
12 0.61 66 8.18
Year 3.02 4112 509.89
1 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0
6 0 0 0 0 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 0 0
8 0 0 0 0 0 1 0 0 0 0 0 0
9 0 0 7 2 7 8 4 1 0 0 0 0
10 0 4 23 15 22 22 16 12 9 3 4 0
11 6 21 40 31 35 34 28 22 21 14 19 2
12 11 33 46 47 48 45 40 35 34 21 26 11
13 19 41 60 56 60 49 49 46 41 27 31 15
14 19 42 57 61 62 56 52 46 45 31 25 15
15 15 37 59 59 64 51 53 46 47 29 21 9
16 6 27 48 54 55 50 50 45 40 26 9 1
17 1 11 27 47 47 47 42 37 33 17 0 0
18 0 1 10 33 35 33 34 29 20 6 0 0
19 0 0 0 15 19 20 22 14 9 0 0 0
20 0 0 0 2 5 8 8 3 0 0 0 0
21 0 0 0 0 0 1 1 0 0 0 0 0
22 0 0 0 0 0 0 0 0 0 0 0 0
23 0 0 0 0 0 0 0 0 0 0 0 0
24 0 0 0 0 0 0 0 0 0 0 0 0