[Maxima] Complicated functions fail to keep plotting
rvh2007 at comcast.net
Mon Apr 14 11:26:51 CDT 2008
Sorry, I posted this after a jpg plot attachment was deleted by the list administrator. He suggested just submitting the source code. Just disregard. I will repost when I have a better phrasing of my issues. The plot would have made it easier, a picture is worth a thousand words...
From: "Robert Dodier" <robert.dodier at gmail.com>
To: "Richard Hennessy" <rvh2007 at comcast.net>
Cc: "Maxima List" <maxima at math.utexas.edu>
Date: Mon, Apr-14-2008 0:42 AM
Subject: Re: [Maxima] Complicated functions fail to keep plotting
On 4/13/08, Richard Hennessy <rvh2007 at comcast.net> wrote:
> The eval_string does not work.
If you tell us what happens, I think it's more likely we can offer advice.
> The stringout send the output to text files which I plotted using my own program.
It may well be the best way to use Maxima for this problem
is to just generate the numbers and dump them into a file,
and then use Gnuplot or whatever separately.
> Does anyone know how to do this?
What are you trying to accomplish? I'm rather puzzled by the way
stuff is organized, which suggests I don't understand what you're
getting at. Which is too bad because this seems like an interesting
problem, I just can't tell what's going on.
> for e:0 thru 600 do
> for n : 2 thru 400 step 2
> f[e](x):=min(2.5, block([p,i,xf],xf:bfloat(1),p:c[0,e],
> for i : 1 thru 200 do (xf:xf*x*x, p:p+c[2*i,e]*xf), p)^2));
My advice is to replace 200, 400, and 600 with symbolic values
(N1, N2, N3, whatever) to make it easier to try different stuff.
If not easier for you, then certainly for us.
> for i: 1 thru 20 do
It may not matter, but the right way to build up an expression
is to use the buildq function which works directly with Maxima
makelist (buildq ([i], explicit (f [i] (x), x, - 4, 4, y, i/(600*50),
i/(600*50))), i, 1, 20);
Again, this may not matter, but quoting eval_string prevents it
from being called, so 'eval_string(foo) has no effect ....
> for e : 0 thru 600 do stringout(concat("c:/rich/plist",
> string(e), ".txt"),
> makelist([(x-300)/300*4,e/600*50,f[e]((x-300)/300*4)], x,
> 1, 600));
I don't understand why there are 600 output files.
It appears you want a contour plot or surface plot --
why not dump all the numbers into one file?
This may not matter either, but concat is happy with non-string
atoms such as integers, so: concat("foo", 123, ".txt") => "foo123.txt"
Sorry I can't be more helpful -- maybe you can back up a bit
and give us a little context.
More information about the Maxima