(11-07-2021 08:08 PM)ijabbott Wrote: [ -> ]For different top and bottom radii, you really would have to solve for both a and b.
It looks like Matt's Python code could be easily modified to handle different diameters at each end.
mpmath can handle multiple nonlinear equations with multiple unknowns.
And, with different solver to suit the need
>>> from mpmath import *
>>> R1, R2, L = 1.016/2, 1.12/2, 0.5
>>> def findab(x,y): return lambda a,b: a*cosh((x-b)/a) - y
...
>>> findroot([findab(0,R1), findab(L,R2)], [R1,L/2])
matrix(
[['0.462106619540686'],
['0.204282212315188']])
---
Solving system of non-linear equations is hard.
I don't think Cas (even XCas) has built-ins to solve them.
Luckily, we can easily turn above to 1 equation with 1 unknown.
R1 = a*cosh((0-b)/a)
R1/a = cosh(b/a)
R2 = a*cosh((L-b)/a)
R2/a = cosh(L/a) * cosh(b/a) - sinh(L/a) * sinh(b/a)
= cosh(L/a) * (R1/a) - sinh(L/a) * sqrt((R1/a-1)*(R1/a+1))
Solving in Cas (but, to avoid sqrt of negative numbers, make sure guess a < R1)
Cas> finda := (cosh(l/a)*r1 - sinh(l/a)*sqrt((r1+a)*(r1-a))) - r2
Cas> fsolve(finda(l=0.5, r1=0.508, r2=0.560), a=0.5)
0.462106619541 // = a
Cas> id(acosh(r1/a)*a) (a=Ans, r1=0.508)
0.204282212315 // = b
---
Update: I was wrong, Cas/XCas can solve this (without guesses !)
Cas> fsolve([a*cosh(b/a), a*cosh((0.5-b)/a)] = [0.508, 0.56], [a,b])
[0.462106619541, 0.204282212315]