Skip to content

Commit

Permalink
Merge pull request #1 from obouchaara/dev-daily
Browse files Browse the repository at this point in the history
update fields
  • Loading branch information
obouchaara authored Dec 15, 2023
2 parents ad347db + 9b07413 commit d4e7588
Show file tree
Hide file tree
Showing 5 changed files with 351 additions and 100 deletions.
8 changes: 4 additions & 4 deletions notebooks/coord.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
{
"data": {
"text/plain": [
"SymbolicCartesianCoordSystem(origin=[0, 0, 0], basis_symbols=[x, y, z])"
"SymbolicCartesianCoordSystem(origin=(0, 0, 0), basis_symbols=(x, y, z))"
]
},
"metadata": {},
Expand All @@ -79,7 +79,7 @@
{
"data": {
"text/plain": [
"SymbolicCylindricalCoordSystem(origin=[0, 0, 0], basis_symbols=[r, theta, z])"
"SymbolicCylindricalCoordSystem(origin=(0, 0, 0), basis_symbols=(r, theta, z))"
]
},
"metadata": {},
Expand Down Expand Up @@ -116,7 +116,7 @@
{
"data": {
"text/plain": [
"SymbolicCylindricalCoordSystem(origin=[0, 0, 0], basis_symbols=[r, theta, z])"
"SymbolicCylindricalCoordSystem(origin=(0, 0, 0), basis_symbols=(r, theta, z))"
]
},
"metadata": {},
Expand All @@ -125,7 +125,7 @@
{
"data": {
"text/plain": [
"SymbolicCartesianCoordSystem(origin=[0, 0, 0], basis_symbols=[sqrt(x**2 + y**2), atan2(y, x), z])"
"SymbolicCartesianCoordSystem(origin=(0, 0, 0), basis_symbols=[sqrt(x**2 + y**2), atan2(y, x), z])"
]
},
"metadata": {},
Expand Down
4 changes: 2 additions & 2 deletions notebooks/field.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3b72a02030aa490d8c1c41ae0accac63",
"model_id": "77c42c06012648c0a58085bf4d4797d0",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -133,7 +133,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "7e5027294bb344f39c1fb2544b4af28f",
"model_id": "f30dc3d5d92942efbf597e3fc3568254",
"version_major": 2,
"version_minor": 0
},
Expand Down
217 changes: 193 additions & 24 deletions notebooks/field_2.ipynb

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions src/mechpy/core/symbolic/coord.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def __repr__(self):

class SymbolicCartesianCoordSystem(SymbolicCoordSystem):
def __init__(self, basis_symbols=None):
origin = sp.ImmutableDenseNDimArray([0, 0, 0])
basis_symbols = basis_symbols or [sp.symbols(_) for _ in ["x", "y", "z"]]
origin = (0, 0, 0)
basis_symbols = basis_symbols or sp.symbols("x y z")
super().__init__(origin, basis_symbols)

def get_basis_cylindrical_exprs(self) -> dict:
Expand Down Expand Up @@ -59,8 +59,8 @@ def get_spherical_coord(self, values):

class SymbolicCylindricalCoordSystem(SymbolicCoordSystem):
def __init__(self, basis_symbols=None):
origin = sp.ImmutableDenseNDimArray([0, 0, 0])
basis_symbols = basis_symbols or [sp.symbols(_) for _ in ["r", "theta", "z"]]
origin = (0, 0, 0)
basis_symbols = basis_symbols or sp.symbols("r theta z")
super().__init__(origin, basis_symbols)

def get_basis_cartesian_exprs(self, cartesian_basis_symbols=None) -> dict:
Expand Down Expand Up @@ -97,8 +97,8 @@ def get_cartesian_coords(self, values):

class SymbolicSphericalCoordSystem(SymbolicCoordSystem):
def __init__(self, basis_symbols=None):
origin = sp.ImmutableDenseNDimArray([0, 0, 0])
basis_symbols = basis_symbols or [sp.symbols(_) for _ in ["r", "theta", "phi"]]
origin = (0, 0, 0)
basis_symbols = basis_symbols or sp.symbols("r theta phi")
super().__init__(origin, basis_symbols)

def get_basis_cartesian_exprs(self, cartesian_basis_symbols=None) -> dict:
Expand Down
Loading

0 comments on commit d4e7588

Please sign in to comment.