Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. In[1]:= A = 1.5;
  2. B = 2;
  3. In[3]:= Comatrix = {
  4. {-(A + 2*B), 3*B, 0, 0, 0, 0, 0, 0, 0},
  5. {A, -(A + 3*B), 4*B, 0, 0, 0, 0, 0, 0},
  6. {0, A, -(A + 4*B), 5*B, 0, 0, 0, 0, 0},
  7. {0, 0, A, -(A + 5*B), 6*B, 0, 0, 0, 0},
  8. {0, 0, 0, A, -(A + 6*B), 7*B, 0, 0, 0},
  9. {0, 0, 0, 0, A, -(A + 7*B), 8*B, 0, 0},
  10. {0, 0, 0, 0, 0, A, -(A + 8*B), 9*B, 0},
  11. {0, 0, 0, 0, 0, 0, A, -(A + 9*B), 10*B},
  12. {0, 0, 0, 0, 0, 0, 0, A, -(10*B)}
  13. };
  14. In[4]:= Nmatrix[t_] = {N2[t], N3[t], N4[t], N5[t], N6[t], N7[t], N8[t],
  15. N9[t], N10[t]};
  16.  
  17. In[5]:= system = Derivative[1][Nmatrix][t] == Comatrix . Nmatrix[t];
  18.  
  19. In[6]:= sol = DSolve[{system, N2[0] == 1, N3[0] == 0, N4[0] == 0, N5[0]
  20. == 0, N6[0] == 0, N7[0] == 0, N8[0] == 0, N9[0] == 0, N10[0] == 0},
  21. {N2, N3, N4, N5, N6, N7, N8, N9, N10}, t];
  22.  
  23. In[7]:= {N2ans[t_], N3ans[t_], N4ans[t_], N5ans[t_], N6ans[t_],
  24. N7ans[t_], N8ans[t_], N9ans[t_], N10ans[t_]} = {N2[t], N3[t],
  25. N4[t], N5[t], N6[t], N7[t], N8[t], N9[t], N10[t]} /. Flatten[sol];
  26.  
  27. In[8]:= f[t_] = 2*B*N2ans[t];
  28. Integrate[t*f[t], {t, 0, Infinity}]
  29.  
  30. Out[9]= 0.326222
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement