Re: Subscripted variables and function definitions
- To: mathgroup at smc.vnet.net
- Subject: [mg65215] Re: [mg65192] Subscripted variables and function definitions
- From: "David Park" <djmp at earthlink.net>
- Date: Sat, 18 Mar 2006 06:40:36 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
You could go to MathSource on and get Ted Ersek's SubscriptSymbols package. In most cases you won't need the Notations package but in the few cases that you do Ted's package will handle it for you. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: Geico Caveman [mailto:spam at spam.invalid] To: mathgroup at smc.vnet.net Hi I am trying to define a function (using the front end - I will be using latex syntax in this post to make clear what I am doing) : A[k_s_,r_t_,r_k_]:=... Now after this, if I try to output A[1,1,1], it just throws A[1,1,1] back. However, if I define : A[ks_,rt_,rk_]:=... it gives the right answer. Two questions : 1. Why aren't subscripted variable names treated the same as other variable names in this context ? 2. Is there a way to coax Mathematica into doing what I am trying to do above ? Mathematica is a nice system, but it has these highly irritating quirks. Another (unrelated) question : I have a 4x4 matrix which is a function of some variables : A:=... (function of r1,r2,r3, ...) f:=... (function of the same variables) X:=Inverse[A] . f Now, I want to extract a ratio : X/(X+X) and assign it to a function : g[r1_,r2_,r3_]:=X/(X+X) A test evaluation of g[1,1,1] throws g[1,1,1] back. Makes no sense at all to me. What am I missing, and why is Mathematica so unintuitive here ?