Getting zenith angle with pv.solarposition.spa_python - pvlib

I'm trying to get the zenith angle with: pv.solarposition.spa_python(date_range, latitude, longitude) but some of the angles I get are above 90 degrees- why is that?

Zenith angle > 90 means the sun is below the horizon.

Related

How can I create in Stata a time variable for the X axis with 1920 as year(0)?

Time relative to Suffrage law
enter image description here
You don't show what your data look like, but my guess is
gen myyear = year - 1920

SUM of cells based on the value of cells on the right and above

Y3 (Total forecast) = Sum of all actuals for the months that have actuals + Sum of all forecast for the remaining months where there are no actuals yet.
Currently, I am using this formula: Y3
=SUMIF(A2:H2, Z2, A3:H3)+SUMIF(I2:X2, Y2, I3:X3)
It works. But I have to manually update the formula every month when actual costs are in. So I want to set up a formula that dynamically changes the sum when the cell refers to "Actual" is not empty.
I've tried SUM with OFFSET, INDIRECT and ADDRESS. Nothing works for me so far.
use in Y3 cell:
=ARRAYFORMULA(SUM(FILTER(A3:X3, A2:X2="actual"),
INDIRECT(ADDRESS(3, MIN(IF(A3:X3="", COLUMN(A:X)-1, )))&":X3")))
Use this formula:
=IFERROR(SUM(FILTER(A3:X3,{B3:X3,""}<>"",A2:X2=Y2)),0)
and
=IFERROR(SUM(FILTER(A3:X3,A3:X3<>"",A2:X2=Z2)),0)
Update:
=arrayformula(sum(if(A2:X2="Actual",A3:X3,0)+
if(A2:X2="Forecast",if({B3:X3,""}="",A3:X3,0),0)))
This can be change with sumif, but I have not tested it
Another 1:
=arrayformula(sum(A3:X3-if(A2:X2="Forecast",if({B3:X3,""}<>"",A3:X3,0),0)))
Another 2:
=arrayformula(sum(if (A2:X2="forecast",if({B3:X3,0}="",A3:X3,{B3:X3,0}),0)))

GLPK multiple dimension param

How do I use param Distance as following in GLPK? like param Distance {line in Line, dir in Direction , ori in Station , des in Station};?
data;
set Direction := Eastbound Westbound;
set Line := District Piccadilly;
set Station := ACTON_TOWN ALDGATE_EAST ALPERTON ARNOS_GROVE...;
param Distance := # Line Direction StationFrom StationTo Kilometers
District Eastbound ACTON_TOWN CHISWICK_PARK 1.22
District Eastbound ALDGATE_EAST WHITECHAPEL 0.82
District Eastbound BARKING UPNEY 1.38
District Eastbound BARONS_COURT WEST_KENSINGTON 0.64
District Eastbound BAYSWATER PADDINGTON 0.98
District Eastbound BECONTREE DAGENHAM_HEATHWAY 1.37
...
end;
Before the "data" Part you can define the parameter like the following
param Distance {Line, Direction, Station, Station};
And then use it like
var x, >= 0;
minimize obj : sum{line in Line, dir in Direction , ori in Station , des in Station}(x*Distance[line,dir,ori,des]);
But you have one big Problem. With one Station set you will have connection like from and to Acton_Town, so you have to set them to Zero in the data part. Additional there is a problem with this combined distance representation with the direction Eastbound and Westbound - there will be an ACTON_TOWN to CHIPSWICK_PARK in both directions, so you have to handle the value for the unplausible connection in some way (like fixed indexing or high pricing). Same for Stations not on the Line.
You should probably think about a seperate representation of your Stations like
set Station_Piccadilly := ...;
set Station_District := ...;
...
If you want to make some routing you should probably look at the glpk example tsp.mod containing the Traveling Salesman Problem.

MSChart - Show series name on x Axis

I would like the chart shown below to show the series names (700HEN, ORG 700HEN etc.) under each column rotated 90 degrees not as a legend and I want to maintain the date label for each series group (it can be rotated or left horizontal). Is that possible?

mschart how to position y axis label inside column and rotate text 90 degrees

How can the y-axis label be positioned inside a column and rotate text 90 degrees?
Currently, the y-axis label appears above the column.
When the column bar is at the max height and touches the top of the chart area, the y label appears within the column bar.
If you mean data labels, then right-click on the data label and choose "Format Data Labels." You can center the text with LabelOptions/LabelPosition, and you can orient the text with Alignment/TextDirection.
(This is for doing the change manually. Doing it in a program would be similar.)