# Tag Info

## Hot answers tagged electromagnetism

10

Here I have an example: x = linspace(-5,5,100); y = linspace(-5,5,100); z = linspace(-5,5,100); [X, Y, Z] = meshgrid(x, y, z); Ex = sin(2*pi/5*Z); Ey = 0*X; Ez = 0*X; [Bx, By, Bz, V] = curl(X, Y, Z, Ex, Ey, Ez); Eplot = 0*x; Bplot = 0*x; for i=1:100 %% Integration-like procedure Eplot(i) = mean(mean(Ex(:,:,i),1),2); Bplot(i) = mean(mean(By(:,:,...

6

There are basically two methods: You can disrectize the angular part via grid points, or you can discretize it via basis expansion. I will focus on spherical symmetry here, the cylindrical case is quite similar. In the basis expansion approach, one applies the ansatz $$v(x,t) = \sum_{klm} a_{klm}(t)\,R_{klm}(r)\, Y_{lm}(\theta,\phi)$$ This is inserted ...

5

If you have simple, grid-aligned interior objects or accuracy is not crucial then stick with the method you have described. If you need to accurately represent arbitrary boundary shapes then you're probably best off moving to a (more complicated) finite element approach on an unstructured grid. You have described the simplest approach to solving this ...

5

I've found that if I reduce the radial domain to $8 \leq r \leq 20$, the condition number drops to ~10,000. This makes me think I need to scale my problem. I'm not sure how to do this, however, and I need to do it right. Nondimensionalization is partly repeated application of the chain rule, and partly art. The goal is to make as many quantities in your ...

5

A classic paper for evaluation of the integrals commonly present in computational electromagnetics (EM) is: D. R. Wilton, S. M. Rao, A. W. Glisson, D. H. Schaubert, O. M. Al-Bundak, and C. M. Butler, "Potential integrals for uniform and linear source distributions of polygonal and polyhedral domains," IEEE Trans. Antennas Propag., vol. AP-32, no. 3, pp. 276-...

5

The Maxwell system is a wave equation at heart, so your ansatz (the space where you seek solutions, the combination of your mesh and basis functions) must be able to faithfully represent waves. The Nyquist criterion sets an absolute lower limit to the "sample rate" of your mesh: two points per wavelength. In practice, you must upsample by a considerable ...

5

As a preamble, I would not expect that splitting $E$ into real/imaginary parts is very profitable. Normally, block 2x2 systems are motivated because one block of unknowns is "easier" to solve than the other in some sense (better conditioned? smaller in cardinality? etc). This is not the case for time-harmonic Maxwell, I think you'd be better off ...

4

As for any other domain, your mesh needs to be fine enough to resolve the features you have. This means that the mesh has to be finer than the geometric details of your unit cell, and it needs to be finer than the wavelengths of the waves you consider. Beyond this, the question of tets vs hexes is a minor issue. Hexes are generally more accurate, but if the ...

4

So Is it neccesary to use Poisson - Boltzmann equation if I only need to build electrostatic potential from a PQR file? No. You can use Poisson. Since you know the positions of each point charge, you know the charge distribution $\rho$, which is a sum of delta functions. You can thus solve numerically the Poisson's equation that links the charge ...

4

When you call Lapack's zgtsv, it doesn't just solve a tridiagonal system $Ax=b$. What it does first is perform an LU factorization (zgttrf) $A = LU$, where $L,U$ are lower- and upper-tridiagonal matrices, and only then proceeds to solve $LUx=b$. When you give it the lower, main, and upper diagonals of the matrix $A$, those diagonals are overwritten by the ...

4

ANSYS Maxwell is a Finite Element solver for Electromagnetism. So, I assume that you are looking for a Finite Element package that has a Python interface (or is written in Python). There are some popular options like: SfePy; FEniCS; and Agros2D. The last one provides a Python interface and a (nice) graphic interface, and is based in Hermes2D (so it ...

4

Interesting question. I would expect the Yee scheme to be indifferent to static (bias) fields induced by constant potentials. In the electrostatic case, if you have a constant electric potential $\phi$, it induces a field $\vec E = \nabla \phi$. The update equation is (modulo constants) $\frac{d}{dt}\vec B = \nabla \times \vec E$. But since $\vec E$ is a ...

3

Your questions suggest that you are new to implementing solvers for PDEs, and that you are not familiar with the usual data structures and algorithms used in this field. It would probably be very useful for you to see how other people write codes like the one you are trying to write, because you will see how they arrange data, how they represent geometry and ...

3

It's an interesting question - how does a dipole actually move? It seems to me you're not entirely sure what to expect, so we need to get a solid test case where we understand what's actually going on. On a related note, do try to add your imports and initial conditions the next time :) For now, let's assume both masses equal and opposite charges. We can ...

3

The paper: I. Anjam, J. Valdman, "Fast MATLAB assembly of FEM matrices in 2D and 3D: Edge elements", Applied Mathematics and Computation, 267, (2015), 252–263; states the following. http://www.sciencedirect.com/science/article/pii/S0096300315004191 "A finite element discretization is done in terms of edge elements, typically Raviart–Thomas elements [12] for ...

3

One issue (and this is mentioned by Mur in the first paper you linked in the comments above) is the fact that, while these edge functions provide tangential field continuity across interfaces and zero divergence within each element, they also allow for discontinuities in normal fields across interfaces. This behavior is non-physical, giving rise to ...

3

From what I understand, you'd like to see which numerical method best simulate the real physics relevant for a particular problem. MHD spans a wide scale of phenomena -- plasma physics (on length scales of ions and electrons) to ideal MHD (on the length scale relevant to accretion disks around blackhole or other compact objects). In this case, it's advisable ...

3

For this purpose you need to use a simulation software. One of the most common methods in Electromagnetics would be Finite element method, but you can also find Boundary Element Methods or Finite Difference Methods. Some common software in EM are Ansys Maxwell; and CST Studio A lot of people is also using COMSOL Multiphysics. But I would say that this ...

3

The Van der Walls radius - last column in the output - is calculated from the force field. Probably pdb2pqr and editconf uses different force fields, hence different radius. I don't use pdb2pqr, but it seems (1) AMBER99 is the default force field, though CHARMM, PARSE and TYL06 are supported. Gromacs' editconf reads force field from topology file generated ...

3

You're looking for waveguide port boundary conditions. I think the most accessible treatment is within Jin & Riley's Finite Element Analysis of Antennas and Arrays, Chapter 5. It's available on Amazon, see https://www.amazon.com/dp/0470401281/. A lot of these formulations were first introduced by Jin-Fa Lee, you can find his works in IEEE Microwave ...

3

Regarding simulation: There are several commercial solvers that might be helpful. A very popular FDTD Maxwell equation solvers for nanophotonics is Lumerical. It features opto-thermal and liquid crystal (which I would say is another keyword you should consider) simulations that should be very relevant. Another go-to multiphysics solver would be COMSOL. ...

3

I received a solution to this question from MATLAB's community. Essentially, I need to specify which contour lines to plot using the 'levels' spot on the 'contour()' command. Levels allows you to not only choose how many but which lines to plot. If you define a vector such as vlevel = linspace(20, 65, 10); and then place it in the 'levels' spot of ...

3

You don't need symbolic variables to compute the approximated potential for your Riemann sums. You can just use meshgrid to evaluate the potential in each point of interest. For the electric field, you can just compute the derivative analytically and then repeat the process for each component or compute a numerical gradient with gradient. There are better ...

3

Every iterative solver -- Jacobi, SSOR, CG, etc -- starts with an initial approximation. One often just uses the zero vector, but there is nothing wrong with using the solution of the previous time step. In fact, extrapolating from previous time steps to the current one is an even better idea -- one the authors apparently missed! For some iterative solvers, ...

3

It sounds like you are interested in a finite-element analysis, which is out of my area of expertise. But I can hopefully provide some insight from the perspective of finite-difference methods which may still have some relevance to your problem (since it is also used to solve wave equations). In general, a good rule of thumb is that specification of a ...

3

Using the typical expansion functions (1-forms/edge-elements for E, and 2-forms/facet-elements for B) the formulations are basically the same after spatial discretization and you'd expect more or less the same accuracy. I do think they express slightly different opinions about time integration. The mixed E/B formulation nudges you in the direction of ...

3

Your particle is a rounded proton (mass m = 2e-27 kg instead of 1.672e-27 kg). The equation of motion is $$\dot x=v,~~~ m\dot v = q\,v\times B,$$ where $B=(0,0,B_z)$ with $B_z=4T=4N/(m\,A)$ and $q=1e=1.602·10^{-19} C$, $C=A\,s$ This then gives for the acceleration m=2e-27 e_charge = 1.6e-19 q=+1*e_charge Bz = 4 ax = q/m*vy*Bz; ay = -q/m*vx*Bz; az = 0 For ...

2

From browsing some forum posts, it appears that the numerical solution to these equations is not trivial to obtain. See, for example, this discussion (admittedly dated now). You indicate in your post that you are relatively new to numerical PDE solvers, and so the following references may be more involved than you were hoping for. In particular, they require ...

2

The main advantage of the tetrahedral vs hexahedral is the mesh generation, there are automatic mesh generators for tetrahedral meshes that give "good" elements. This process is not that easy for the hexahedral case and you will need to do a bigger effort to get a nice mesh. Nevertheless, is not a good idea to use linear tetrahedrals since they have linear ...

Only top voted, non community-wiki answers of a minimum length are eligible