how to evaluate with certain conditions and how to use arrays instead of separate variables



Does something like

   (%i90) [f1,f2,f3] : block([a:1,b:2,c:4], [a+b,a-b, a*c]);
   (%o90) [3,-1,4]

work for you?  Or maybe

  (%i92) [f1,f2,f3]  : subst([a = 1,b = 2,c = 4],[a+b,a-b, a*c]);
  (%o92) [3,-1,4]

For substitutions, it's best to not use 'ev.'  The function 'ev' is has some subtle tricky behavior (that
other people on this list could explain better than I can).


If you compile your code (use compile_file("diode.txt")), the diode.UNLISP file will show that there are
some undeclared variables; for example

  note: translating current
  warning: encountered undefined variable csat in translation.
  warning: encountered undefined variable vte in translation.
  warning: encountered undefined variable ckt__CKTgmin in translation.

Maybe these are need to be declared, maybe they are global.

--Barton
________________________________
From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of foelsche at sbcglobal.net [foelsche at sbcglobal.net]
Sent: Saturday, December 01, 2012 16:24
To: maxima at math.utexas.edu
Subject: how to evaluate with certain conditions and how to use arrays instead of separate variables

I?m trying to avoid writing conditions (values of variables) repeatedly.
And I?m trying to avoid having to write n^2 lines of code for getting n^2 number of results
-- is there some way to use arrays?
See attached.
This code does still not evaluate -- it hangs.

Peter