Hi Robin,
If those matrices are to be multiplied, you have to try dimensions in the order of 2X3*3X2.
Matrix dimensions are No of rows X(by) No of columns.
Try to match No of columns of first matrix with No of rows of the second. The the product will be a matrix of No of Rows of first BY No of columns of second: a 5 BY 7 times matrix CAN be multiplied with a 7 BY 2 and you'll get a 5 BY 2 matrix.
You can also try the dot product by adding a dot in front of the operator as in .*
Hope this helps.
Hello,
Thanks for a great script! My question is whether this will also work to run serial zenith angles for every hour of a day for n days? I am a pretty new Matlab user so my skills are not great yet. To do this will I have to modify the script much? I tried running it once with time.day = 1:5 and time.hour = 0-23 but there is a "matrix dimensions must agree error". Before I go on a hunt to try and resolve it I thought I would check to see if anyone else has done this?
I was thinking about the rigid approach of Reda and Andreas in respect to delta_t, or the difference between UT and TT < http://en.wikipedia.org/wiki/%CE%94T >
I did a error check for the period between 2010 and 2020 by adopting the proposed in SPA's documentation 64.797s and by a fourier expression of delta_t which I derived using data generated by the HORIZON's software at the JPL(UNI PASADENA) < http://ssd.jpl.nasa.gov/horizons.cgi#top >.
The function generated is inherently periodic and describes the the ephemerides data with a high precision ( st.dev = 1.5e-5).
I am currently analyzing the effects of this deviation on SPA's precision and a noticeable improvement can be observed in the e-5 order of magnitude for azimuth and zenith.
The payback of implementing the function is great, compared to the minor increase in computational cost.
After line number 203-204 of the sun_position function implement the following:
*******************************************************************************
% Compute serial date number since 2010-01-01 00:00:00
JD2010 = julian.day - 2455196.5;
% Compute delta_t using fourier expression derived from HORIZON ephemeris
% PRECISION: rmse = 9.811e-006s; std = 1.5e-5s;
delta_t = 66.18 - 0.0001033*cos(JD2010*0.0172) + 0.001654*sin(JD2010*0.0172);
*********************************************************************************