Questions tagged [electromagnetism]

For questions about modeling phenomena related to electromagnetic fields.

Filter by
Sorted by
Tagged with
1 vote
0 answers
73 views

Magnetic field simulation for "quasi-solenoid" - Where to start?

I would kindly ask you which (preferably free) programs / codes do you suggest for the numerical simulation of the problem described below. I am not asking for the full solution, but just want to ...
user avatar
  • 11
0 votes
0 answers
28 views

How to define a stretched coordinate perfectly matched layer (PML) parameters for maximum absorbtion?

I have written a MATLAB code for solving Maxwell's equations (electromagnetic wave propagation) in 3D with perfectly matched layer (PML) boundaries. I am using a stretched coordinate PML, but I see ...
user avatar
0 votes
1 answer
74 views

Modeling ferromagnetic materials in a primitive python FEA

I am working on a primitive 2D DIY magnetic "FEA" solver for a class project. It's really just a big NumPy array where each element in the array can be one of the following: Air Current ...
user avatar
  • 1
-1 votes
1 answer
77 views

Billiard reflection inside a triangular mesh

I am currently interested in billiards and their trajectories. I would like to simulate a billiard inside a water-tight mesh. A mesh basically consists of a list of points in 3D space (vectors with 3 ...
user avatar
  • 101
1 vote
1 answer
319 views

Integral of the Poisson Kernel

I am trying to solve the following integral: $$ I (r,\theta) = \frac{1}{2\pi}\int_0^{2\pi}\frac{f(\phi)(1-r^2)}{1+r^2-2r \cos(\theta-\phi)}d\phi$$ where $0\le r<1$ and, $$f(0\le\phi<\pi/2) = +\...
user avatar
  • 195
0 votes
0 answers
96 views

Finite difference solver for the 2D Poisson's equation with an integral boundary condition

I wanted to attempt an implementation of a finite-difference-based solver for the 2D elctrostatic Poisson equation when metallic objects are present. Also, I hope to take as input, the location of ...
user avatar
1 vote
0 answers
35 views

Can I build an electrostatic simulation of conductive objects using just the method of images?

I wish to build a simulation of self-assembling wires. Think lots of ball bearings in a 20KV electric field and they form emergent structures. If I use the method of images to figure out what the ...
user avatar
-1 votes
1 answer
65 views

Meep C++ interface benchmark

I am having trouble getting a good parallelization with FDTD simulations in Meep. Originally, I tried to use the Python interface on a rather big computing cluster, but the runtime of my simulations ...
user avatar
0 votes
0 answers
113 views

2D axisymmetric Magnetostatics Finite Element Method solver

I am new to the field of magnetostatics. I wish to write a 2D finite element code for obtaining the magnetic field inside a solenoid coil. I have started with a 2D code and have followed the method as ...
user avatar
1 vote
0 answers
41 views

Digital beamforming: how payload manipulation can change beam direction without manipulating the carrier?

I'm interested in how digital beamforming works and I can not find an answer for a lot of time. I googled, asked teammates, and couldn't get it. Let me describe my question. From my understanding, the ...
user avatar
0 votes
0 answers
42 views

Biot-savart numerical integration

I have a mesh structure of tetrahedrals and I know the current density on each node. I want to evaluate the magnetic flux density. Therefore, I use Gaussian quadrature. However, I do not know how to ...
user avatar
  • 11
0 votes
0 answers
66 views

Plotting the motion of a positive charge in a cylindrically symmetric magnetic field

I want to plot the motion of a positive charge in a cylindrically symmetric magnetic field. I am assuming a cylinder around the z-axis, with the magnetic field going in clockwise direction. The B-...
user avatar
0 votes
1 answer
79 views

How to Calculate magnetic and electric field in 2D Magnetotelluric using Edge based Finite Element

I calculate 2D Model of Magnetotelluric responses which are apparent resistivity and phase. I do the calculation for Transverse Electric (TE) mode. Then I used edge based finite element with ...
user avatar
  • 9
-1 votes
1 answer
281 views

Using ODE to plot particle-motion with scipy.integrate.solve_ivp

My Problem: A positively charged particle (mass = 2 * 10-27 kg) is moving along the x-axis. It is travelling in a homogenous magnetic field such that the field axis in z-direction. The energy of the ...
user avatar
4 votes
1 answer
259 views

Weak Formulation of Poisson's Equation for Electrostatics with Surface Charge

I am currently attempting to use FEnICS to solve an electrostatic problem with two materials of different permittivity $\varepsilon_1$ and $\varepsilon_2$ forming an interface: Consider a domain $\...
user avatar
  • 43
5 votes
2 answers
196 views

How to create a good preconditioner for a system of linear equations that is created with FEM applied on the time harming Maxwell eqution?

I set out to solve the time harmonic Maxwell equation numerically which was discritzed using FEM and with the use of Nedelec elements as basis and test functions. The equation reads: $$ \nabla \times \...
user avatar
0 votes
0 answers
106 views

FEM port Boundary definition for electromagnetics and wave guides

We are currently in the process of implementing ports in our EM FEM simulation SW. We have come across the definition of boundary conditions for the ports, and we do not understand the equation for ...
user avatar
  • 33
3 votes
1 answer
204 views

Finite element method for high-frequency electromagnetics

I am writing a project about the Finite element method for use in high-frequency solutions of Maxwell's equations. This could be for use in antenna design and similar. I have some trouble ...
user avatar
  • 33
1 vote
0 answers
45 views

Results blow up when number of intervals is increases (Yee algorithm FDTD, dielectric sphere)

I have been trying to write a program that analyses EM wave scattering by a dielectric sphere for a project. The reference is Sadiku's book Numerical Methods in electromagnetics Edition 3. Now the ...
user avatar
  • 41
0 votes
0 answers
38 views

Calculating magnetic flux density

I have a geometry where current density distribution is constant. I can calculate the $z$ component of magnetic flux density according to Biot-Savart law as following: $$B_z(x,y,z) = \int\limits_x\int\...
user avatar
  • 11
1 vote
1 answer
117 views

Electrostatic Force - Simulate Trajectory of Test Particle using Runge Kutta - Force always Repels

In the center of a 2D-Plane a positive static charge Q is placed with position r_prime. This charge creates a static electrical Field E. Now i want to place a test particle with charge Q and position ...
user avatar
2 votes
0 answers
193 views

Numerical simulation of magnetic dipole in a inhomogeneous magnetic field

Goal: I want to use Python to illustrate how a magnetic dipole with magnetic moment m2 moves in a non-homogeneous magnetic field in a 2D-Plane. This field is generated by another magnetic dipole with ...
user avatar
-1 votes
1 answer
115 views

plotting $F=K \frac{q_1 q_2}{r^3}$ in python

I tryin to plot the position of electron in the hidrogen atom by Coulomb's law, $F=K \frac{q_1 q_2}{r^3}$ This is mi code ...
user avatar
6 votes
0 answers
107 views

A Question About a Claim from 1991 Computational EM paper about the Cancellation of certain Boundary Terms

Please let me know if this is not the appropriate site for this question. I found questions regarding EFIE/MFIE/CFIE on this site, so I thought my question might fit. I am studying the paper by Putnam ...
user avatar
1 vote
1 answer
255 views

Help with modified bessel functions

I'm trying to parse the following expression (Eq. 35 in The Magnetic Field in the Vicinity of Parallel and Twisted Three-Wire Cable Carrying Balanced Three-Phased Current) in Python and calculate its ...
user avatar
1 vote
0 answers
72 views

How can I improve the accuracy of the calculation of the magnetic field in Gmsh/GetDP?

I need to calculate the magnetic field along a straight line in proximity of an array of 6 magnets. I used the tutorial files "magnets" included in Gmsh and I slightly modified the file in ...
user avatar
  • 111
0 votes
0 answers
142 views

How to use FEniCS to calculate the electric field of an isolated charged sphere

Initially I thought that this is the kind of question which ought to have already been answered in the form of an example online, but so far I haven't found one. I will admit that I am very new to ...
user avatar
0 votes
0 answers
76 views

How to calculate the interior value of triangular element in edge (vector) finite element?

I was using an edge (vector) finite element to solve electromagnetic diffusion (two-dimensional cases). The element that I used was a triangular element. I have got the result of the finite element in ...
user avatar
  • 9
1 vote
0 answers
286 views

More efficient way to calculate magnetic field using Biot-Savart

I am writing a program in python that is supposed to calculate the magnetic field along a conducting coil that is made up of a bunch of points, and the magnetic field is generated by other conducting ...
user avatar
  • 11
1 vote
1 answer
101 views

Simple reference problems for time harmonic Maxwell equations

For Navier-Stokes problems we can often choose a relatively simple verification problem such as the lid driven cavity, flow over a cylinder, or flow over a backward facing step to verify our ...
user avatar
  • 66
0 votes
0 answers
77 views

Numerical scheme to calculate the normal mode of a set of hyperbolic PDEs?

I would like to solve the linearised, ideal, MHD equations, where the gas pressure is zero. $$\frac{\partial u_x}{\partial t}=v_A^2(x,z)\left[\nabla_{||}b_x - \frac{\partial b_{||}}{\partial x}\right],...
user avatar
  • 219
4 votes
1 answer
2k views

Finite difference methods in cylindrical and spherical co-ordinate systems

I am quite familiar with finite difference schemes in cartesian coordinates. The key point here is that every point in the cartesian grid is treated equally as the spacing between consecutive points ...
user avatar
  • 195
0 votes
0 answers
131 views

COMSOL Circularl polarization

I'm having some problems trying to implement circularly polarized light in COMSOL Muliphysics. For a isotropic homogenous media, I've obtained without problems the TE and TM reflectance curves. ...
user avatar
4 votes
2 answers
876 views

Kronecker product representation of the finite difference laplacian

The laplacian equation when discretized gives a system of linear equations that can then be solved. See the answer to this question: https://math.stackexchange.com/questions/3120948/discretization-...
user avatar
  • 195
0 votes
0 answers
55 views

Discretisation by FVM with triangulare mesh

I work on electromagnetic modeling, and I use the finite volume method as a tool, so I want to develop code by the modified finite volume method (with triangular mesh), my problem studied is in a ...
user avatar
1 vote
1 answer
501 views

Simple particle-in-cell examples

I am studying about the 1D EM-PIC (Electro Magnetics using particle-in-cell) simulation. I want to have a simultaneous time-integration of the electric/magnetic fields plus the motion of free charges ...
user avatar
3 votes
0 answers
66 views

Spectral solver on em-pic

I'm recently studying for the spectral solver to implement EM-PIC code. I read an article and have some questions. Many PIC codes uses spectral solver to overcome numerical artifacts on FDTD. In the ...
user avatar
3 votes
2 answers
711 views

Minimum number of elements (mesh size) for electromagnetic simulation

Does someone have a reference for the minimum number of elements (or maximum mesh size) for electromagnetic simulations where a mathematical or numerical explanation is given? I have found several ...
user avatar
0 votes
0 answers
401 views

Parallel plate capacitor as simple superposition of Coulomb-fields

I am trying to calculate and visualize the electric field inside and outside of a parallel plate capacitor by assuming a uniform distribution of point charges on each plate and by adding up the ...
user avatar
  • 11
2 votes
1 answer
297 views

MATLAB's ode45 not dealing with initial conditions well [RESOLVED]

*Concern highlighted in yellow *Solution at bottom I have a differential equation to solve for the motion of an electron: $$ \frac{d^2v}{dt^2} = \frac{1}{\gamma^6}\left( \frac{eE}{\tau m} - \left( \...
user avatar
2 votes
1 answer
83 views

Is there any method to incorporate minor changes into solved meshes to speed convergence in particle-in-cell solvers?

I'm trying to perform a $10^6$ timestep electrostatic particle-in-cell simulation on a rather large mesh, with very limited computational resources (a single GPU). Because of the large number of ...
user avatar
  • 123
0 votes
0 answers
123 views

FEniCS implementation of Maxwell equations for a dipole antenna

someone knows where I can find a FEniCS implementation of Maxwell equations for a dipole or other type of antenna? I mean a dipole antenna with an arbitrary geometry of every 'leg' in the dipole.
user avatar
1 vote
0 answers
43 views

Multipole expansion for magneticfield intesity (magnetization)

I'm using the Barnes Hut method to calculate the magnetic vector potential induced by an applied current. Given as: $\begin{equation} A(r) = \frac{\mu_0}{4\pi} \int_V\frac{\bf{J(r')}}{|r-r'|}dV(r') \...
user avatar
  • 11
3 votes
2 answers
1k views

Electromagnetism FEM (FEniCS) interpolation - leakage effect

As for the background of what is going on: I'm using FEniCS that is dedicated FEM solver The problem I'm solving is magnetostatic problem where the governing PDE is $$ \bf{\nabla} \times \frac{1}{\mu}...
user avatar
  • 41
3 votes
2 answers
1k views

Graphing electric potential of a ring of charge using MATLAB help

Here is a summary of what I am trying to do: Use MATLAB to compute the potential $V$ at any point $(x, y, z)$ in space due to a uniform ring of charge. Use a Riemann sum to compute the integral ...
user avatar
  • 163
1 vote
1 answer
107 views

Demagnetizing field using scalar potential method

I want to calculate the stray magnetic field from a ferromagnet using the scalar potential method (1). The problem consists of a ferromagnetic cuboid divided into small cuboidal cells in which the ...
user avatar
  • 11
-1 votes
1 answer
75 views

Simulating magnetic particles in a field free point generated by two opposing magnets

This is probably a long shot with such a short time, but I've been trying to get theoretical data for a project I'm working on. The project involves using a very simplified version of magnetic ...
user avatar
0 votes
1 answer
307 views

TMZ TME modes, clarification

I'm refering here to Taflove's "computational electrodynamcis, 3rd ed." He says Let us assume that the structure being modeled extends to infinity in the z-direction with no change in the shape ...
user avatar
  • 156
2 votes
0 answers
47 views

Open source multiphysics software that can model the interaction of two insulators with a user-specified electrical force law?

Given two solid bodies of masses $m_1$ and $m_2$ with invariable charge distributions $\rho_1(\mathbf{r_1})$ and $\rho_2(\mathbf{r_2})$ in them,* respectively, I would like to model the electrical ...
user avatar
  • 147
2 votes
1 answer
187 views

Average value divergence in spectral method for Poisson equation

I'd like to know how to deal with a divergence when trying to solve the Poisson equation for electrostatics with a simple spectral method. I'm not sure how to best state my problem, so I'll explain ...
user avatar
  • 121