Ask Your Question

JimR's profile - activity

2023-05-16 02:47:27 +0200 marked best answer Solve/find_root for miscellaneous special function elliptic_kc?

I am looking to use solve() or find_root() with a function defined using elliptic_kc (sage.functions.special.EllipticKC), however Sage produces an error. The context of this is for use in a coplanar waveguide impedance calculation.

Example:

sage: find_root(elliptic_kc(x)==2, x, 0, 0.5)

[...]

'TypeError: unable to simplify to float approximation'.

and

sage: solve(2.0==elliptic_kc(x), x, to_poly_solve=True)

[...]

TypeError: 'sage.symbolic.expression.Expression' object is not subscriptable

Is there a convenient way to perform a solve/numerical root for these special functions?

2023-05-16 02:47:27 +0200 received badge  Scholar (source)
2023-05-11 16:36:08 +0200 commented question Solve/find_root for miscellaneous special function elliptic_kc?

Oh huh, I found a solution using scipy.optimize.root_scalar. It's not the cleanest, but I suppose it works. sage: de

2023-05-11 16:36:08 +0200 asked a question Solve/find_root for miscellaneous special function elliptic_kc?

Solve/find_root for miscellaneous special function elliptic_kc? I am looking to use solve() or find_root() with a functi