Re: Functional programming
- To: mathgroup at smc.vnet.net
- Subject: [mg4164] Re: Functional programming
- From: Paul Abbott <paul at earwax.pd.uwa.edu.au>
- Date: Sat, 8 Jun 1996 13:25:17 -0400
- Organization: University of Western Australia
- Sender: owner-wri-mathgroup at wolfram.com
Victoria Steblina wrote: > 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. I think that this is what you want: d = {1, 2, 3, 4}; b[{S_,P_,N0_}] = (1+S)^(P/2)/Sqrt[N0]; ParamList = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}; The normalised expression is then d / (b /@ ParamList) 6 3 2 Sqrt[-] 8 Sqrt[--] Sqrt[3] 5 9 11 {-------, ---------, ----, ----------} 2 25 4096 161051 Cheers, Paul _________________________________________________________________ Paul Abbott Department of Physics Phone: +61-9-380-2734 The University of Western Australia Fax: +61-9-380-1014 Nedlands WA 6907 paul at physics.uwa.edu.au AUSTRALIA http://www.pd.uwa.edu.au/Paul _________________________________________________________________ ==== [MESSAGE SEPARATOR] ====