NTNUJAVA Virtual Physics LaboratoryEnjoy the fun of physics with simulations! Backup site http://enjoy.phy.ntnu.edu.tw/ntnujava/
October 21, 2018, 01:34:26 pm

An interdisciplinary approach. ...Wisdom

 Pages: [1]   Go Down
 Author Topic: divergence modeling  (Read 6525 times) 0 Members and 1 Guest are viewing this topic. Click to toggle author information(expand message area).
computer
Newbie

Offline

Posts: 0

 « Embed this message on: October 17, 2009, 03:05:21 am » posted from:Buenos Aires,Distrito Federal,Argentina

Hi,people.
My question is about finite difference modeling of EM fields.
Exist some methods to force numeric divergence be zero,
not changing too much the overall field picture?
Like [E(x+dx,y,z) - E(x-dx,y,z)] / dx + [E(x,y+dy,z) - E(x,y-dy,z)] / dy + [E(x,y,z+dz) - E(x,y,z-dz)] / dz = 0.
Theoretically Maxwell equations maintain divergence stable,
but numeric errors accumulate.Or it maybe necessary setting initial field state.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3080

 « Embed this message Reply #1 on: October 17, 2009, 10:25:25 am » posted from:Taipei,T\'ai-pei,Taiwan

The equestion you wrote is first order Euler's method for no free charge case.
You can modify it to second order differential method (use potential V)
$\frac{\partial^2 V}{\partial x^2}+\frac{\partial^2 V}{\partial y^2}+\frac{\partial^2 V}{\partial z^2}=0$
and use relazation method (change to boundary value problem) to find the solution for V. Then calculate Ex,Ey,Ez from V.
 Logged
computer
Newbie

Offline

Posts: 0

 « Embed this message Reply #2 on: October 21, 2009, 06:33:12 pm » posted from:Buenos Aires,Distrito Federal,Argentina

As I'd understood,you propose convert vector field into scalar (easy to smooth),and vice versa.
But from no charge electric field we can not restore potentials unequivocally.It can be closed,circular.
 Logged
Fu-Kwun Hwang
Hero Member

Offline

Posts: 3080

 « Embed this message Reply #3 on: October 21, 2009, 08:26:11 pm » posted from:Taipei,T\'ai-pei,Taiwan

I will try to help if you can describe your problem in more detail (all the background information).
Otherwise, I do not know how to help.
 Logged
computer
Newbie

Offline

Posts: 0

 « Embed this message Reply #4 on: October 22, 2009, 08:55:25 pm » posted from:Buenos Aires,Distrito Federal,Argentina

I use model for dynamic field visualization,so calculations must be fast,
not like solution of equations system.Field represented as structure of double-precision values,
three for electric vector Ex,Ey,Ez,and three for magnetic Hx,Hy,Hz.
Time step (dt) is equal to distance step (dl) divided by velocity of light (c).
Rectangular block of points.Finite-difference like algorithm calculates new vector values
after time step,like Ex += [dt * K] * [[Hz(x,y+dy,z) - Hz(x,y-dy,z)] / [2 * dy]
- [Hy(x,y,z+dz) - Hy(x,y,z-dz)] / [2 * dz]] with some factor K following from Maxwell equations
(background equation dEx/dt = K * [dHz/dy - dHy/dz]).The main problem arises
trying to zero divergence,as in real-world fields.For example,setting initial conditions
we wish to connect two regions described by different analytic functions.
It is difficult do it "manually" for each case.I seek an universal algorithm.
Seems I need rather some programming trick then deep scientific explanation.
Scalar fields are smoothed easily,but voluntary electric field we can not represent as some gradient.
 « Last Edit: October 22, 2009, 09:03:36 pm by computer » Logged
 Pages: [1]   Go Up
An interdisciplinary approach. ...Wisdom