Catenoid soap bubbles
11-08-2021, 01:56 PM (This post was last modified: 12-18-2021 01:01 PM by Albert Chan.)
Post: #7
 Albert Chan Senior Member Posts: 2,142 Joined: Jul 2018
RE: Catenoid soap bubbles
(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]
 « Next Oldest | Next Newest »

 Messages In This Thread Catenoid soap bubbles - ijabbott - 11-06-2021, 07:51 PM RE: Catenoid soap bubbles - C.Ret - 11-07-2021, 12:11 PM RE: Catenoid soap bubbles - Albert Chan - 11-07-2021, 04:27 PM RE: Catenoid soap bubbles - ijabbott - 11-07-2021, 08:08 PM RE: Catenoid soap bubbles - Albert Chan - 11-08-2021 01:56 PM RE: Catenoid soap bubbles - Wes Loewer - 11-07-2021, 05:44 PM RE: Catenoid soap bubbles - ijabbott - 11-07-2021, 07:56 PM RE: Catenoid soap bubbles - ijabbott - 11-08-2021, 04:28 PM RE: Catenoid soap bubbles - Albert Chan - 11-08-2021, 06:03 PM RE: Catenoid soap bubbles - Joe Horn - 11-09-2021, 02:57 AM RE: Catenoid soap bubbles - ijabbott - 11-09-2021, 08:29 AM

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