Message: Re: Getting NAN for values of Point in a magnetic field class Not Logged In (login)

## Re: Getting NAN for values of Point in a magnetic field class

Forum: Fields: Magnetic and Otherwise
Re: Getting NAN for values of Point in a magnetic field class (Aaron Liblong)
Re: Re: Getting NAN for values of Point in a magnetic field class (Gumplinger Peter)
Re: Re: Getting NAN for values of Point in a magnetic field class (Aaron Liblong)
Re: Re: Getting NAN for values of Point in a magnetic field class (Gumplinger Peter)
Date: 18 Jul, 2012
From: Aaron Liblong <Aaron Liblong>

 So it turns out the NAN problem was entirely a result of trying to calculate the field at the origin. Thanks for noticing that! However, there is still some weird behaviour. The main problem is that when I set the field to a constant value, after the first step it no longer remains constant (though only slightly different). For example: ``` x, y, z: 20.5879; 18.6825; 19.6499 sin(theta), cos(phi): 0.816612; 0.740544 Br, Btheta, Bphi: 0; 1e-05; 0 Bx, By, Bz: 4.27432e-06; 3.87874e-06; -8.16612e-06 previous Bx, By, Bz: 4.27432e-06; 3.87874e-06; -8.16612e-06 x, y, z: 27.5898; 24.5526; 26.1012 sin(theta), cos(phi): 0.816644; 0.747029 Br, Btheta, Bphi: 0; 1e-05; 0 Bx, By, Bz: 4.31141e-06; 3.83679e-06; -8.16644e-06 <---------------``` ```(next step) 1 29.5 25 23.5 0.99 0.00685 45.4 45.4 hallPhys eIoni``` ```previous Bx, By, Bz: 0.9341733459286579; -0.1875870402351953; 0 <------------ x, y, z: 29.51563709455589; 25.02548071971535; 23.5374965955675 sin(theta), cos(phi): 0.8543663692038602; 0.762739708814276 Br, Btheta, Bphi: 0; 1e-05; 0 Bx, By, Bz: 3.963738238545995e-06; 3.360742461663736e-06; -8.543663692038603e-06 <----------------- previous Bx, By, Bz: 0.06666666666666667; 1.086944420850742e-322; 1.491668146240041e-154 <----------------- x, y, z: 34.91789711328752; 29.70973367563871; 29.3859584436884 sin(theta), cos(phi): 0.8419042269305184; 0.7616214773706649 Br, Btheta, Bphi: 0; 1e-05; 0 Bx, By, Bz: 4.109914943017864e-06; 3.496902404816453e-06; -8.419042269305184e-06 previous Bx, By, Bz: 4.109914943017864e-06; 3.496902404816453e-06; -8.419042269305184e-06``` This also highlights an instance of the values initially stored in the field matrix not matching what they were previously set to. This only seems to happen around the beginning of a new step (including at the very start of the simulation, where it contains very small non-zero values). Do you know what could be causing this, and does it seem like a problem? I'm not sure if these values are used for anything after being changed, or are just sitting idly in the matrix before being recalculated. Other than that, you mentioned that problems may be arising because I'm using an unphysical field/particle setup. Just for the sake of the simulation, shouldn't I be able to simulate a physically impossible field (such as a magnetic monopole)? Or does the G4 particle tracking rely on a field that more or less satisfies Maxwell's equations? ```Many thanks, Aaron ```

 Inline Depth: Outline Depth: Add message:

1 Re: Getting NAN for values of Point in a magnetic field class   (Gumplinger Peter - 18 Jul, 2012)
 to: "Re: Getting NAN for values of Point in a magnetic field class"
This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]