Problem with (grad(S))^2 Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Problem with (grad(S))^2 « Previous Next »

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

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!
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 1219
Registered: 06-2003
Posted on Wednesday, March 04, 2009 - 02:25 pm:   

This looks to me like an ill-posed system.
At any point in space there are an infinite number of surfaces that satisfy the equation (ie, the given slope line rotated 360 degrees about the point).

Add Your Message Here
Post:
Username: Posting Information:
This is a private posting area. Only registered users and moderators may post messages here.
Password:
Options: Enable HTML code in message
Automatically activate URLs in message
Action:

Topics | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration