equations: Add missing equations from "Columns and Beams"

Add the missing equations from "Columns and Beams" section of the
HP50G advanced reference manual.

Notice that some of the descriptions are incorrect in the manual, and
that the correct equations had to be fetched from the HP50G itself.

Foe example, the `Simple Moment` example defines `c`, which is not set
in the documented equation. The actual equation contains `IFTE`
expressions, which require the fix for #1093 to work.

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2024-07-31 22:08:05 +02:00
parent 83d6536626
commit a62e4425d0
7 changed files with 210 additions and 5 deletions

View file

@ -64,7 +64,34 @@ These equations apply to a slender column (`K·L/r>100`) with length factor `K`.
### Simple Slope
![Simple Slop](img/SimpleSlope.bmp)
![Simple Slope](img/SimpleSlope.bmp)
### Simple Moment
![Simple Moment](img/SimpleMoment.bmp)
### Simple Shear
![Simple Shear](img/SimpleShear.bmp)
### Cantilever Deflection
![Cantilever Deflection](img/CantileverDeflection.bmp)
### Cantilever Slope
![Cantilever Slope](img/CantileverSlope.bmp)
### Cantilever Moment
![Cantilever Moment](img/CantileverMoment.bmp)
### Cantilever Shear
![Cantilever Shear](img/CantileverShear.bmp)
## Electricity

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View file

@ -5074,7 +5074,34 @@ These equations apply to a slender column (`K·L/r>100`) with length factor `K`.
### Simple Slope
![Simple Slop](img/SimpleSlope.bmp)
![Simple Slope](img/SimpleSlope.bmp)
### Simple Moment
![Simple Moment](img/SimpleMoment.bmp)
### Simple Shear
![Simple Shear](img/SimpleShear.bmp)
### Cantilever Deflection
![Cantilever Deflection](img/CantileverDeflection.bmp)
### Cantilever Slope
![Cantilever Slope](img/CantileverSlope.bmp)
### Cantilever Moment
![Cantilever Moment](img/CantileverMoment.bmp)
### Cantilever Shear
![Cantilever Shear](img/CantileverShear.bmp)
## Electricity

View file

@ -5074,7 +5074,34 @@ These equations apply to a slender column (`K·L/r>100`) with length factor `K`.
### Simple Slope
![Simple Slop](img/SimpleSlope.bmp)
![Simple Slope](img/SimpleSlope.bmp)
### Simple Moment
![Simple Moment](img/SimpleMoment.bmp)
### Simple Shear
![Simple Shear](img/SimpleShear.bmp)
### Cantilever Deflection
![Cantilever Deflection](img/CantileverDeflection.bmp)
### Cantilever Slope
![Cantilever Slope](img/CantileverSlope.bmp)
### Cantilever Moment
![Cantilever Moment](img/CantileverMoment.bmp)
### Cantilever Shear
![Cantilever Shear](img/CantileverShear.bmp)
## Electricity

View file

@ -77,6 +77,31 @@ static const cstring basic_equations[] =
" '(θ_°)=(1_r)*(((P_N)*((L_m)-(a_m)))/(6*L*(E_kPa)*(I_mm^4))*(3*(x_m)²+(L-a)²-L²)-(M_N*m)/(E*I)*(c-(x²-c²)/(2*L)-L/3)-(w_N/m)/(24*E*I)*(L³+x²*(4*x-6*L)))'"
"}",
"Simple Moment", "{"
" '(Mx_N*m)=(P_N)*IFTE((x_m)≤(a_m);((L_m)-(a_m))*(x_m);(L-x)*a)/L+(M_N*m)*IFTE(x≤(c_m);x;x-L)/L+((w_N/m)*x*(L-x))/2'"
"}",
"Simple Shear", "{"
" '(V_N)=((P_N)*((L_m)-(a_m)))/L+(M_N*m)/L+((w_N/m)*(L-2*(x_m)))/2'"
"}",
"Cantilever Deflection", "{"
" '(y_m)=((P_N)*IFTE((x_m)≤(a_m);x;a)²)/(6*(E_kPa)*(I_mm^4))*IFTE(x≤a;x-3*a;a-3*x)+(M_N*m)*IFTE(x≤(c_m);x²;c*(2*x-c))/(2*E*I)-((w_N/m)*x²)/(24*E*I)*(6*L²-4*L*x+x²)'"
"}",
"Cantilever Slope", "{"
" '(θ_°)=(1_r)*((P_N)*IFTE((x_m)≤(a_m);x*(x-2*a);-a²)/(2*(E_kPa)*(I_mm^4))+(M_N*m)*IFTE(x≤(c_m);x;c)/(E*I)-((w_N/m)*x)/(6*E*I)*(3*L²-3*L*x+x²))'"
"}",
"Cantilever Moment", "{"
" '(Mx_N*m)=IFTE((x_m)≤(a_m);1;0)*(P_N)*((x_m)-(a_m))+IFTE(x≤(c_m);1;0)*(M_N*m)-(w_N/m)/2*(L²-2*L*x+x²)'"
"}",
"Cantilever Shear", "{"
" '(V_n)=IFTE((x_m)≤(a_m);1;0)*(P_N)+(w_N/m)*((L_m)-(x_m))'"
"}",
// ------------------------------------------------------------------------
// Physics
// ------------------------------------------------------------------------

View file

@ -113,6 +113,7 @@ TESTS(text, "Text operations");
TESTS(vectors, "Vectors");
TESTS(matrices, "Matrices");
TESTS(solver, "Solver");
TESTS(colnbeams, "Columns and Beams equations in library");
TESTS(integrate, "Numerical integration");
TESTS(simplify, "Auto-simplification of expressions");
TESTS(rewrites, "Equation rewrite engine");
@ -164,7 +165,7 @@ void tests::run(bool onlyCurrent)
if (onlyCurrent)
{
here().begin("Current");
conditionals();
eqnlib_columns_and_beams();
}
else
{
@ -204,6 +205,7 @@ void tests::run(bool onlyCurrent)
vector_functions();
matrix_functions();
solver_testing();
eqnlib_columns_and_beams();
numerical_integration_testing();
text_functions();
auto_simplification();
@ -5096,6 +5098,21 @@ void tests::solver_testing()
.test(LSHIFT, A, LSHIFT, A)
.expect("0.5m");
step("Exit: Clear variables")
.test(CLEAR, "UPDIR 'SLVTST' PURGE", ENTER);
}
void tests::eqnlib_columns_and_beams()
// ----------------------------------------------------------------------------
// Test that the solver works as expected
// ----------------------------------------------------------------------------
{
BEGIN(colnbeams);
step("Enter directory for solving")
.test(CLEAR, "'SLVTST' CRDIR SLVTST", ENTER);
step("Solving Elastic Buckling")
.test(CLEAR, RSHIFT, F, F2, RSHIFT, F1)
.test("53.0967", NOSHIFT, F3)
@ -5139,7 +5156,7 @@ void tests::solver_testing()
.expect("σmax:126924.792984kPa");
step("Solving Eccentric Column second equation")
.test(CLEAR, LSHIFT, F1, LSHIFT, F3)
.expect("I:135259652.161mm↑4.");
.expect("I:135259652.161mm↑4");
step("Solving Simple Deflection")
.test(CLEAR, RSHIFT, F, F2, RSHIFT, F3)
@ -5171,6 +5188,87 @@ void tests::solver_testing()
.test(F6, LSHIFT, F2)
.expect("θ:-0.466652997995°");
step("Solving Simple Moment")
.test(CLEAR, RSHIFT, F, F2, RSHIFT, F5)
.test("20_ft", NOSHIFT, F5)
.test("10_ft", NOSHIFT, F3)
.test("674.427_lbf", NOSHIFT, F6, F2)
.test("17_ft", NOSHIFT, F6, F4)
.test("3687.81_ft*lbf", NOSHIFT, F6, F1)
.test("102.783_lbf/ft", NOSHIFT, F3)
.test("9_ft", NOSHIFT, F4)
.test(F6, LSHIFT, F2)
.expect("Mx:13262.8748772N·m")
.test("1_ft*lbf", NOSHIFT, F2, LSHIFT, F2)
.expect("Mx:9782.1945lbf·ft");
step("Solving Simple Shear")
.test(CLEAR, EXIT, RSHIFT, F, F2, F6, RSHIFT, F1)
.test("20_ft", NOSHIFT, F3)
.test("10_ft", NOSHIFT, F2)
.test("674.427_lbf", NOSHIFT, F5)
.test("3687.81_ft*lbf", NOSHIFT, F4)
.test("102.783_lbf/ft", NOSHIFT, F6, F2)
.test("9_ft", NOSHIFT, F3)
.test(LSHIFT, F1)
.expect("V:2777.41174969N")
.test("1_lbf", F1, LSHIFT, F1)
.expect("V:624.387lbf");
step("Solving Cantilever Deflection")
.test(CLEAR, EXIT, RSHIFT, F, F2, F6, RSHIFT, F2)
.test("10_ft", NOSHIFT, F6, F1)
.test("29000000_psi", NOSHIFT, F6, F6, F4)
.test("15_in^4", NOSHIFT, F5)
.test("500_lbf", NOSHIFT, F6, F3)
.test("800_ft*lbf", NOSHIFT, F2)
.test("3_ft", NOSHIFT, F6, F6, F2)
.test("6_ft", NOSHIFT, F3)
.test("100_lbf/ft", NOSHIFT, F6, F4)
.test("8_ft", NOSHIFT, F5)
.test(F6, LSHIFT, F1)
.expect("y:-0.331630344828in")
.test("1_lbf", F1)
.error("Inconsistent units")
.test(CLEAR, "1_cm", F1, LSHIFT, F1)
.expect("y:-0.842341075862cm");
step("Solving Cantilever Slope")
.test(CLEAR, EXIT, RSHIFT, F, F2, F6, RSHIFT, F3)
.test("10_ft", NOSHIFT, F6, F2)
.test("29000000_psi", LSHIFT, F6, F5)
.test("15_in^4", NOSHIFT, F6, F1)
.test("500_lbf", NOSHIFT, F4)
.test("800_ft*lbf", NOSHIFT, F3)
.test("3_ft", LSHIFT, F6, F3)
.test("6_ft", NOSHIFT, F4)
.test("100_lbf/ft", NOSHIFT, F6, F5)
.test("8_ft", NOSHIFT, F6, F1)
.test(F6, LSHIFT, F2)
.expect("θ:-0.265220187649°");
step("Solving Cantilever Moment")
.test(CLEAR, EXIT, RSHIFT, F, F2, F6, RSHIFT, F4)
.test("10_ft", NOSHIFT, F5)
.test("500_lbf", NOSHIFT, F6, F2)
.test("800_ft*lbf", NOSHIFT, F1)
.test("3_ft", LSHIFT, F6, F3)
.test("6_ft", NOSHIFT, F4)
.test("100_lbf/ft", NOSHIFT, F6, F3)
.test("8_ft", NOSHIFT, F4)
.test(F6, LSHIFT, F2)
.expect("Mx:-200.lbf·ft");
step("Solving Cantilever Shear")
.test(CLEAR, EXIT, RSHIFT, F, F2, F6, RSHIFT, F5)
.test("10_ft", NOSHIFT, F3)
.test("500_lbf", NOSHIFT, F4)
.test("3_ft", NOSHIFT, F2)
.test("8_ft", NOSHIFT, F6, F2)
.test("100_lbf/ft", NOSHIFT, F1)
.test(F6, LSHIFT, F5)
.expect("V:200.lbf");
step("Exit: Clear variables")
.test(CLEAR, "UPDIR 'SLVTST' PURGE", ENTER);
}

View file

@ -92,6 +92,7 @@ struct tests
void vector_functions();
void matrix_functions();
void solver_testing();
void eqnlib_columns_and_beams();
void numerical_integration_testing();
void text_functions();
void auto_simplification();