- #36
jam_27
- 48
- 0
saltydog said:Good Jam. I do believe you've taught me something.
Jam, the method relies on the Taylor expansion of the error terms. Above in post #25, I showed how each error term for each value of y calculated depends on three variables:
[tex]e_i=F(y_{i+1},y_i,y_{i-1})[/tex]
We wish to calculate the value of this function (for each [itex]e_i[/itex])
for small changes in the variables as per posting #25 above:
[tex]\begin{align*}e_i(\mathbf{Y}+\Delta\mathbf{Y}) &= h(y_{i+1}+\Delta y_{i+1},y_i+\Delta y_i,y_{i-1}+\Delta y_{i-1}) \\ &=e_i+\frac{\partial e_i}{\partial y_{i+1}} \Delta y_{i+1}+\frac{\partial e_i}{\partial y_{i}} \Delta y_{i}+\frac{\partial e_i}{\partial y_{i-1}} \Delta y_{i-1} \\ &= e_i+\alpha_i \Delta y_{i-1}+ \beta_i \Delta y_{i}+ \gamma_i \Delta y_{i+1} \\ &= e_i+\Delta y_{i-1}+\left(-2-(\Delta x)^2[-1+3(y_i)^2]\right)\Delta y_i+\Delta y_{i+1} \\\end{align}[/tex]
We treat the [itex]\Delta y_i's[/itex] as unknowns and set up the n equations so that each is set to zero (that will make each error term zero). Since each term includes an [itex]e_i[/tex] term as per the taylor series of any function, we put those e terms on the right hand side and end up with the matrix equation:
[tex]\mathbf{A}\mathbf{Y}=-\mathbf{E}[/tex]
The matrix of the coefficients of the delta y terms is tridiagonal because each e'i depends only on its nearest neighbors, the y+1, y, and y-1 variables. That's why the non-zero terms in the matrix go down diagonally. Right?
Solving this tridiagonal matrix equation gives us these values which we then add to the current values of y. Since there is a slight error associated with any taylor expansion, the results are not perfect. That's why iteration is necessary. Hope that helps. If not, which precise part of the algorithm is causing problems for you to understand?
Also, in regards to:
1) The physical problem is diffusion of electrons in a semiconductor laser.
Can you explain how you experimentally verified that the diffusion follows the solution to the BVP? For example, could the output be monitored by an O-scope or some other device which reflects the square-wave phenomenon? Just curious.
Thanks for all the help.
Experimentally we do it the following way.
We open a window on the n-side (substrate) of the semiconductor laser photolithographic ally and measure the spontaneous emission profile of the light, which theoretically should follow the carrier diffusion in the device. We expect a square current density profile (first term on the RHS (-ve)) and in accordance to that we expect almost square carrier diffusion in the device.
Here we are talking of the simplest type of semiconductor laser, i.e. a broad area laser.
We do the measurement below threshold (spontaneous emission) because above threshold (stimulated emission & lasing) the situation is extremely complicated, which I am actually trying to model.
This BVP is just a part of a bigger code which I am hope full will give me the results I am looking for.
I hope I have been able to explain things properly.
Now, the things you have explained about your recipe: I could already understand these stuff from the link:
http://homepage.univie.ac.at/Franz.Vesely/cp0102/dx/node74.html
What however what were unclear to me are the following things: why are these definitions needed. What purpose does these serve. Why is the author defining this stuff?
g(M-1)=-a(M)/beta(M);
h(M-1)=-e(M)/beta(M);
g(i-1)=-alpha(i)/(beta(i)+gamma(i)*g(i));
h(i-1)=(-e(i)-h(i))/(beta(i)+g(i));
How does he get dely1=e1;
May b the answers are trivial, but you see my math’s is very poor. I request you to kindly guide me.
Thanks,
Jam