Ask Your Question
1

spherical coordinate simplify

asked 2024-12-23 05:04:18 +0100

olafx gravatar image

I'm having issue with functions not simplifying as expected in spherical coordinates. Here is an example. sage: E.<xi,th,ph> = EuclideanSpace(coordinates='spherical') sage: f(th) = abs(sin(th)) sage: f th |--> abs(sin(th)) sage: f.full_simplify() abs(sin(th)) sage: f.trig_simplify() Then I add assume(th >= 0) and whatnot, and it complains the assumption is redundant. I can't make any sense of it. Sometimes there is no issue and my results simplify, other times I get nonsense abs(sin(th)) terms.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2024-12-24 11:52:35 +0100

eric_g gravatar image

This is because when you declare a symbolic expression like f(th) = abs(sin(th)) it has no knowledge of the range of spherical coordinates on E. There are two solutions to your issue:

1/ Stick to Sage's standard symbolic expression but use a better simplifying function, which takes into account the range of spherical coordinates in Euclidean space:

sage: E.<xi,th,ph> = EuclideanSpace(coordinates='spherical')
sage: f(th) = abs(sin(th))
sage: from sage.manifolds.utilities import simplify_chain_real
sage: simplify_chain_real(f(th))
sin(th)

See the documentation of simplify_chain_real for details.

2/ Use chart functions instead of mere symbolic expressions:

sage: E.<xi,th,ph> = EuclideanSpace(coordinates='spherical')
sage: X = E.spherical_coordinates(); X
Chart (E^3, (xi, th, ph))
sage: f = X.function(abs(sin(th)))
sage: f
abs(sin(th))
sage: f.simplify()
sin(th)
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2024-12-23 05:04:18 +0100

Seen: 25 times

Last updated: 20 hours ago