1
$\begingroup$

I have the following Values: $a[0]=1;a[1]=0;a[2]=0;a[3]=0;a[4]=\frac{g_2}{20};a[5]=0$.

I need to compute the value of $b[n]$ in the following equation

$$a[n]=\sum _{m=0}^{n} (m-2) \;\;a[m] \;\;b[n-m]$$ where $n=0,1,2,3,4,5$.

For $n=0$, I get the value of $b[0]$.

For $n=1$, I get the value of $b[1]$ using the value of $b[0]$.

For $n$th iteration, I get the value of $b[n]$ using the values of $b[n-1],b[n-2],\dots,b[0]$.

The values of $b[n]$ will then be used to solve for another variable, say, $c[n]$, for $n=0,1,2,3,4,5$.

Is there any simple way of doing this in Mathematica? I am basically doing one iteration at a time (using the Solve command), which is very tedious.

Thanks, Radz.

$\endgroup$
3
$\begingroup$
a[0] = 1; a[1] = a[2] = a[3] = a[5] = 0; a[4] = g2/20;
funcs = Table[a[n] == Sum[(m - 1) a[m] b[n - m], {m, 0, n}], {n, 0, 5}]
var = b /@ Range[0, 5]
Solve[funcs, var]

enter image description here

$\endgroup$
  • $\begingroup$ Hi, Thanks. How do I then "call" these $b[n]$ values? I need to use these for another sum? $\endgroup$ – Radz Jul 28 '14 at 14:18
  • 1
    $\begingroup$ soln = Solve[eqns, Array[b, 6, 0]] and then Evaluate[Array[b, 6, 0]] = Flatten[Array[b, 6, 0] /. soln] $\endgroup$ – Wouter Jul 28 '14 at 16:09
  • $\begingroup$ Dear @Chenminqi, Thanks. $\endgroup$ – Radz Jul 29 '14 at 1:09
  • $\begingroup$ Dear @Wouter, Thank you for your help. $\endgroup$ – Radz Aug 11 '14 at 2:07
1
$\begingroup$
Evaluate[Array[a, 6, 0]]= {1, 0, 0, 0, c, 0};
eqns = Table[ a[n] == Sum[(m - 2) a[m] b[n - m], {m, 0, n}], {n, 0, 5}];
Solve[eqns, Array[b, 6, 0]]`
{{b[0]->-(1/2),b[1]->0,b[2]->0,b[3]->0,b[4]->-c,b[5]->0}}
$\endgroup$
  • $\begingroup$ Hi, How do I then "call" these $b[n]$ values? I need to use these for another sum? $\endgroup$ – Radz Jul 28 '14 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.