Quantum
02-29-2012, 06:15 AM
Hi folks,
sadly it has been a while and I think I have to learn the things from anew how to use the NR.
So my problem is that I try to sample my monte carlo method by root finding.
The procedure goes as follows:
I have a cross section for my interaction, depending on the primary energy T and secondary energy W: \sigma(T,W).
To describe the interaction via a random number I divide the cross section by the maximum possible energy of the secondary electron
\frac{\sigma(T,W)}{\sigma(T,W_{max})} = u
where u is a random number in [0,1].
So if I put in the information of a random number, I get
\frac{\sigma(T,W)}{\sigma(T,W_{max})} = u \quad \Rightarrow\quad \frac{\sigma(T,W)}{\sigma(T,W_{max})} - u = 0
Well, this is a root finding problem, where
f(x) = \frac{\sigma(T,x)}{\sigma(T,W_{max})} - u
To use the Newton Raphson Method I have to derive my function f, leading to
f'(x) = \frac{1}{\sigma(T,W_{max})} \frac{d\sigma(T,x)}{dx}
Now, the Newton Raphson Method is based on iteration via
x_{i+1} = x_i - \frac{f(x_i)}{f'(x_i)}
Now, for my problem this leads to
x_{i+1} = x_i - \frac{\sigma(T,x) - u\cdot \sigma(T,W_{max})}{\frac{d\sigma(T,x)}{dx}}
Now, this should work or not? I have the analytical description of both the cross section sigma and the derivative.
I guess I have to work as in post nr. 5 (http://www.nr.com/forum/showpost.php?p=4677&postcount=5) with the same problems.
Cheers,
Quantum.
sadly it has been a while and I think I have to learn the things from anew how to use the NR.
So my problem is that I try to sample my monte carlo method by root finding.
The procedure goes as follows:
I have a cross section for my interaction, depending on the primary energy T and secondary energy W: \sigma(T,W).
To describe the interaction via a random number I divide the cross section by the maximum possible energy of the secondary electron
\frac{\sigma(T,W)}{\sigma(T,W_{max})} = u
where u is a random number in [0,1].
So if I put in the information of a random number, I get
\frac{\sigma(T,W)}{\sigma(T,W_{max})} = u \quad \Rightarrow\quad \frac{\sigma(T,W)}{\sigma(T,W_{max})} - u = 0
Well, this is a root finding problem, where
f(x) = \frac{\sigma(T,x)}{\sigma(T,W_{max})} - u
To use the Newton Raphson Method I have to derive my function f, leading to
f'(x) = \frac{1}{\sigma(T,W_{max})} \frac{d\sigma(T,x)}{dx}
Now, the Newton Raphson Method is based on iteration via
x_{i+1} = x_i - \frac{f(x_i)}{f'(x_i)}
Now, for my problem this leads to
x_{i+1} = x_i - \frac{\sigma(T,x) - u\cdot \sigma(T,W_{max})}{\frac{d\sigma(T,x)}{dx}}
Now, this should work or not? I have the analytical description of both the cross section sigma and the derivative.
I guess I have to work as in post nr. 5 (http://www.nr.com/forum/showpost.php?p=4677&postcount=5) with the same problems.
Cheers,
Quantum.