I defined two 3-D vector functions, {Subscript[n,p][z_], Subscript[n,m][z_]} := {{p1[z],p2[z],p3[z]}, {m1[z],m2[z],m3 [z]}} where p? and m? are simple functions of z. When displayed they appear as expected. But when I tried to define the dyadics {Subscript[nn,p][z_], Subscript[nn,m][z_]} := {Outer[Times, Subscript[n,p][z], Subscript[n,p] [z]], Outer[Times, Subscript[n,m][z], Subscript[n,m] [z]]} I got the error message that the expression 'is incomplete, more input is needed'.
When I separate this into two independent commands, as Subscript[nn,p][z_] := Outer[Times, Subscript[n,p][z], Subscript[n,p][z]] Subscript[nn,m][z_] := Outer[Times, Subscript[n,m][z], Subscript[n,m][z]] no error is generated. Probably irrelevant, but I noticed that in both cases the outer brackets of the 'm' definition were slightly smaller than those of the 'p' definition.
To check the result I asked to display the inner product Subscript[nn,p][z].Subscript[n,p][z] and got the error message 'Recursion depth 256 exceeded'.
In fact, when, to reassure myself, I tried again to display Subscript [n,p][z], I got the same error message. So I went back over the definitions, and this time Subscript[nn,p][z].Subscript[n,p][z] produced the expected answer.
What could possibly be changing that sometimes, but not always, produces the error messages in these two cases? I'm at a loss to know what to watch out for.
> On Wed, 04 Nov 2009 00:41:31 -0600, dushan <dush...@spinn.net> wrote:
>> I defined two 3-D vector functions, >> {Subscript[n,p][z_], Subscript[n,m][z_]} := {{p1[z],p2[z],p3[z]}, >> {m1[z],m2[z],m3 >> [z]}} >> where p? and m? are simple functions of z. When displayed they appear >> as expected. But when I tried to define the dyadics >> {Subscript[nn,p][z_], Subscript[nn,m][z_]} := >> {Outer[Times, Subscript[n,p][z], Subscript[n,p] >> [z]], >> Outer[Times, Subscript[n,m][z], Subscript[n,m] >> [z]]} >> I got the error message that the expression 'is incomplete, more input >> is needed'.
On Nov 4, 12:19 am, dushan <dush...@spinn.net> wrote:
> To check the result I asked to display the inner product > Subscript[nn,p][z].Subscript[n,p][z] > and got the error message 'Recursion depth 256 exceeded'.
> <SNIP> > What could possibly be changing that sometimes, but not always, > produces the error messages in these two cases? I'm at a loss to know > what to watch out for.
Oops!
For this last problem I finally found the cause: I had inadvertently used the same symbol for two different definitions, one of which used the other definition. This of course would produce the recursivity that trip- ped me up. Strange how my mind could compartmentalize separate defini- tions without noticing they had the same label!
On Wed, 04 Nov 2009 00:41:31 -0600, dushan <dush...@spinn.net> wrote: > I defined two 3-D vector functions, > {Subscript[n,p][z_], Subscript[n,m][z_]} := {{p1[z],p2[z],p3[z]}, > {m1[z],m2[z],m3 > [z]}} > where p? and m? are simple functions of z. When displayed they appear > as expected. But when I tried to define the dyadics > {Subscript[nn,p][z_], Subscript[nn,m][z_]} := > {Outer[Times, Subscript[n,p][z], Subscript[n,p] > [z]], > Outer[Times, Subscript[n,m][z], Subscript[n,m] > [z]]} > I got the error message that the expression 'is incomplete, more input > is needed'.
> When I separate this into two independent commands, as > Subscript[nn,p][z_] := Outer[Times, Subscript[n,p][z], > Subscript[n,p][z]] > Subscript[nn,m][z_] := Outer[Times, Subscript[n,m][z], > Subscript[n,m][z]] > no error is generated. Probably irrelevant, but I noticed that in > both cases the outer brackets of the 'm' definition were slightly > smaller than those of the 'p' definition.
> To check the result I asked to display the inner product > Subscript[nn,p][z].Subscript[n,p][z] > and got the error message 'Recursion depth 256 exceeded'.
> In fact, when, to reassure myself, I tried again to display Subscript > [n,p][z], I got the same error message. So I went back over the > definitions, and this time > Subscript[nn,p][z].Subscript[n,p][z] > produced the expected answer.
> What could possibly be changing that sometimes, but not always, > produces the error messages in these two cases? I'm at a loss to know > what to watch out for.
> I defined two 3-D vector functions, > {Subscript[n,p][z_], Subscript[n,m][z_]} := {{p1[z],p2[z],p3[z]}, > {m1[z],m2[z],m3 > [z]}} > where p? and m? are simple functions of z. When displayed they appear > as expected. But when I tried to define the dyadics > {Subscript[nn,p][z_], Subscript[nn,m][z_]} := > {Outer[Times, Subscript[n,p][z], Subscript[n,p] > [z]], > Outer[Times, Subscript[n,m][z], Subscript[n,m] > [z]]} > I got the error message that the expression 'is incomplete, more input > is needed'.
That error message usually indicated missing brackets. However, the exact expressions that you posted do not produce any error messages. Did you use exactly these expressions or something slightly different?
> When I separate this into two independent commands, as > Subscript[nn,p][z_] := Outer[Times, Subscript[n,p][z], > Subscript[n,p][z]] > Subscript[nn,m][z_] := Outer[Times, Subscript[n,m][z], > Subscript[n,m][z]] > no error is generated. Probably irrelevant, but I noticed that in > both cases the outer brackets of the 'm' definition were slightly > smaller than those of the 'p' definition.
> To check the result I asked to display the inner product > Subscript[nn,p][z].Subscript[n,p][z] > and got the error message 'Recursion depth 256 exceeded'.
> In fact, when, to reassure myself, I tried again to display Subscript > [n,p][z], I got the same error message. So I went back over the > definitions, and this time > Subscript[nn,p][z].Subscript[n,p][z] > produced the expected answer.
> What could possibly be changing that sometimes, but not always, > produces the error messages in these two cases? I'm at a loss to know > what to watch out for.
> Okay, so it worked on your system but not on mine.
> Why? I'm not sure what I'm supposed to have learned from this.
> - Dushan
>> On Wed, 04 Nov 2009 00:41:31 -0600, dushan <dush...@spinn.net> wrote:
>>> I defined two 3-D vector functions, >>> {Subscript[n,p][z_], Subscript[n,m][z_]} := {{p1[z],p2[z],p3[z]}, >>> {m1[z],m2[z],m3 >>> [z]}} >>> where p? and m? are simple functions of z. When displayed they appear >>> as expected. But when I tried to define the dyadics >>> {Subscript[nn,p][z_], Subscript[nn,m][z_]} := >>> {Outer[Times, Subscript[n,p][z], Subscript[n,p] >>> [z]], >>> Outer[Times, Subscript[n,m][z], Subscript[n,m] >>> [z]]} >>> I got the error message that the expression 'is incomplete, more input >>> is needed'.