|Message: Re: Getting NAN for values of Point in a magnetic field class||Not Logged In (login)|
Click on the Forum title, e.g. on the "Forums by Category" page, to read a sequence of postings to the Forum and its threads all in one page. If you are only interested in one thread or the thread following a specific posting, click the thread or the posting, which takes you to a smaller page, which contains only the part you are interested in and may be easier to navigate.
Messages are "chained" if there are only replies at the first level, i.e. 1/1.html, 1/1/1.html etc. In case of "chained" messages the message number is replaced by the icon and there is no indentation.
Inline: Display the subject line only or also the text of the posting(s); for the choice "All" the "Outline" choices are switched off.
|1||0||1||no text / full text of posting|
|2||1||All||text for level 1 only / text for All postings|
Outline: Choose the depth of the posting thread, successive toggle controls provide increasing detail.
|1||2||1||2 levels / 1 level (original posting)|
|2||3||2||3 levels / 2 levels|
|3||3||All||3 levels / all levels (all postings)|
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:|