On Thu, 13 May 2021 at 10:02, Davide Sandona' <[email protected]>
wrote:

> Hello Ryan,
>
> # HERE - Is there a less awkward way to evaluate the scalar field at a
>> # given vector?
>>
>
> Not that I'm aware of. I would have done the same intricate loop that you
> did.
> Note that you were "lucky": if your gp vector would have had at least one
> zero-component, then gp.components would
> not contain the zero component, resulting in a KeyError which would have
> complicated things even further.
>

A better way to do this might be:

In [*95*]: dict(zip(R3.base_scalars(), g.to_matrix(R3)))

Out[*95*]:

⎧             2        ⎫

⎨x_: t, y_: -t , z_: -t⎬

⎩                      ⎭

Maybe there should be some easier way to do that. Conceptually this is a
bit muddled though as it conflates vectors with points. Formally what is
wanted here is to evaluate a scalar field at a point represented by a
particular position vector wrt some reference frame. I don't know if the
vector module has the concept of a point as opposed to a vector.



> Vector Module definitely needs to be polished a little further in order to
> become user-friendly. I fear this discussion
> might get lost with time. I would suggest opening either an issue or a
> discussion suggesting improvements to this
> module, providing the aforementioned example.
> https://github.com/sympy/sympy/discussions
>
>
It certainly should be easier to use the vector module. I think some
thought needs to be given to how you can use it without needing to
explicitly create or use CoordSys3D. Most end user applications like this
have no need for multiple reference frames so needing to operate with them
is a distraction.


Oscar

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAHVvXxQUwZVeF0ONmXVjCYNLk2jNSjY6tsEJbpgY6w3E5a-WzQ%40mail.gmail.com.

Reply via email to