Re: [sympy] How to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems?

2021-10-23 Thread Chris Smith
This is beyond what I am involved with regularly, but I wonder if this would be good in a tutorial for a pertinent module. Thanks @brombo /c On Saturday, October 23, 2021 at 8:33:38 PM UTC-5 brombo wrote: > Attached is the code and pdf output for all three cases. > On 10/23/21 2:11 AM, Andreas

Re: [sympy] How to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems?

2021-10-23 Thread Alan Bromborsky
Attached is the code and pdf output for all three cases. On 10/23/21 2:11 AM, Andreas Schuldei wrote: I am putting together the components of a vector field (a magnetic field, caused by a current in several conductors) in cartesian coordinates. The field is derived from calculating the

Re: [sympy] How to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems?

2021-10-23 Thread Alan Bromborsky
I realized you want 'a' to be a constant vector which my definition of 'a' in cylindrical coordinates is not.  I will develop a solution for a constant 'a'. On 10/23/21 11:23 AM, Alan Bromborsky wrote: I don't know if this would help but you problem cried out for cylindrical coordinates.  I

Re: [sympy] How to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems?

2021-10-23 Thread Alan Bromborsky
I don't know if this would help but you problem cried out for cylindrical coordinates.  I assumed the vectors a and R were from the origin and had no theta component (if not let me know and I will run that case) then this code (snippet) - def vector_potential_in_cylindrical_coordinates():    

Re: [sympy] How to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems?

2021-10-23 Thread Oscar Benjamin
A SymPy Vector is constructed algebraically from the unit vectors i, j and k of the coordinate system. For a vector field you also use the coordinate system base scalars x, y and z. In [11]: from sympy.vector import CoordSys3D, dot In [12]: O = CoordSys3D('O') In [13]: r = O.x*O.i + O.y*O.j +

Re: [sympy] How to create a vector function in sympy with actual vectors, that can be transformed between coordinate systems?

2021-10-23 Thread Andreas Schuldei
I am putting together the components of a vector field (a magnetic field, caused by a current in several conductors) in cartesian coordinates. The field is derived from calculating the rotation of its magnetic vector potential, which can be expressed as A_z = -Const * dot(r,a)(dot(r,r) A