Author |
Message |
Jianlei Yu (physhark)
New member Username: physhark
Post Number: 1 Registered: 10-2007
| Posted on Wednesday, October 24, 2007 - 10:49 am: | |
Hi, I'm a new user. I'm trying to solve three coupled nonlinear equations . There are two steps: 1. Use "initial.pde" to calculate initial values for three variables and export data to "initial.data"; 2. Provide initial values for variables by importing data from "initial.data" and solve these equations. It seems that my scripts is right, but the results is obviously wrong. I think there is something wrong when I trasfer data from initial.pde to experiment.pde for the reason that jp0(which is 0 in initial.pde) is not equal to 0 in experiment.pde. How could I solve this problem? PS: The scripts are in the attachments. |
Robert G. Nelson (rgnelson)
Moderator Username: rgnelson
Post Number: 973 Registered: 06-2003
| Posted on Wednesday, October 24, 2007 - 01:45 pm: | |
Your script #includes a file definition.txt which you did not post. Please send us this file.
|
Jianlei Yu (physhark)
New member Username: physhark
Post Number: 2 Registered: 10-2007
| Posted on Wednesday, October 24, 2007 - 10:11 pm: | |
|
Robert G. Nelson (rgnelson)
Moderator Username: rgnelson
Post Number: 977 Registered: 06-2003
| Posted on Thursday, October 25, 2007 - 02:49 pm: | |
What you are seeing is the difference between computing an exponential and interpolating an exponential, multiplied by 1e8. Your jp equation in initial.pde is identically zero, since FlexPDE will expand the derivative of the exponential and cancel the terms. In experiment.pde, however, you are reading in tabulated values of np0 (nominally n0*exp(-k2*u0)) and interpolating with piecewise quadratics over the cells of the transfer mesh. Since the exponential function cannot be matched exactly by quadratic pieces, there are small deviations between the interpolation and the analytic value. You then differentiate this mismatch and multiply by 1e8. The result is the loopy function you observe in the output of experiment.pde. You should probably restrict the transfer to the value of U and recompute the exponentials.
|