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$

2 Answers 2

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$
4
  • $\begingroup$ Hi, Thanks. How do I then "call" these $b[n]$ values? I need to use these for another sum? $\endgroup$
    – Radz
    Jul 28, 2014 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, 2014 at 16:09
  • $\begingroup$ Dear @Chenminqi, Thanks. $\endgroup$
    – Radz
    Jul 29, 2014 at 1:09
  • $\begingroup$ Dear @Wouter, Thank you for your help. $\endgroup$
    – Radz
    Aug 11, 2014 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$
1
  • $\begingroup$ Hi, How do I then "call" these $b[n]$ values? I need to use these for another sum? $\endgroup$
    – Radz
    Jul 28, 2014 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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