Stages, recurrent Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Stages, recurrent « Previous Next »

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

Olexiy Orel (scorpion)
Member
Username: scorpion

Post Number: 7
Registered: 03-2007
Posted on Sunday, January 11, 2009 - 03:24 am:   

Hello everyone, please help me with a following issue.
I have a time-dependent problem. And it includes two constraints. Since constraints chapter is invalid in time-dependent problems, I decided to use stages instrument for the same problem.
But in one my equation I have dt(C) member. If n is a stage number, then I can my equation represent in a following way:
C(n+1)=C(n)+n*(...)
Everything would be OK if I could somehow save the result of solving n-th stage step and add to it a small correction. Can I do that? May be I could every stage step export equation solving result to the file, then import it again and use it.
So, I need result of n-th step use in (n+1)-th step directly.
Help says that the result of each step will be an initial value for the next step. But how can I use it?
C=initial value+...?
May be new version of FlexPDE can help me?
Thank you very much for your attention.
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 1206
Registered: 06-2003
Posted on Sunday, January 11, 2009 - 02:21 pm:   

The constriant section was implemented in order to provide mass/particle conservation information that is lost when converting a time-dependent equation to a steady-state form.

Normally, conservation of fundamental quantities is implicit in the time dependent equations, and there is no need for integral constraints. So I am a little curious what kind of constraint you wish to apply that is not already inherent in the time dependent equations.

FlexPDE will allow you to write a constraint equation in a time-dependent system. But you will have to ensure that the constraint is not in conflict with the implications of the other equations.

There is no mechanism in staged problems for referencing the values of an earlier stage.
Top of pagePrevious messageNext messageBottom of page Link to this message

Olexiy Orel (scorpion)
Member
Username: scorpion

Post Number: 8
Registered: 03-2007
Posted on Monday, January 19, 2009 - 02:53 pm:   

Hello Robert,
I have an interesting issue concerning constraints.
I have attached a file. That is a steady-state problem which contains constraints. 2 anodes are the source of active ions, 2 kathodes consume ions. Diffusion. The system is symmetrical. Constraints represent that total current which goes through 4 electrodes equals zero.
The picture is nice. But there are 3 comment strings at the end of the file. If I make them active - the problem becomes time-dependent. The equation is the same, it does not contain time, so one might suppose that every step I should get the same result like if the problem were steady-state. But the picture is different and pretty strange. Why? If I remove constraints - everything is fine. So it seems that constraints in time-dependent problem work strangely.
Also in a file there is a string 'nodelimit=800'. If I remove it, I get an error 'Special Boundaries Don't Match'. Please tell me what does that mean.
Thank you in advance

application/octet-streamMy problem
solo_C0.pde (2.4 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 1213
Registered: 06-2003
Posted on Tuesday, January 20, 2009 - 07:02 pm:   

The real question is why FlexPDE doesn't complain when the Nodelimit is included!

What you have done is not consistent with the intended use of Periodic boundaries (see PERIODIC in the Help Index).

If you draw a figure, then make a copy of the figure and place it alongside the original, with a matching boundary at the contact, then the matching boundary can be declared PERIODIC in the first figure, and the second figure can be deleted.

You have not done this. You have declared two segments of the same boundary to be periodic images, when there is no way that two copies of the domain can be constructed by placing these segments in contact.

I don't know what you intended to gain by the Periodic declaration, but you don't need it in this problem.
Top of pagePrevious messageNext messageBottom of page Link to this message

Olexiy Orel (scorpion)
Member
Username: scorpion

Post Number: 9
Registered: 03-2007
Posted on Wednesday, January 21, 2009 - 11:08 am:   

Robert,
the system is symmetrical and sometimes it takes many hours to evaluate 3 cycles, so the idea was that using periodic function could help FlexPDE in solving equations faster. I think it worked out. But ok, I did it like it was before - without periodic function. Please see new program.
Now the problem is defined correctly. But the question still remains: using constraints in steady-state mode and time-dependent mode leads to different results. Although the equation and BC's are the same. The only difference is that in second case 3 strings are commented out (
{Time 0 to 6*pi/omega

Halt 10^(-20)}

plots

{for t=0 by pi/(2*omega*1000) to 6*pi/omega})

I like how constraints worked for steady-state problem. I need to get the same for each step in time-dependent mode. Can I do that?
Thank you for your help.
I didn't really understand what nodelimit makes. What number do you suggest me to put? For example, if I comment out string that contains nodelimit - the calculation takes long. The default nodelimit number is huge.
application/octet-stream
solo_C0.pde (2.3 k)
Top of pagePrevious messageNext messageBottom of page Link to this message

Marek Nelson (mgnelson)
Moderator
Username: mgnelson

Post Number: 109
Registered: 07-2007
Posted on Sunday, January 25, 2009 - 06:09 pm:   

I don't really understand why you are trying to make this a time-dependent problem. The equations do not have any time dependence. If you run this as a steady-state problem it finishes quite quickly without explicit contraints (the contraints are met by the equations themselves.)

You have asked for an error limit of 1e-7 which causes FlexPDE to regrid densely, but then you limit the number of nodes... Just ask for a higher error limit and FlexPDE will not grid so densely. Try 1e-5 (and remove the node limit) and the steady-state problem finishes in about 3 seconds.
Top of pagePrevious messageNext messageBottom of page Link to this message

Olexiy Orel (scorpion)
Member
Username: scorpion

Post Number: 10
Registered: 03-2007
Posted on Friday, January 23, 2009 - 03:55 am:   

Also please let me ask another question.
Can I set a following problem:
u - global variable, C0, Ñ1, C2, C3 - variables. Equations:
u: bintegral(normal(grad(C2)),"anode 1")=-bintegral(normal(grad(C2)),"anode 2")
or even simple u=0
C1: dt(C1)=(Dif/visc)*del2(C1)-1e-2*(vx*dx(C0)+vy*dy(C0))*sin(2*pi*omega*t)
C2: dt(C2)=(Dif/visc)*del2(C2)-1e-2*(vx*dx(C1)+vy*dy(C1))*sin(2*pi*omega*t)
C3: dt(C3)=(Dif/visc)*del2(C3)-1e-2*(vx*dx(C2)+vy*dy(C2))*sin(2*pi*omega*t)

Boundary: value(C2)=u on anodes.
So it's pretty specific problem: value of a variable on anodes equals global variable. Sometimes such problem runs, sometimes - doesn't.
I attach my scripts - for C0 and for the rest. Result of solving C0 transfers to the second script.
Thank you so much, I feel shamed for taking your time.
application/octet-streamC0
solo_C0.pde (2.3 k)

Ñ2.pde,application/octet-streamthe rest
Ñ1 (6.5 k)

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