MathGroup Archive 2010

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

Search the Archive

Create and use a set of values for variables

  • To: mathgroup at smc.vnet.net
  • Subject: [mg107519] Create and use a set of values for variables
  • From: Menl <szegersnl at gmail.com>
  • Date: Mon, 15 Feb 2010 05:49:09 -0500 (EST)

Hi, 

I try to find a method of doing the following in Mathematica. 

I have some function y[x_]=a x^2 + b x + c 
Now I want some list which hold values for a, b and c. that are dependend on some lower level values d, e and f. 

vars1=[{d=1, e=4, f=6},{b=d+e, c=2f, a = d^2}] 
vars2=[{d=2, e=3, f=7},{b=d+e, c=2f, a = d^2}] 
vars3=[{d=5, e=5, f=1},{b=d+e, c=2f, a = d^2}] 

and use these sets with the original function when I need it. 

This line will not work as intended of course but I hope it makes it clear what I try to do. The key is I would like to not evaluate these values outside this vars, so the original function stays unevaluated. 

Something like this I tried to do with either the functions Block or With, but both evaluate the values for a, b and c. I would like to make several such sets of variables without evaluating them so I can use them as desired, to plot the original function with several sets of vars.


  • Prev by Date: can't get ListVectorPlot3D to work.
  • Next by Date: Re: May we trust IntegerQ ?
  • Previous by thread: Re: can't get ListVectorPlot3D to work.
  • Next by thread: Re: Create and use a set of values for variables