Sveta Bielykh (sveta)
New member Username: sveta
Post Number: 1 Registered: 02-2009
| Posted on Friday, February 13, 2009 - 03:52 pm: | |
Dear Mr.Nelson! I have to solve equation: (grad(S))^2=n^2, where S is a scalar function, n is a scalar too. I wrote the equation, boundary conditions, but flexPDE told me: '' Invalid floating-point operation''. Could you please tell me how to solve this problem? Here is my script: TITLE 'ray path' SELECT errlim=1.e-4 COORDINATES YCYLINDER VARIABLES S DEFINITIONS { parameter definitions } n_o=1.532 n_e=1.707 Lambda=0.532e-6 {wave length for testing beam} L=1.0e-5 {cell thickness} R_0=3.3e-5 {beam half-width} R0=4*R_0 {R0 is the scaling factor for R and z. It's important to choose the right scaling factor to avoid influence of the boundary conditions at R=R0} {Theta=pi/3} transfermesh('transferm_2.dat',Theta) {effective refractive index} n_eff(R,z)=n_o*n_e/sqrt(n_e^2*(sin(Theta))^2+n_o^2*(cos(Theta))^2) Sz=dz(S)/L Sr=dr(S)/R_0 Sa=grad(S) Sm=magnitude(Sa) EQUATIONS S: Sm=n_eff(R,z) BOUNDARIES region 'domain' start (0,0)value(S)=0 {value(S)=0} line to (1,0) natural( S)=0 line to (1,1) line to (0,1) natural( S)=0 line to close MONITORS { show progress } elevation(S) from (0,1) to (1,1) PLOTS { save result displays } grid(R,z) contour(S) elevation(S) from (0,0) to (0,1) elevation(S) from (0,0) to (1,1) elevation(S) from (0,1) to (1,1) {export format "#x#b#1" file="Retardation_2D.dat"} END Thank you! |