Plot in a 1D problem Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » Plot in a 1D problem « Previous Next »

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

Jamy (neo)
New member
Username: neo

Post Number: 1
Registered: 08-2006
Posted on Wednesday, August 16, 2006 - 08:06 am:   

Hello!


I am solving a 1D problem where the electric field E(x, t) is evolving in time as per the Helmholtz equation (1D). I want to plot the time evaluation for E(x) vs t for all x. In other words, I need to plot E(x) from x = -a to x = +a (‘a’ is a known number) vs ‘t ’ from t = 0 to t = T. How can I plot this in Flex PDE ?

I tried the history option, but with it I can plot E only at x = given point and not for the whole range of x. I am new to time dependent problems in FlexPDE so please advice.

Also, I need to know whether the following declaration of a space dependent parameter:


J = (exp(-(-x-50)/14))*(if x>=-256 and x<-50

then 1 else 0)+(if x>=-50 and x<=50 then 1 else

0)+(exp(-(x-50)/(14)))*(if x>50 and x<=255 then

1 else 0)


can lead to a problem (instability) in the evaluation in FlexPDE. Should I use RAMP/Swage, instead of using the if, then, else construct. In that case please tell me how to write the above statement using RAMP/Swage.

JM
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 672
Registered: 06-2003
Posted on Wednesday, August 16, 2006 - 03:47 pm:   

1.
Unfortunately, there is currently no mechanism for plotting time and distance both as coordinates in a 2D plot.

The best I can offer is to plot the history at several x-points and/or the x-distribution at several times.

2.
It appears that your expression is continuous, so it should cause no instability. Be sure to include the points x=-50 and x=50 as explicit coordinates in your domain layout, so that the break points will be resolved.

Also, it appears that this could be represented more compactly as
J = MIN(exp((50-abs(x))/14, 1)

Top of pagePrevious messageNext messageBottom of page Link to this message

Jamy (neo)
New member
Username: neo

Post Number: 2
Registered: 08-2006
Posted on Wednesday, August 16, 2006 - 03:53 pm:   

Robert,

Thanks for the reply. Is it possible to export the E(x) vs t solution for t = 0 to t = T in some format and then plot it the way I want? Please advice.

JM
Top of pagePrevious messageNext messageBottom of page Link to this message

Jamy (neo)
Junior Member
Username: neo

Post Number: 3
Registered: 08-2006
Posted on Thursday, August 17, 2006 - 11:21 am:   

I have one more question. You suggest to include the points x=-50 and x=+50 in the domain layout. There is no physical boundary at these 2 points hence no boundary conditions. Please elaborate on this suggestion of yours. Also the suggested MIN function is not working.FlexPDE says wrong number of arguments. Please advice.
Top of pagePrevious messageNext messageBottom of page Link to this message

Robert G. Nelson (rgnelson)
Moderator
Username: rgnelson

Post Number: 673
Registered: 06-2003
Posted on Thursday, August 17, 2006 - 07:52 pm:   

1.
There are lots of ways to export data.
You could export it as VTKLIN and use VisIt.
Or as TECPLOT and use TECPLOT.
Or as tabular export using TABLE and a format string, depending on what you want to read it with.
See "Exporting" in the Help Index for more discussion.

2.
In 1D, you can insert explicit points in the layout simply by including them in the list:
START(a) LINE TO (b) TO (c) TO (d)
This forces nodes at these points, but makes no requirement of properties change.
Interior boundary conditions are always Natural()=0 (ie, flux conservation) unless stated otherwise.

Min takes 2 arguments.
The statement I gave in my previous post is missing a parenthesis after the 14. Sorry.

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