The command-line syntax
sdlfskdljf, sdfsdf ;
is a syntactic shortcut for ev(sdlfskdljf, sdfsdf), which you can use within
your for-loop.
However, I warn you that the semantics of 'ev' are extremely messy and
rarely appropriate for programmatic use.
The cleaner way to do this is to use substitution, e.g.
specificEquations : subst(p=i,myEquations)
or even better
specificEquations : subst(i,'p,myEquations)
Writing 'p rather than p ensures that if p happens to have an assigned
value, that won't interfere with the intended operation.
-s
On Thu, Jan 6, 2011 at 14:30, Michael Knudsen <micknudsen at gmail.com> wrote:
> Hi,
>
> I have a list of equations called myEquations, and they all depend on
> a single parameter p. Using a command like
>
> specificEquations : myEquations, p = 1;
>
> one gets a new list, specificEquations, containing the original
> equations with 1 substituted for the variable p. So far, so good!
> However, if I try to do something similar in a for loop, something
> strange happens.
>
> for i from 1 thru 10 do (
>
> (specificEquations : myEquations, p = i),
> print(specificEquations)
>
> );
>
> Here all print statements yield the same output, which is just
> myEquations with no value substituted for p.
>
> What am I missing here? Thanks in advance!
>
> Michael Knudsen
>
> --
> Michael Knudsen
> micknudsen at gmail.com
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>