- #1
Shawj02
- 20
- 0
Hi guys,
I have a problem with Mathematica. The equation (see attachment) is SUPPOSE TO give:
n[0]=n0
n[1]=x0-n0
n[2]=x1-x0+n0
n[3]=x2-x1+x0-n0
n[4]=x3-x2+x1-x0+n0
n[5]=x4-x3+x2-x1+x0-n0
n[6]=x5-x4+x3-x2+x1-x0+n0-1
...
But when I put in n[1] I get the following errors and output:
Sum::itraw: Raw object 1 cannot be used as an iterator. >>
Sum::vloc: The variable 1 cannot be localized so that it can be assigned to numerical values. >>
Sum::itraw: Raw object 1 cannot be used as an iterator. >>
Sum::vloc: The variable 1 cannot be localized so that it can be assigned to numerical values. >>
[tex]\sum _{1=1}^1 (-1)^{1-1} x_{1-1}-n_0[/tex]
What do I need to change to give me an output of [tex] x_ 0 + n_ 0 [/tex]n[2] gives:
[tex] \sum _{2=1}^2 (-1)^2 x_{2-1}+n_0 [/tex]
when I want it to give me: [tex] x_1-x_0-n_0[/tex]
I have a problem with Mathematica. The equation (see attachment) is SUPPOSE TO give:
n[0]=n0
n[1]=x0-n0
n[2]=x1-x0+n0
n[3]=x2-x1+x0-n0
n[4]=x3-x2+x1-x0+n0
n[5]=x4-x3+x2-x1+x0-n0
n[6]=x5-x4+x3-x2+x1-x0+n0-1
...
But when I put in n[1] I get the following errors and output:
Sum::itraw: Raw object 1 cannot be used as an iterator. >>
Sum::vloc: The variable 1 cannot be localized so that it can be assigned to numerical values. >>
Sum::itraw: Raw object 1 cannot be used as an iterator. >>
Sum::vloc: The variable 1 cannot be localized so that it can be assigned to numerical values. >>
[tex]\sum _{1=1}^1 (-1)^{1-1} x_{1-1}-n_0[/tex]
What do I need to change to give me an output of [tex] x_ 0 + n_ 0 [/tex]n[2] gives:
[tex] \sum _{2=1}^2 (-1)^2 x_{2-1}+n_0 [/tex]
when I want it to give me: [tex] x_1-x_0-n_0[/tex]
Attachments
Last edited: