How to implement iteration algorithm ... Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » How to implement iteration algorithm in FlexPDE? « Previous Next »

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

Yong Wang (yw3)
New member
Username: yw3

Post Number: 2
Registered: 06-2005
Posted on Wednesday, June 01, 2005 - 11:41 pm:   

hi:
I am using the student version of FlexPDE and I have an iterative algorithm in my mind. At the beginning of the iterative algorithm, part of the boundary conditions is unknown and zero value is used as initial guessing to solve the PDE(Laplace equation). In each iteration, the boundary condition will be updated according to the solution of previous iteration.Finally the accurate solution can be obtained. My questiones are:

1) How to implement iterations in FlexPDE ? The geometry is not changed. The same problem is solved under different boundary conditions in each iteration.Can I use For Loop?

2) How to update the boundary conditions by using the solution of previous iteration ?

Thank you very much for your help!
Yong
Top of pagePrevious messageNext messageBottom of page Link to this message

Yong Wang (yw3)
Junior Member
Username: yw3

Post Number: 3
Registered: 06-2005
Posted on Thursday, June 02, 2005 - 11:55 am:   

After reading FlexPDE documents, I think my problems can be solved using Stage. But I still have a problem:

In my algorithm, the type of the boundary condition for a boundary is changing from one stage to next stage. For example, for boundary 1, in the first stage, I put Dirichlet boundary condition on it. in the second stage, I put Neumann boundary condition on it. In the third stage, I put Dirichlet boundary condition on it again. and so on... THe boundary condition type is alternating.
I do not know how to change the boundary condition type for each stage. ?

Please give some help! THanks a lot!
Yong
Top of pagePrevious messageNext messageBottom of page Link to this message

Yong Wang (yw3)
Member
Username: yw3

Post Number: 4
Registered: 06-2005
Posted on Thursday, June 02, 2005 - 05:18 pm:   

Hi:
I did not find the direct way to implement above alternating boundary type. However I designed a short code to simulate the alternating changing of boundary type by using two state variables. I attached the pde file here.

Unfortunately I do not know why it is not converging. I just began to use FlexPDE yesterday, so I do not have any experence and idea about this problem. Can some firend kindly go through the short code and help me to
fix the problem?

Thank you very much!
Yong
application/octet-streamalternating boundary condition
new2.pde (1.5 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 373
Registered: 06-2003
Posted on Thursday, June 02, 2005 - 07:00 pm:   

I'm not sure what you are trying to accomplish here.

The principle of FlexPDE is that you don't try to describe the solution procedure. You describe the PDE system and let FlexPDE figure out the solution procedure.

In keeping with this idea, you should just describe the mathematical statement of the PDE and boundary conditions.

Unless your alternation of states is supposed to reflect an alternation that is going on in the physical system?

ALTERING BOUNDARY CONDITIONS:
FLexPDE will not let you change the class of boundary condition (from VALUE to NATURAL) during a run (even a staged run). You can pose a NATURAL BC that is effectively a VALUE BC by the following:
NATURAL(u)=large_number*(U0-u)
(Note that the sign of this term depends on the sign of the Laplacian in your equation. You want a restoring flux that pulls u to U0.)

CONVERGENCE FAILURE:
I don't know why this fails to converge. But if you separate the stages and run the second one as an independent problem, it converges. So the fact that as a second stage it is starting from the solution of the first stage has somehow created an indeterminate equation. But given that I don't understand why you are doing this alternation in the first place, I'm not going to pursue the issue right away.

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