values of a function at MANY points Log Out | Topics | Search
Moderators | Register | Edit Profile

FlexPDE User's Forum » User Postings » values of a function at MANY points « Previous Next »

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

Hossein Nili (hnili)
Member
Username: hnili

Post Number: 6
Registered: 02-2008
Posted on Thursday, June 12, 2008 - 05:36 am:   

Hi
If I am interested in the values of a function at many discrete points regularly distanced from each other is there a more efficient way than repeating the report(val(f,r,z)) command several times?
I am simulating an axially-symmetric problem in the cylindrical geometry and would like to see values of my function at these points:
(0,1),(0,1+1/3),(0,1+2/3),(0,2),(0,2+1/3),(0,2+2/3),(0,3),...,(0,18+1/3),(0,18+2 /3),(0,19)
Sorry for bothering you with all these numbers, I just wanted to give you a feel of how boring and time-consuming it is to calculate the values using report(val(f,...,...)) for every single point.
Is there a better way?
Top of pagePrevious messageNext messageBottom of page Link to this message

Marek Nelson (mgnelson)
Moderator
Username: mgnelson

Post Number: 42
Registered: 07-2007
Posted on Thursday, June 12, 2008 - 01:48 pm:   

There are a couple of ways to do this.

1) You can use a REPEAT statement inside a SUMMARY :

SUMMARY
REPEAT i=1 BY 1/3 TO 19
REPORT(VAL(f,0,i))
ENDREPEAT

2) If you want to export to a file, you can use the EXPORT(N) plot modifier on an ELEVATION plot. This will export the data in N evenly spaced intervals. See "Graphic Display Modifiers" in the Help index.

ELEVATION (f) FROM (0,1) TO (0,19) EXPORT (100)

This feature was recently fixed and you will need version 5.0.23 to use it. See the version 5 buglist for a link to the pre-release of this version.

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