Showing posts with label solar irradiance. Show all posts
Showing posts with label solar irradiance. Show all posts

Sunday, July 2, 2017

Fun with the Casio fx-3650p

Links to previous fx-3650p programs:

5/11/2014:


Contents:
1. Circular Sectors
2. Stopping Sight Distance
3. Resistors in Parallel
4. Net Present Value
5. Rod Pendulum
6. Vectors: Dot and Cross Products


10/27/2015:


Contents for this blog:
1.  Combination with Replacement
2.  Great Circle (Distance in km) 
3.  Orbital Speed and Period 
4.  Eccentricity and Area of an Ellipse
5.  Super Factorial
6.  Escape Velocity 
7.  Finance: Payment of a Monthly Mortgage
8.  Wind Chill Factor
9.  Speed of Sound in Dry Air 

-------

Contents for this blog entry (7/2/2017)

1.  Modulus Function
2.  Normal CDF
3.  Sum:  Σ (AX + B)^C,  from X = 0 to X = Y
4.  Sun Altitude and Azimuth Based on the Vernal Equinox
5.  Trapezoid: Midsegment, Height, and Area
6.  Solar Irradiance
7.  General a list of X Random Integers from 0 to Y

Modulus Function

Calculates A mod B for A > 0 and B > 0.   Since the fx-3650p has no integer or fraction part functions, a loop of repeated subtractions are needed.

Program (25 steps):
? → A : ? → B : Lbl 1 : A – B → A : A ≥ B Goto 1 : A

Examples:
Input:  A = 77, B = 9.  Result: 5
Input:  A = 92.38, B = 2.38.  Result:  1.94 

Normal Distribution CDF

This calculates the area of a normal distribution curve between points A and B, given that mean = 0 and deviation = 1.  Radians mode is set.  The result is stored in C.

Program (34 steps):
? → A : ? → B : Rad : ∫ ( e (-X² ÷ 2 ), A, B → C : C ÷ √ (2 π → C

Note e is the exponential function (e^x).

Examples:
Input:  A = 0, B = 2.  Result:  0.47725066
Input:  A = -1, B = 1.  Result:  0.682709924


Sum:  Σ (AX + B)^C,  from X = 0 to X = Y

Program (51 steps):
? → A : ? → B : ? → C : ? → Y : 0 → X : 0 → M : Lbl 1 : (AX + B)^C M+ : 1 + X → X : Y ≥ X Goto 1: M

Examples:
Input:  A = 2. B = 6, C = 2, Y = 4.  Result:  540
Input:  A = -3, B = 1, C = 3, Y =6.  Result:  -9632

Sun Altitude and Azimuth Based on the Vernal Equinox


Input:
Y =  days after the vernal equinox, usually March 21
A = latitude on Earth (north-south, -90° to 90°)
X = the time before solar noon, local time

For example, for 10 AM (10:00), enter 2.  For 3 PM (15:00), enter -3.  Hence:  12 – time.

Output:
D = approximate declination of the sun (-23.45° to 23.45°)
B = sun’s altitude
C = sun’s azimuth (from ground wise north)

Program (69 steps):
? → Y : ? → A : ? → X : Deg : 23.45 sin(.9856Y → D   sin¯¹ (cos A cos D cos (15X) + sin A sin D → B cos¯¹ ( ( sin B sin A – sin D) ÷ (cos A cos B → C

Examples:

Input:  Y = 90 days, A = 25°, X = -3  (3 PM)
Results: 
D = 23.44400127° = 23°26’38.4”
B = 48.81756385° = 48°49’3.23”
C = 99.85903298° = 99°51’32.52”

Input:  Y = 68 days, A = 46°, X = 4 (8 AM)
Results:
D = 21.58916369° = 21°35’20.99”
B = 35.989914° = 35°59’23.69”
C = 84.40834691° = 84°24’30.05”

Source: Sun Altitude, Azimuth, Solar Pond Absorption, HP 67/97 Energy Conservation December 1978, Author: HP

Trapezoid: Midsegment, Height, and Area


Input:
A = length of top side
B = length of bottom side
C = length of left side
D = length of right side

Output:
X = Midsegment length
Y = Height
M = Area

Program (92 steps):
? → A : ? → B : ? → C : ? → D : .5(A + B → X (-A + B + C + D)(A – B + C + D)(A – B + C – D)(A – B- C- + D) → Y : √Y ÷ ( 2 √( (B – A)² ) → Y (A + B)Y ÷ 2 → M

Example:
Input:  A = 18, B = 16, C = 12, D = 11
Results:  X = 17, Y = 9.921567417, M = 168.6666461

Source:  “Trapezoid”  Wikipedia.  Edited July 7, 2014.  Retrieved July 8, 2014

Solar Irradiance



The program calculates:



1. The solar angle of incidence given the angular elevation and azimuth (from south going “counterclockwise”:  east-north-west) of both the sun and panel.
2. The irradiance given by the solar panel. 


Input:
X = elevation of the sun
A = azimuth of the sun
Y = elevation of the solar panel
Z = azimuth of the solar panel
M = the sun’s power or irradiance.  Often this is treated as a constant, which is approximately 1367 W/m^2 for extraterrestrial solar power, or approximately 1000 W/m^2 when we are dealing with the Earth’s surface (taking scattering of light into account)

Output:
C = incidence angle
D = solar irradiance

Program (46 steps):
? → X : ? → A : ? → Y : ? → B : ? → M : Deg : cos¯¹ ( cos Y sin X + sin Y cos X cos (A – B → C M cos Y → D

Example:
Input:

Sun:
X = 55°24’21”
A = 175°15’44”

Panel:
Y = 40°
B = 90°

Sun’s Irradiance:
M = 1000 W/m

Results:
C = 48.6431686°
D = 766.0444431 W/m

Sources (you might have to copy and past these links)  

Baldocchi, Dennis “Lecture 7, Solar Radiation, Part 3, Earth-Sun Geometry”  Biometeorogy, ESPM 129  University of California, Berkeley.


Retrieved February 17, 2015. 

Mortimer, David  “Lambert’s Cosine Law”  30 January 2014.  The Solar Bucket.


Retrieved March 18, 2015

University of Oregon Solar Radiation Monitoring Laboratory  “Solar Radiation Basics”  University of Oregon.  http://solardat.uoregon.edu/SolarRadiationBasics.html   Retrieved February 10, 2015

General a list of X Random Integers from 0 to Y

This program generates a list of random integers (X) from 0 to upper limit Y.  This program uses the Fix 0 mode and makes use of the Rnd (round the number in the display) command.  Note the integers as they appear.  The program finishes by setting the calculator back in Norm 1 mode.

Program (33 steps):
? → Y : ? → X : 1 → M : Fix 0 : Lbl 1 : Ran# Y : Rnd 1 M+ : X ≥ M Goto 1 : Norm 1

Example:
Generate 5 random integers from 0 to 10.  (Y = 10, X  = 5)
Result:  6, 7, 6, 6, 10 (your results will vary)

Comments

As with the other fx-3650p I and others have posted, they can easily be adapted to the fx-50fH, fx-5800p, fx-6300g, fx-CG50, and (almost) any other Casio programming calculator. 

Recently I learned that Casio updated the fx-3650P and the fx-50F(H) with the fx-3650P II and fx-50F(H) II respectively.  The only difference I was able to spot is that the fx-3650P II now has 390 programming steps instead of 360. http://www.casio-intl.com/asia/en/calc/school/programmable/

And yes, I still wish Casio sold these models in stores in the United States.  Currently, for us U.S. residents, they can only be purchased online. 

Now if Casio made a solar version of the fx-6300g, with more memory.

Eddie


This blog is property of Edward Shore, 2017.

Thursday, April 9, 2015

HP 50g: Bolt Pattern, Solar Irradiance, Thermal Noise, Regular Polygons, Center of Mass (Matrix of Masses)

HP 50g:   Bolt Pattern, Solar Irradiance, Thermal Noise, Regular Polygons,

Center of Mass (Matrix of Masses)



Bolt Pattern: BOLTPAT



Input:
4:  xc:   x coordinate, center
3:  yc:   y coordinate, center
2:  n:  number of bolts
1:  d:  diameter of the circle

Program:
<< DEG OVER 1 – → xc yc n d k
<< { } 0 k FOR I 360 I * n / DUP COS d 2 / * xc +
SWAP SIN d 2 / * yc + (0,1) * + + NEXT
DUPDUP 2 GET SWAP 1 GET – ABS >> >>

Output: 
2:  list of bolts (x+yi)
1:  OC-Distance

Solar Irradiance:  IRRAD


Input:
5:  es:   elevation of the sun (as decimal degrees)
4:  as:   azimuth of the sun from south going east (as decimal degrees)
3:  ep:   elevation of the panel (as decimal degrees)
2:  ap:   azimuth of the panel from south going east (as decimal degrees)
1:  ib:  the sun’s power or irradiance (usually 1,000 or 1,367 W/m^2)

Program:
<< → es as ep ap ib
<< DEG ep COS es SIN * ep SIN es COS * as ap – COS *
+ ACOS DUP COS ib * >> >>

Output:
2:  incidence angle
1:  surface radiance

Thermal Noise:  THNOISE


Input:
3:  R:  resistance (Ω)
2:  T:   temperature (K)
1:  B:   noise bandwidth (Hz)

Program:
<< → R T B
<< T R * B * 4 * 1.3806488E-23 * √
T B * LOG 10 * 198.599167802 -  >> >>

Output:
2:  Voltage (Volts)
1:  Noise Power (dB)

Regular Polygon:  Internal Angle and Area:  RPOLYG


Input:
2:  s:  side length
1:  n:  number of sides


Program: 
<< DEG DUP INV 360 * NEG 180 + UNROT 4 / SWAP SQ * SWAP DUP UNROT 2 / TAN * >>

Output:
2:  Interior Angle
1:  Area

Center of Mass using Matrix:  CENTERMTX


Input:
1:  Matrix of Masses

Program:
<< DUP SIZE OBJ→ DROP → M R C
<< M 1  C START 1 NEXT C →ARRY * AXL ∑LIST

M 1 C FOR I I NEXT C 1 2 →LIST →ARRY * TRAN
1 R START 1 NEXT R 1 2 →LIST →ARRY * OBJ→ DROP

M TRAN 1 R FOR I I NEXT R 1 2 →LIST →ARRY * TRAN
1 C START 1 NEXT C 1 2  →LIST →ARRY * OBJ→ DROP

→ tm rw cw
<< rw tm / cw tm  / {1,2} →ARRY >> >> >>

Output:
[[ x center of mass point,  y center of mass point ]]



Special Note:  April 11 will mark the fourth anniversary of this blog.  I appreciate the readers and followers of this blog and thank you for that, and the comments.  Best always,  Eddie!


This blog is property of Edward Shore.  2015.

Thursday, March 19, 2015

HP Prime and Casio Prizm: Solar Irradiance

Solar Irradiance

The program IRRAD will calculate two properties:

(1)  The solar angle of incidence given the angular elevation and azimuth (from south going “counterclockwise”:  east-north-west) of both the sun and panel.
(2)  The irradiance given by the solar panel. 

Formulas

Angle of Incidence Given Azimuth

Degree mode is assumed, the angle of incidence (θ) is found in the following equation:

cos θ = cos(ep)*sin(es) + sin(ep)*cos(es)*cos(as-ap)

Where:
θ = angle of incidence
es = elevation of the sun
ep = elevation of the panel
as = azimuth of the sun, from south headed towards east, then north, then west

ap = azimuth of the panel, from south headed towards east, then north, then west

Angle of Incidence

Azimuth and Elevation of the Sun and Solar Panel
Calculating Flux Density of Solar Radiation on a Surface

Calculating the flux density (energy) of solar radiation on a surface, Lambert’s Cosine Law is used.  Lambert’s Cosine Law states that the relation between the irradiance of the sun and the angle of incidence. The result is the irradiance of the surface.  Irradiance is the rate of energy (power) over a unit area.  In SI units, irradiance is measured in Watts per square meter (W/m^2).

ls = lb * cos θ

Where:
lb = the sun’s power or irradiance.  Often this is treated as a constant, which is approximately 1367 W/m^2 for extraterrestrial solar power, or approximately 1000 W/m^2 when we are dealing with the Earth’s surface (taking scattering of light into account)
ls = the panel’s power or irradiance


Casio Prizm IRRAD

Deg
“SUN: ELEL, AZI(S)”
?->A:?->B
“PANEL: ELEV, AZI(S)”
?->C:?->D
“IRRADIANCE OF THE SUN”
“(W÷M²)”
cos C * sin A + cos A * sin C * cos(B-D)
cos¹ Ans -> θ
I * cos θ -> S
“INCIDENCE ANGLE”
θ
“IRRADIANCE OF SUN”
S

HP Prime IRRAD

EXPORT IRRAD()
BEGIN
LOCAL es,as,ep,ap,θinc;
LOCAL ib,is;
HAngle:=1;
INPUT({es,as},”Sun”,{“Elev.:”,”Azi (S):”});
INPUT({ep,ap},”Panel”,{“Elev.:”,”Azi (S):”});
INPUT(ib,”Sun’s Irradiance”,”I:”,”W/m^2”);
// angle of incidence
θinc:=ACOS(COS(ep)*SIN(es)+SIN(ep)*COS(es)*COS(as-ap));
MSGBOX(“Incidence Angle = “+θinc);
// Lambert’s Cosine Law
Is:=ib*COS(θinc);
MSGBOX(“Surface Irradiance = “+is);
RETURN {θinc,is};
END;

Example

Data:

Sun: 
Elevation:  55⁰24’21” ≈ 55.40583⁰
Azimuth:  175⁰15’44” ≈ 175.26222⁰

Panel:
Elevation:  40⁰
Azimuth:  90⁰ (panel is facing due east)

Irradiance of the Sun:  1000 W/m^2

Output:
Incidence Angle ≈ 48.643169⁰
Surface Radiance ≈ 660.746510 W/m^2


Sources:

Baldocchi, Dennis “Lecture 7, Solar Radiation, Part 3, Earth-Sun Geometry”  Biometeorogy, ESPM 129  University of California, Berkeley.
Retrieved February 17, 2015. 

Mortimer, David  “Lambert’s Cosine Law”  30 January 2014.  The Solar Bucket.
Retrieved March 18, 2015

University of Oregon Solar Radiation Monitoring Laboratory  “Solar Radiation Basics”  University of Oregon.  http://solardat.uoregon.edu/SolarRadiationBasics.html   Retrieved February 10, 2015



This blog is property of Edward Shore – 2015. 

Earth's Radius by Latitude

Earth's Radius by Latitude Introduction: Calculating the Earth’s Radius In quick, general calculations, we assume that the...