Newbie troubles Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Newbie troubles « Previous Next »

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

Alien (alien)
New member
Username: alien

Post Number: 1
Registered: 09-2004
Posted on Monday, September 27, 2004 - 12:39 pm:   

Hi,
I'm trying my very first test with FlexPDE and I have some troubles: in the attachment I put a small .pde file that is supposed to move a gaussian charge packet inside a constant electric field.
I get strange results as you can see trying it.
I'm sure I'm missing something :-)

Can you help?
Thank you!

application/octet-streamPDE file
testxy.pde (0.6 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 224
Registered: 06-2003
Posted on Monday, September 27, 2004 - 06:18 pm:   

There are several problems here:

1) In a 2D domain with derivative coupling only in a single direction, the finite element equations can sustain oscillatory solutions, because the discretized nodal equations involve only integrals over the mesh cells. Introducing a small diffusion in the cross dimension can stabilize the solution, but leads to a gradual smearing of the initial shape. It also requires a "tautological" natural boundary condition "-normal(ky*dy(rho))" top and bottom to define the surface terms generated by the divergence theorem. A finer mesh also helps resolve the profile.

2) Pure convection is a system the Galerkin finite element method does not like very much. Unmodified Galerkin equations are oscillatory in this circumstance. FlexPDE uses a Petrov-Galerkin weighting scheme which is similar in effect to "upwind" differencing in finite difference methods. This process stabilizes the solution, but it does it by introducing a fictitious diffusion in the propagation direction, again causing a smearing of the wave shape. The selector "upfactor" is a multiplier applied to the default upwind term, and can be used to decrease the smearing effect at the risk of inducing oscillation.

3) Quadratic interpolation in the mesh cells cannot resolve a circular Gaussian shape very well, so a dense mesh is required to maintain the wave shape in the presence of discretization errors. This effect is of course strongest when the shape is very sharply peaked.

In the attached script, I have broadened the initial figure to sigma=10, introduced a y-diffusion term, applied a factor 0.1 to the default upwinding, and added a spatial accuracy control to keep a dense mesh around the peak.

The profiles at beginning and end are shown below.


application/octet-stream
testxy2a.pde (1.0 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Alien (alien)
New member
Username: alien

Post Number: 2
Registered: 09-2004
Posted on Tuesday, September 28, 2004 - 03:38 am:   

Hi Robert,
thank you very much! I will look into your corrections: btw, running your fixed version on my machine produces very different results (see attachment)
Is it ok?
I'm running FlexPDE 4.1.1 on a Linux machine (Fedora 1).

image/pngscrennshot
fixed.png (24.8 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 225
Registered: 06-2003
Posted on Tuesday, September 28, 2004 - 03:03 pm:   

This is weird. I'll look into it.
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 226
Registered: 06-2003
Posted on Tuesday, September 28, 2004 - 03:37 pm:   

Did you run the problem testxy2a exactly as I posted it?
I ran this file on RedHat 9, and got the same answer as with Windows.
If you left out some of the modifications, it might be unstable.
Do a file compare of testxy2a.pde with your original to make sure you got all the mods.
Top of pagePrevious messageNext messageBottom of page Link to this message

Alien (alien)
Junior Member
Username: alien

Post Number: 3
Registered: 09-2004
Posted on Wednesday, September 29, 2004 - 04:37 am:   

Hi Robert,
yes, I am using exactly the file you posted: I have re-downloaded it (just to be sure) and I obtain the same troublesome scenario... The downloaded file is exactly the same of your post (part from unix/dox EOLs...)

I'm using a plain Fedora 1 machine, that means
gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
Linux 2.4.22-1.2115.nptl
Please ask if you need more details.




Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 227
Registered: 06-2003
Posted on Wednesday, September 29, 2004 - 04:09 pm:   

This had me mystified for a while, but the answer is quite simple:

I infer that you are using a student version of FlexPDE. This version has a restricted mesh size, which is insufficient to resolve the shape of the pulse. The errors incurred in crude meshing accumulate and eventually become unstable.

The attached file is encoded to run in the demo and student versions with no restrictions on mesh size. You should be able to run this script and get the same result I posted earlier.
application/octet-stream
testxy2b.pde (1.0 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Alien (alien)
Member
Username: alien

Post Number: 4
Registered: 09-2004
Posted on Thursday, September 30, 2004 - 03:33 am:   

Hi Robert,
yes, I'm using a student version and now it works as expected.
Thank you!

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