Post Reply 
Display code and multiple quote test
06-28-2019, 06:19 PM
Post: #1
Display code and multiple quote test
# insert formatted code
Uses Courier New 10 pt font and Segoe UI Emoji 10 pt font.

Code:
EXPORT eqnlib()
BEGIN
// March-April 2015 EWS
// Equation Library Similar to HP 48 series
// Varaibles A-Z & θ are global

// Initialization
LOCAL ch,d;
STARTAPP("Solve");

// Choose
// Main Menu
CHOOSE(ch,"Equation Library",
{"Geometry","Finance","Temperature",
"Physics-Motion",
"Sound","Optics",
"Electronics","Astronomy",
"Great Circle",
"Angle of Incedence",
"Gases","Fluids"});

IF ch==0 THEN KILL; END;

// 1 Geometry Loop
IF ch==1 THEN

CHOOSE(d,"Geometry",{"Area: Circle",
"Area: Ellipse",
"Area: Trapezoid",
"Volume: Sphere",
"Volume: Cylinder",
"Volume: Cone",
"Surface Area: Sphere",
"Surface Area: Cylinder",
"Distance of 2 Points",
"Regular Polygon: Σ Angles",
"Area: Regular Polygon"});

IF d==0 THEN KILL; END;

// 1.1 Area: Circle
IF d==1 THEN
"A=π*R^2"▶E1;
PRINT();
PRINT("A = Area");
PRINT("R = Radius");
END;

// 1.2 Area: Ellipse
IF d==2 THEN
"A=π*R*S"▶E1;
PRINT();
PRINT("A = Area");
PRINT("R = Semi Axis Length 1");
PRINT("S = Semi Axis Length 2");
END;

// 1.3 Area: Trapezoid
IF d==3 THEN
"A=H/2*(R+S)"▶E1;
PRINT();
PRINT("A = Area");
PRINT("H = Height");
PRINT("R = Top Side Length");
PRINT("S = Bottom Side Length");
END;

// 1.4 Volume: Sphere
IF d==4 THEN
"V=4/3*π*R^3"▶E1;
PRINT();
PRINT("V = Volume");
PRINT("R = Radius");
END;

// 1.5 Volume: Cylinder
IF d==5 THEN
"V=π*R^2*H"▶E1;
PRINT();
PRINT("V = Volume");
PRINT("R = Radius");
PRINT("H = Height");
END;

// 1.6 Volume: Cone
IF d==6 THEN
"V=π/3*R^2*H"▶E1;
PRINT();
PRINT("V = Volume");
PRINT("R = Radius");
PRINT("H = Height");
END;

// 1.7 Surface Area: Sphere
IF d==7 THEN
"S=4*π*R^2"▶E1;
PRINT();
PRINT("S = Surface Area");
PRINT("R = Radius");
END;

// 1.8 Surface Area: Cylinder
IF d==8 THEN
"S=2*π*R*(H+R)"▶E1;
PRINT();
PRINT("S = Surface Area");
PRINT("R = Radius");
PRINT("H = Height");
END; 

// 1.9 Distance Between 2 Points
IF d==9 THEN
"D=√((X-A)^2+(Y-B)^2)"▶E1;
PRINT();
PRINT("D = Distance");
PRINT("(X,Y): Point 1");
PRINT("(A,B): Point 2");
END;

// 1.10 Regular Polygon: Σ Angles
IF d==10 THEN
"T=180*N-360"▶E1;
PRINT();
PRINT("T = Total of Interior Angles");
PRINT("N = Number of Sides");
END; 

// 1.11 Area: Regular Polygon
IF d==11 THEN
"A=N*S^2/4*COT(180°/N)"▶E1;
PRINT();
PRINT("A = Area");
PRINT("N = Number of Sides");
PRINT("S = Length of a Side");
END;

// Close out Geometry Loop
END;

// 2 Finance Loop
IF ch==2 THEN

CHOOSE(d,"Finance",{"Sales Tax",
"Simple Interest",
"Payment: Monthly Loan",
"Gross Up Payment",
"Breakeven-Profit"});

IF d==0 THEN KILL; END;

// 2.1 Sales Tax
IF d==1 THEN
"P=G*(1+0.01*S)"▶E1;
PRINT();
PRINT("P = Total Price");
PRINT("G = Gross Price");
PRINT("S = Sale Tax Rate");
END;

// 2.2 Simple Interest
IF d==2 THEN
"F=P*(1+0.01*I)^N"▶E1;
PRINT();
PRINT("F = Future Value");
PRINT("P = Present Value");
PRINT("I = Interest Rate");
PRINT("N = Number of Periods");
END;

// 2.3 Monthly Loan
IF d==3 THEN
"L*I/1200=P*(1-(1+I/1200)^(−12*N))"▶E1;
PRINT();
PRINT("L = Loan Amount");
PRINT("I = Annual Interest Rate");
PRINT("P = Monthly Payment");
PRINT("N = Number of Years");
END;

// 2.4 Gross Up Payment
IF d==4 THEN
"G=N/(1-0.01*R)"▶E1;
PRINT();
PRINT("G = Gross Amount");
PRINT("N = Net Amount");
PRINT("R = Tax Rate");
END;

// 2.5 Breakeven-Point
IF d==5 THEN
"I=Q*(P-V)-F"▶E1;
PRINT();
PRINT("I = Net Income");
PRINT("Q = Quantity");
PRINT("P = Sale Price");
PRINT("V = Variable Cost");
PRINT("F = Fixed Cost");
END;

// Close out Finance Loop
END;





// 3 Temperature Conversion
IF ch==3 THEN
"F=9/5*C+32"▶E1;
PRINT();
PRINT("F = Temp. °F");
PRINT("C = Temp. °C");
END;


// 4 Physics-Motion Loop
IF ch==4 THEN

CHOOSE(d,"Motion",{"Linear Distance",
"Circular Motion/Velocity",
"Circular Motion/Angular Motion",
"Simple Pendulum",
"Terminal Velocity: Ball",
"Escape Velocity"});

IF d==0 THEN KILL; END;

// 4.1 Linear Distance
IF d==1 THEN 
"D=V*T+A*T^2/2"▶E1;
PRINT();
PRINT("D = Distance");
PRINT("V = Velocity");
PRINT("A = Acceleration");
PRINT("T = Time");
END;

// 4.2 Circular w/Velocity
IF d==2 THEN
"T=2*π*R/V"▶E1;
PRINT();
PRINT("T = Period");
PRINT("R = Radius");
PRINT("V = Velocity");
END;

// 4.3 Circular w/Angular Velocity
IF d==3 THEN
"T=2*π/W"▶E1;
PRINT();
PRINT("T = Period");
PRINT("W = Angular Velocity");
END;

// 4.4 Simple Pendulum
IF d==4 THEN
"T=2*π*√(L/9.80665)"▶E1;
PRINT();
PRINT("T = Period (s)");
PRINT("L = Length (m)");
PRINT("g = 9.80665 m/s^2");
END;

// 4.5 Terminal Velocity
IF d==5 THEN
"V=√((132832.070015*M)/(P*R^2))"▶E1;
PRINT();
PRINT("M = Mass (kg)");
PRINT("P = Density (kg/m^3)");
PRINT("R = Radius of ball (cm)");
PRINT("Cd = 0.47, g = 9.80665 m/s^2"); 
END;

// 4.6 Escape Velocity
IF d==6 THEN
"V=√(1.334768ᴇ−10*M/R)"▶E1;
PRINT();
PRINT("M = Mass of Planet (kg)");
PRINT("R = Radius of Planet (kg)");
PRINT("G = 6.67384ᴇ−11 m^3/(s^2*kg)");
END;

// End Motion Loop
END;


// 5 Sound
IF ch==5 THEN

CHOOSE(d,"Sound",{"Doppler Effect",
"Loudness","Speed: Sound (Dry Air)"});

//IF d==0 THEN KILL; END;

// 5.1 Doppler Effect
IF d==1 THEN
"F=O*(1+(R-S)/299792458)"▶E1;
PRINT();
PRINT("F = Observed Frequency (Hz)");
PRINT("O = Emitted Frequency (Hz)");
PRINT("R = Velocity: Receiver (m/s)");
PRINT("S = Velocity: Source (m/s)");
PRINT("c = 299792458 m/s");
END;

// 5.2 Loudness
IF d==2 THEN
"B=10*LOG(I/O)"▶E1;
PRINT();
PRINT("B = Relative Loudness (dB)");
PRINT("I = Sound Intensity");
PRINT("O = Hearing Threshold");
END;

// 5.3 Speed of Sound (Dry Air)
IF d==3 THEN
"V=331.4+.06*T"▶E1;
PRINT();
PRINT("V = Speed of Sound (m/s)");
PRINT("T = Temperature (°C)");
END;

// End Sound Loop
END;

// 6 Optics Loop
IF ch==6 THEN

CHOOSE(d,"Optics",{"Snell's Law",
"Spherical Refraction","Lens Equation"});

IF d==0 THEN KILL; END;

// 6.1 Snell's Law
IF d==1 THEN
"N*SIN(θ)=M*SIN(A)"▶E1;
PRINT();
PRINT("N,M: Index of Refraction");
PRINT("θ = Angle of Incidence");
PRINT("A = Angle of Refraction");
END;

// 6.2 Spherical Refraction
IF d==2 THEN
"N/U+M/V=(N+M)/R"▶E1;
PRINT();
PRINT("N,M: Index of Refraction");
PRINT("U = Distance to Object");
PRINT("V = Distance to Image");
PRINT("R = Curvature of Radius");
END;

// 6.3 Lens Equation
IF d==3 THEN
"1/F=1/O+1/I"▶E1;
PRINT();
PRINT("F = Focal Distance");
PRINT("O = Object Distance");
PRINT("I = Image Distance");
END;

// End Optics Loop
END;


// 7.  Electronics Loop
IF ch==7 THEN

CHOOSE(d,"Electronics",{"Ohm's Law",
"2 Resistors: Series",
"2 Resistors: Parallel",
"Thermal Noise: Voltage"});

// 7.1 Ohm's Law
IF d==1 THEN
"I=V/R"▶E1;
PRINT();
PRINT("I = Current (amps)");
PRINT("V = Voltage (C)");
PRINT("R = Resistance (Ω)");
END;

// 7.2 2 Resistors: Series
IF d==2 THEN
"R=A+B"▶E1;
PRINT();
PRINT("R = Total Resistance (Ω)");
PRINT("A, B: Resistance of A, B");
END;

// 7.3 2 Resistors: Parallel
IF d==2 THEN
"R=(A*B)/(A+B)"▶E1;
PRINT();
PRINT("R = Total Resistance (Ω)");
PRINT("A, B: Resistance of A, B");
END;

// 7.4 Thermal Noise: Voltage
IF d==4 THEN
"V=√(T*R*B*5.5225952ᴇ−23)"▶E1;
PRINT();
PRINT("V = Voltage (V)");
PRINT("T = Temperature (K)");
PRINT("R = Resistance (Ω)");
PRINT("B = Bandwidth (Hz)");
PRINT("k = 1.3806488e-23");
END;


END;


// Astronomy Loop
IF ch==8 THEN

CHOOSE(d,"Astronomy",{"Parallax",
"Star Luminosity","Kepler's 3rd Law",
"Time Dilation"});

IF d==0 THEN KILL; END;

// 8.1  Parallax
IF d==1 THEN
"D=1/TAN(P)"▶E1;
PRINT();
PRINT("D = Distance (AU)");
PRINT("P = Parallax Angle");
END;

// 8.2 Star Luminosity
IF d==2 THEN
"F=L/(4*π*D^2)"▶E1;
PRINT();
PRINT("F = Flux Density: Surface");
PRINT("L = Star's Luminosity");
PRINT("D = Distance");
END;

// 8.3 Kepler's 3rd Law
IF d==3 THEN
"P^2=(4*π^2*R^3)/(6.67384ᴇ−11*(M+N))"▶E1;
PRINT();
PRINT("P = Orbit (s)");
PRINT("R = Radius (m)");
PRINT("M, N = Planet Mass (kg)");
PRINT("G = 6.67384e−11 m^3/(s^2*kg)");
END;

// 8.4 Time Dilation
IF d==4 THEN
"O=T/√(1-(V/299792458)^2)"▶E1;
PRINT();
PRINT("O = Observer Time");
PRINT("T = Traveler Time");
PRINT("V = Velocity (m/s)");
PRINT("c = 299792458 m/s^2");
END;

// End Astronomy Loop
END;


// 9 Great Circle
IF ch==9 THEN
"S=111.201783973*ACOS(SIN(A)*SIN(C)+
COS(A)*COS(C)*COS(B-D))"▶E1;
PRINT();
PRINT("S = Great Circle Dist. (km)");
PRINT("Latitude 1: A");
PRINT("Longitude 1: B");
PRINT("Latitude 2: C");
PRINT("Longitude 2: D");
END;

// 10 Angle of Incidence
IF ch==10 THEN
"COS(θ)=COS(C)*SIN(A)+COS(A)*SIN(C)*
COS(B-D)"▶E1;
PRINT();
PRINT("θ = Angle of Incidence");
PRINT("A = Elevation: Sun");
PRINT("B = Azimuth (S>E): Sun");
PRINT("C = Elevation: Panel");
PRINT("D = Azimuth (S>E): Panel");
END;

// 11 Gases Loop
IF ch==11 THEN

CHOOSE(d, "Gases",
{"Ideal Gas Law","Boyle's Law",
"Heat Capacity",
"Air Density",
"Isothermal Expansion"});

IF d==0 THEN KILL; END; 

// 11.1 Ideal Gas Law
IF d==1 THEN
"P*V=N*8.3144621*T"▶E1;
PRINT();
PRINT("P = Pressure (Pa)");
PRINT("V = Volume (m^3)");
PRINT("N = Number of Moles");
PRINT("T = Temperature (K)");
PRINT("R = 8.3144621 J/(mol*K)");
END;

// 11.2 Boyle's Law
IF d==2 THEN
"P*V=Q*W"▶E1;
PRINT();
PRINT("P,Q:  Pressure 1,2");
PRINT("V,W:  Velocity 1,2");
END;

// 11.3 Heat Capacity
IF d==3 THEN
"C=Q/T"▶E1;
PRINT();
PRINT("Q = Heat Change (J/mol)");
PRINT("C = Heat Capacity (J/(mol*K))");
PRINT("T = Temperature (K)");
END;

// 11.4 Air Density
IF d==4 THEN
"D=352.9774/T"▶E1;
PRINT();
PRINT("D = Air Density (kg/m^3)");
PRINT("T = Temperature (K)");
PRINT("R_spec = 287.085 J/(kg*K)");
PRINT("Abs. Pressure = 101325 Pa"); 
END;

// 11.5 Isothermal Expansion
IF d==5 THEN
"W=N*8.3144621*T*LN(V/I)"▶E1;
PRINT();
PRINT("W = Work");
PRINT("N = Number of Moles");
PRINT("T = Temperature (K)");
PRINT("V = Final Volume");
PRINT("I = Initial Volume");
PRINT("R = 8.3144621 J/(mol*K)");
END;

// End Gases Loop
END;

// 12 Fluids Loop
IF ch==12 THEN

CHOOSE(d,"Fluids",{"Pressure at Depth",
"Bernoulli's Equation","Fluid Flow"});

IF d==0 THEN KILL; END;

// 12.1 Pressure at Depth
IF d==1 THEN
"P=R+D*H*9.80665"▶E1;
PRINT();
PRINT("P = Pressure (Pa)");
PRINT("R = Reference Pressure (Pa)");
PRINT("H = Depth (m)");
PRINT("D = Density (kg/m^3)");
PRINT("g = 9.80665 m/s^2");
END;

// 12.2 Bernoulli's Equation
IF d==2 THEN
"P+R*(V^2/2+9.80665*H)=
Q+R*(W^2/2+9.80665*I)"▶E1;
PRINT("P,Q: Pressure 1,2 (Pa)");
PRINT("V,W: Velocity 1,2 (m/s^2)");
PRINT("H,I: Height 1,2 (m)");
PRINT("R = Water Pressure (kg/m^3)");
PRINT("g = 9.80665 m/s^2");
END;

// 12.3 Fluid Flow
IF d==3 THEN
"A*V=B*W"▶E1;
PRINT();
PRINT("A,B: Area 1,2");
PRINT("V,W: Velocity 1,2");
END;

// End Fluids Loop
END;

// Display Solver
CHECK(1);
STARTVIEW(2,1);
END;

Insert formatted PHP code.
Uses Courier New 10 pt font and Segoe UI Emoji 10 pt font.

PHP Code:
EXPORT eqnlib()
BEGIN
// March-April 2015 EWS
// Equation Library Similar to HP 48 series
// Varaibles A-Z & θ are global

// Initialization
LOCAL ch,d;
STARTAPP("Solve");

// Choose
// Main Menu
CHOOSE(ch,"Equation Library",
{
"Geometry","Finance","Temperature",
"Physics-Motion",
"Sound","Optics",
"Electronics","Astronomy",
"Great Circle",
"Angle of Incedence",
"Gases","Fluids"});

IF 
ch==0 THEN KILLEND;

// 1 Geometry Loop
IF ch==1 THEN

CHOOSE
(d,"Geometry",{"Area: Circle",
"Area: Ellipse",
"Area: Trapezoid",
"Volume: Sphere",
"Volume: Cylinder",
"Volume: Cone",
"Surface Area: Sphere",
"Surface Area: Cylinder",
"Distance of 2 Points",
"Regular Polygon: Σ Angles",
"Area: Regular Polygon"});

IF 
d==0 THEN KILLEND;

// 1.1 Area: Circle
IF d==1 THEN
"A=π*R^2"▶E1;
PRINT();
PRINT(
"A = Area");
PRINT(
"R = Radius");
END;

// 1.2 Area: Ellipse
IF d==2 THEN
"A=π*R*S"▶E1;
PRINT();
PRINT(
"A = Area");
PRINT(
"R = Semi Axis Length 1");
PRINT(
"S = Semi Axis Length 2");
END;

// 1.3 Area: Trapezoid
IF d==3 THEN
"A=H/2*(R+S)"▶E1;
PRINT();
PRINT(
"A = Area");
PRINT(
"H = Height");
PRINT(
"R = Top Side Length");
PRINT(
"S = Bottom Side Length");
END;

// 1.4 Volume: Sphere
IF d==4 THEN
"V=4/3*π*R^3"▶E1;
PRINT();
PRINT(
"V = Volume");
PRINT(
"R = Radius");
END;

// 1.5 Volume: Cylinder
IF d==5 THEN
"V=π*R^2*H"▶E1;
PRINT();
PRINT(
"V = Volume");
PRINT(
"R = Radius");
PRINT(
"H = Height");
END;

// 1.6 Volume: Cone
IF d==6 THEN
"V=π/3*R^2*H"▶E1;
PRINT();
PRINT(
"V = Volume");
PRINT(
"R = Radius");
PRINT(
"H = Height");
END;

// 1.7 Surface Area: Sphere
IF d==7 THEN
"S=4*π*R^2"▶E1;
PRINT();
PRINT(
"S = Surface Area");
PRINT(
"R = Radius");
END;

// 1.8 Surface Area: Cylinder
IF d==8 THEN
"S=2*π*R*(H+R)"▶E1;
PRINT();
PRINT(
"S = Surface Area");
PRINT(
"R = Radius");
PRINT(
"H = Height");
END

// 1.9 Distance Between 2 Points
IF d==9 THEN
"D=√((X-A)^2+(Y-B)^2)"▶E1;
PRINT();
PRINT(
"D = Distance");
PRINT(
"(X,Y): Point 1");
PRINT(
"(A,B): Point 2");
END;

// 1.10 Regular Polygon: Σ Angles
IF d==10 THEN
"T=180*N-360"▶E1;
PRINT();
PRINT(
"T = Total of Interior Angles");
PRINT(
"N = Number of Sides");
END

// 1.11 Area: Regular Polygon
IF d==11 THEN
"A=N*S^2/4*COT(180°/N)"▶E1;
PRINT();
PRINT(
"A = Area");
PRINT(
"N = Number of Sides");
PRINT(
"S = Length of a Side");
END;

// Close out Geometry Loop
END;

// 2 Finance Loop
IF ch==2 THEN

CHOOSE
(d,"Finance",{"Sales Tax",
"Simple Interest",
"Payment: Monthly Loan",
"Gross Up Payment",
"Breakeven-Profit"});

IF 
d==0 THEN KILLEND;

// 2.1 Sales Tax
IF d==1 THEN
"P=G*(1+0.01*S)"▶E1;
PRINT();
PRINT(
"P = Total Price");
PRINT(
"G = Gross Price");
PRINT(
"S = Sale Tax Rate");
END;

// 2.2 Simple Interest
IF d==2 THEN
"F=P*(1+0.01*I)^N"▶E1;
PRINT();
PRINT(
"F = Future Value");
PRINT(
"P = Present Value");
PRINT(
"I = Interest Rate");
PRINT(
"N = Number of Periods");
END;

// 2.3 Monthly Loan
IF d==3 THEN
"L*I/1200=P*(1-(1+I/1200)^(−12*N))"▶E1;
PRINT();
PRINT(
"L = Loan Amount");
PRINT(
"I = Annual Interest Rate");
PRINT(
"P = Monthly Payment");
PRINT(
"N = Number of Years");
END;

// 2.4 Gross Up Payment
IF d==4 THEN
"G=N/(1-0.01*R)"▶E1;
PRINT();
PRINT(
"G = Gross Amount");
PRINT(
"N = Net Amount");
PRINT(
"R = Tax Rate");
END;

// 2.5 Breakeven-Point
IF d==5 THEN
"I=Q*(P-V)-F"▶E1;
PRINT();
PRINT(
"I = Net Income");
PRINT(
"Q = Quantity");
PRINT(
"P = Sale Price");
PRINT(
"V = Variable Cost");
PRINT(
"F = Fixed Cost");
END;

// Close out Finance Loop
END;





// 3 Temperature Conversion
IF ch==3 THEN
"F=9/5*C+32"▶E1;
PRINT();
PRINT(
"F = Temp. °F");
PRINT(
"C = Temp. °C");
END;


// 4 Physics-Motion Loop
IF ch==4 THEN

CHOOSE
(d,"Motion",{"Linear Distance",
"Circular Motion/Velocity",
"Circular Motion/Angular Motion",
"Simple Pendulum",
"Terminal Velocity: Ball",
"Escape Velocity"});

IF 
d==0 THEN KILLEND;

// 4.1 Linear Distance
IF d==1 THEN 
"D=V*T+A*T^2/2"▶E1;
PRINT();
PRINT(
"D = Distance");
PRINT(
"V = Velocity");
PRINT(
"A = Acceleration");
PRINT(
"T = Time");
END;

// 4.2 Circular w/Velocity
IF d==2 THEN
"T=2*π*R/V"▶E1;
PRINT();
PRINT(
"T = Period");
PRINT(
"R = Radius");
PRINT(
"V = Velocity");
END;

// 4.3 Circular w/Angular Velocity
IF d==3 THEN
"T=2*π/W"▶E1;
PRINT();
PRINT(
"T = Period");
PRINT(
"W = Angular Velocity");
END;

// 4.4 Simple Pendulum
IF d==4 THEN
"T=2*π*√(L/9.80665)"▶E1;
PRINT();
PRINT(
"T = Period (s)");
PRINT(
"L = Length (m)");
PRINT(
"g = 9.80665 m/s^2");
END;

// 4.5 Terminal Velocity
IF d==5 THEN
"V=√((132832.070015*M)/(P*R^2))"▶E1;
PRINT();
PRINT(
"M = Mass (kg)");
PRINT(
"P = Density (kg/m^3)");
PRINT(
"R = Radius of ball (cm)");
PRINT(
"Cd = 0.47, g = 9.80665 m/s^2"); 
END;

// 4.6 Escape Velocity
IF d==6 THEN
"V=√(1.334768ᴇ−10*M/R)"▶E1;
PRINT();
PRINT(
"M = Mass of Planet (kg)");
PRINT(
"R = Radius of Planet (kg)");
PRINT(
"G = 6.67384ᴇ−11 m^3/(s^2*kg)");
END;

// End Motion Loop
END;


// 5 Sound
IF ch==5 THEN

CHOOSE
(d,"Sound",{"Doppler Effect",
"Loudness","Speed: Sound (Dry Air)"});

//IF d==0 THEN KILL; END;

// 5.1 Doppler Effect
IF d==1 THEN
"F=O*(1+(R-S)/299792458)"▶E1;
PRINT();
PRINT(
"F = Observed Frequency (Hz)");
PRINT(
"O = Emitted Frequency (Hz)");
PRINT(
"R = Velocity: Receiver (m/s)");
PRINT(
"S = Velocity: Source (m/s)");
PRINT(
"c = 299792458 m/s");
END;

// 5.2 Loudness
IF d==2 THEN
"B=10*LOG(I/O)"▶E1;
PRINT();
PRINT(
"B = Relative Loudness (dB)");
PRINT(
"I = Sound Intensity");
PRINT(
"O = Hearing Threshold");
END;

// 5.3 Speed of Sound (Dry Air)
IF d==3 THEN
"V=331.4+.06*T"▶E1;
PRINT();
PRINT(
"V = Speed of Sound (m/s)");
PRINT(
"T = Temperature (°C)");
END;

// End Sound Loop
END;

// 6 Optics Loop
IF ch==6 THEN

CHOOSE
(d,"Optics",{"Snell's Law",
"Spherical Refraction","Lens Equation"});

IF 
d==0 THEN KILLEND;

// 6.1 Snell's Law
IF d==1 THEN
"N*SIN(θ)=M*SIN(A)"▶E1;
PRINT();
PRINT(
"N,M: Index of Refraction");
PRINT(
"θ = Angle of Incidence");
PRINT(
"A = Angle of Refraction");
END;

// 6.2 Spherical Refraction
IF d==2 THEN
"N/U+M/V=(N+M)/R"▶E1;
PRINT();
PRINT(
"N,M: Index of Refraction");
PRINT(
"U = Distance to Object");
PRINT(
"V = Distance to Image");
PRINT(
"R = Curvature of Radius");
END;

// 6.3 Lens Equation
IF d==3 THEN
"1/F=1/O+1/I"▶E1;
PRINT();
PRINT(
"F = Focal Distance");
PRINT(
"O = Object Distance");
PRINT(
"I = Image Distance");
END;

// End Optics Loop
END;


// 7.  Electronics Loop
IF ch==7 THEN

CHOOSE
(d,"Electronics",{"Ohm's Law",
"2 Resistors: Series",
"2 Resistors: Parallel",
"Thermal Noise: Voltage"});

// 7.1 Ohm's Law
IF d==1 THEN
"I=V/R"▶E1;
PRINT();
PRINT(
"I = Current (amps)");
PRINT(
"V = Voltage (C)");
PRINT(
"R = Resistance (Ω)");
END;

// 7.2 2 Resistors: Series
IF d==2 THEN
"R=A+B"▶E1;
PRINT();
PRINT(
"R = Total Resistance (Ω)");
PRINT(
"A, B: Resistance of A, B");
END;

// 7.3 2 Resistors: Parallel
IF d==2 THEN
"R=(A*B)/(A+B)"▶E1;
PRINT();
PRINT(
"R = Total Resistance (Ω)");
PRINT(
"A, B: Resistance of A, B");
END;

// 7.4 Thermal Noise: Voltage
IF d==4 THEN
"V=√(T*R*B*5.5225952ᴇ−23)"▶E1;
PRINT();
PRINT(
"V = Voltage (V)");
PRINT(
"T = Temperature (K)");
PRINT(
"R = Resistance (Ω)");
PRINT(
"B = Bandwidth (Hz)");
PRINT(
"k = 1.3806488e-23");
END;


END;


// Astronomy Loop
IF ch==8 THEN

CHOOSE
(d,"Astronomy",{"Parallax",
"Star Luminosity","Kepler's 3rd Law",
"Time Dilation"});

IF 
d==0 THEN KILLEND;

// 8.1  Parallax
IF d==1 THEN
"D=1/TAN(P)"▶E1;
PRINT();
PRINT(
"D = Distance (AU)");
PRINT(
"P = Parallax Angle");
END;

// 8.2 Star Luminosity
IF d==2 THEN
"F=L/(4*π*D^2)"▶E1;
PRINT();
PRINT(
"F = Flux Density: Surface");
PRINT(
"L = Star's Luminosity");
PRINT(
"D = Distance");
END;

// 8.3 Kepler's 3rd Law
IF d==3 THEN
"P^2=(4*π^2*R^3)/(6.67384ᴇ−11*(M+N))"▶E1;
PRINT();
PRINT(
"P = Orbit (s)");
PRINT(
"R = Radius (m)");
PRINT(
"M, N = Planet Mass (kg)");
PRINT(
"G = 6.67384e−11 m^3/(s^2*kg)");
END;

// 8.4 Time Dilation
IF d==4 THEN
"O=T/√(1-(V/299792458)^2)"▶E1;
PRINT();
PRINT(
"O = Observer Time");
PRINT(
"T = Traveler Time");
PRINT(
"V = Velocity (m/s)");
PRINT(
"c = 299792458 m/s^2");
END;

// End Astronomy Loop
END;


// 9 Great Circle
IF ch==9 THEN
"S=111.201783973*ACOS(SIN(A)*SIN(C)+
COS(A)*COS(C)*COS(B-D))"
▶E1;
PRINT();
PRINT(
"S = Great Circle Dist. (km)");
PRINT(
"Latitude 1: A");
PRINT(
"Longitude 1: B");
PRINT(
"Latitude 2: C");
PRINT(
"Longitude 2: D");
END;

// 10 Angle of Incidence
IF ch==10 THEN
"COS(θ)=COS(C)*SIN(A)+COS(A)*SIN(C)*
COS(B-D)"
▶E1;
PRINT();
PRINT(
"θ = Angle of Incidence");
PRINT(
"A = Elevation: Sun");
PRINT(
"B = Azimuth (S>E): Sun");
PRINT(
"C = Elevation: Panel");
PRINT(
"D = Azimuth (S>E): Panel");
END;

// 11 Gases Loop
IF ch==11 THEN

CHOOSE
(d"Gases",
{
"Ideal Gas Law","Boyle's Law",
"Heat Capacity",
"Air Density",
"Isothermal Expansion"});

IF 
d==0 THEN KILLEND

// 11.1 Ideal Gas Law
IF d==1 THEN
"P*V=N*8.3144621*T"▶E1;
PRINT();
PRINT(
"P = Pressure (Pa)");
PRINT(
"V = Volume (m^3)");
PRINT(
"N = Number of Moles");
PRINT(
"T = Temperature (K)");
PRINT(
"R = 8.3144621 J/(mol*K)");
END;

// 11.2 Boyle's Law
IF d==2 THEN
"P*V=Q*W"▶E1;
PRINT();
PRINT(
"P,Q:  Pressure 1,2");
PRINT(
"V,W:  Velocity 1,2");
END;

// 11.3 Heat Capacity
IF d==3 THEN
"C=Q/T"▶E1;
PRINT();
PRINT(
"Q = Heat Change (J/mol)");
PRINT(
"C = Heat Capacity (J/(mol*K))");
PRINT(
"T = Temperature (K)");
END;

// 11.4 Air Density
IF d==4 THEN
"D=352.9774/T"▶E1;
PRINT();
PRINT(
"D = Air Density (kg/m^3)");
PRINT(
"T = Temperature (K)");
PRINT(
"R_spec = 287.085 J/(kg*K)");
PRINT(
"Abs. Pressure = 101325 Pa"); 
END;

// 11.5 Isothermal Expansion
IF d==5 THEN
"W=N*8.3144621*T*LN(V/I)"▶E1;
PRINT();
PRINT(
"W = Work");
PRINT(
"N = Number of Moles");
PRINT(
"T = Temperature (K)");
PRINT(
"V = Final Volume");
PRINT(
"I = Initial Volume");
PRINT(
"R = 8.3144621 J/(mol*K)");
END;

// End Gases Loop
END;

// 12 Fluids Loop
IF ch==12 THEN

CHOOSE
(d,"Fluids",{"Pressure at Depth",
"Bernoulli's Equation","Fluid Flow"});

IF 
d==0 THEN KILLEND;

// 12.1 Pressure at Depth
IF d==1 THEN
"P=R+D*H*9.80665"▶E1;
PRINT();
PRINT(
"P = Pressure (Pa)");
PRINT(
"R = Reference Pressure (Pa)");
PRINT(
"H = Depth (m)");
PRINT(
"D = Density (kg/m^3)");
PRINT(
"g = 9.80665 m/s^2");
END;

// 12.2 Bernoulli's Equation
IF d==2 THEN
"P+R*(V^2/2+9.80665*H)=
Q+R*(W^2/2+9.80665*I)"
▶E1;
PRINT(
"P,Q: Pressure 1,2 (Pa)");
PRINT(
"V,W: Velocity 1,2 (m/s^2)");
PRINT(
"H,I: Height 1,2 (m)");
PRINT(
"R = Water Pressure (kg/m^3)");
PRINT(
"g = 9.80665 m/s^2");
END;

// 12.3 Fluid Flow
IF d==3 THEN
"A*V=B*W"▶E1;
PRINT();
PRINT(
"A,B: Area 1,2");
PRINT(
"V,W: Velocity 1,2");
END;

// End Fluids Loop
END;

// Display Solver
CHECK(1);
STARTVIEW(2,1);
END
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 2 Guest(s)