MathGroup Archive 1996

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

Search the Archive

Re: Functional programming; Outer; NonlinearFit

  • To: mathgroup at smc.vnet.net
  • Subject: [mg4156] Re: Functional programming; Outer; NonlinearFit
  • From: rhall2 at umbc.edu (hall robert)
  • Date: Sat, 8 Jun 1996 13:23:52 -0400
  • Organization: University of Maryland, Baltimore County
  • Sender: owner-wri-mathgroup at wolfram.com

In article <4p35q5$n9o at dragonfly.wolfram.com>,
vvs124 <vvs124 at rsphy1.anu.edu.au> wrote:

>First - I want to renormalize the list d 
>d := {1, 2, 3, 4}               
>
>according to the rule
>Renorm[{S_, P_, N0_}] = d/b    
>
>where
>b := (1+S)^(P/2)/(Sqrt[N0]). 
>
>Parameters S, P and N0 are defined in the 
>ParamList := {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}
>
>each set {S, P, N0} corresponding to the respective value of d in the
>list.

Try
In[5]:=
  d = {1, 2, 3, 4};
  ParamList = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}};
  b := (1+#1)^(#2/2) / Sqrt[#3] &;
  d / Apply[b, ParamList, 2]
Out[8]=
                   6                3
            2 Sqrt[-]        8 Sqrt[--]
   Sqrt[3]         5    9           11
  {-------, ---------, ----, ----------}
      2        25      4096    161051

Division is a variant of Times[], which is listable. Once you have
two lists of values, just divide one list by the other, e.g.

In[13]:=
  {1, 2, 3} / {x, y, z}
Out[13]=
   1  2  3
  {-, -, -}
   x  y  z


-- 
Bob Hall            | "Know thyself? Absurd direction!
rhall2 at gl.umbc.edu  |  Bubbles bear no introspection."  -Khushhal Khan Khatak

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: desperately seeking better minimax approximation package
  • Next by Date: Langauge L to Mathemtaica ?
  • Previous by thread: Functional programming; Outer; NonlinearFit
  • Next by thread: Forthcoming book - "Experiments in Undergraduate Mathematics"