New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mixed coordinate system for divergence #13128

Merged
merged 9 commits into from Aug 17, 2017

Conversation

Projects
None yet
2 participants
@szymag
Contributor

szymag commented Aug 15, 2017

This PR adds support for mixed coordinate systems in divergence.
The cases when in one vectorial equation exists components from different coordinate system are calculated with respect to proper vector identities.

Show outdated Hide outdated sympy/vector/operators.py
Show outdated Hide outdated sympy/vector/operators.py
Show outdated Hide outdated sympy/vector/operators.py
@Upabjojr

This comment has been minimized.

Show comment
Hide comment
@Upabjojr

Upabjojr Aug 16, 2017

Contributor

It appears that the issue is still there.

Contributor

Upabjojr commented Aug 16, 2017

It appears that the issue is still there.

@szymag

This comment has been minimized.

Show comment
Hide comment
@szymag

szymag Aug 16, 2017

Contributor

The problem is with this test:

assert is_solenoidal(z*P.i + P.x*k) is True

To be True, divergence should be 0, but now in the output we have Dot(P.i, a.k) + Dot(a.k, P.i)

Contributor

szymag commented Aug 16, 2017

The problem is with this test:

assert is_solenoidal(z*P.i + P.x*k) is True

To be True, divergence should be 0, but now in the output we have Dot(P.i, a.k) + Dot(a.k, P.i)

@szymag

This comment has been minimized.

Show comment
Hide comment
@szymag

szymag Aug 16, 2017

Contributor

I guess it doesn't work because, when we call divergence recursively, only at the fist time doit has argument as we want. Otherwise, the value is always True

Contributor

szymag commented Aug 16, 2017

I guess it doesn't work because, when we call divergence recursively, only at the fist time doit has argument as we want. Otherwise, the value is always True

@Upabjojr

This comment has been minimized.

Show comment
Hide comment
@Upabjojr

Upabjojr Aug 16, 2017

Contributor

We need express, it is simply that dot doesn't know that the vectors are related.

Contributor

Upabjojr commented Aug 16, 2017

We need express, it is simply that dot doesn't know that the vectors are related.

@Upabjojr

This comment has been minimized.

Show comment
Hide comment
@Upabjojr

Upabjojr Aug 16, 2017

Contributor

P is C rotated, so it should be possible to calculate the dot product of vectors of P with vectors with C.

Contributor

Upabjojr commented Aug 16, 2017

P is C rotated, so it should be possible to calculate the dot product of vectors of P with vectors with C.

if doit:
return res.doit()
try:

This comment has been minimized.

@Upabjojr

Upabjojr Aug 17, 2017

Contributor

why this try?

@Upabjojr

Upabjojr Aug 17, 2017

Contributor

why this try?

This comment has been minimized.

@szymag

szymag Aug 17, 2017

Contributor

Because dot cannot be calculated, when two vector are comes from not connected coordinate system. We got error. So when we have doit=True I decided to use try to evaluate every possible elements and when it's not possible, leave them unevaluated.

@szymag

szymag Aug 17, 2017

Contributor

Because dot cannot be calculated, when two vector are comes from not connected coordinate system. We got error. So when we have doit=True I decided to use try to evaluate every possible elements and when it's not possible, leave them unevaluated.

This comment has been minimized.

@Upabjojr

Upabjojr Aug 17, 2017

Contributor

.doit() should never raise an exception, this has to be checked later.

@Upabjojr

Upabjojr Aug 17, 2017

Contributor

.doit() should never raise an exception, this has to be checked later.

@Upabjojr Upabjojr merged commit 2a35546 into sympy:master Aug 17, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@szymag szymag deleted the szymag:div_mix_coord branch Aug 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment