MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

Reading in equations for evaluation


Within a Mathematica 3.0.1 notebook I would like to read in
a set of expressions that can be then be used (evaluated).

Example,

  (* Input table of events from a file -- defines liste *)
      ...
  file contains (e values):
      200
      190
      210
     ...
  (* Input expr1, expr2 from a file. These define in symbolic form, the
equations
        to be used to calculate the other events *)
   ...
   file contains (equations for start,stop events):
     e - 40
     e - 150
   ...
(* Now apply these equations to the events in the event file
   to form a list of start, stop events *)
    StrtEvents = {}; StopEvents = {};
    Do[
        e = liste[[k]];
        strt = expr1;  (* strt = e - 40; *)
        stop = expr2;  (* stop = e - 150; *)
        StrtEvents = Append[StrtEvents,strt];
        StopEvents = Append[StopEvents,stop];
    ,{k,1,Length[liste]}
    ];

Now the new event lists should contain:

  StrtEvents = {160,150,170}
  StopEvents = {10,0,20}

How can one accomplish this in Mathematica?

-- Virgil



  • Prev by Date: RE: Avoid meshing
  • Next by Date: Re: A little problem with positive numbers
  • Previous by thread: Re: RE: Avoid meshing
  • Next by thread: Exponential Function and Expand