// calculates transformation matrix for a single cone of an instrument's profile func stageMatrix2(radiusIn, radiusOut, radiusCenter, length, radianFrequency float64) [4]complex128 { xi := complex(radiusIn, 0) // m xi1 := complex(radiusOut, 0) // m l := complex(length, 0) // m w := radianFrequency // rad / s centerPlaneArea := pi * radiusCenter * radiusCenter // m2 sm := centerPlaneArea sphericalAreaIn := 4 * pi * radiusIn * radiusIn // m2 si := sphericalAreaIn rv := math.Sqrt(p * w * sm / (n * pi)) // rad^1/2 r0 := p * c / si // kg/(m4*s) or Pa*s, units of impedance k := w / c // wavenumber, rad / m zc := complex(r0, 0) * complex(1+0.369/rv, -0.369/rv) // Pa*s/sqrt(rad) g := complex(k, 0) * complex(1.045/rv, 1+1.045/rv) // sqrt(rad)/m gl := g * l // sqrt(rad) cosh_gl := cmplx.Cosh(gl) // mangled sqrt(rad) sinh_gl := cmplx.Sinh(gl) // mangled sqrt(rad) a11 := xi1 / xi * (cosh_gl - sinh_gl/(g*xi1)) // unitless (more mangled sqrt(rad)) a12 := xi / xi1 * zc * sinh_gl // Pa*s + mangle a21 := 1 / zc * ((xi1/xi-1/(g*g*xi*xi))*sinh_gl + (gl*cosh_gl)/(g*g*xi*xi)) // 1/(Pa*s) + mangle a22 := xi / xi1 * (cosh_gl + sinh_gl/(g*xi)) // unitless + mangle return [4]complex128{a11, a12, a21, a22} }
func test0(val, val0 complex128) complex128 { return val * cmplx.Sqrt(cmplx.Cosh(val*val*val)) * val0 }