# Unknown error in NDSolve and other issues

Posted 9 years ago
5203 Views
|
3 Replies
|
0 Total Likes
|
 With the help of NDSolve I try to solve a very simple BVP: $Av''(t)+Bv(t)=f(t),$where A, B are 5x5 constant matrices, f(t)  5-dimentional vector with components composing of InterpolatingFunction(s). Each component of solution should satisfy: $v_i(0)=1,\ \ v_i(1)=0.$The system is enough "good" for solving, matrices A,B are not singular, but I get strange error:Moreover, last error (NDSolve::bvaux) cannot be found anywhere!Any suggestions are welcomed. The code is below and A, B, Cv in attachment. NDSolve[{A[[1, 1]] v1''[t] + A[[1, 2]] v2''[t] + A[[1, 3]] v3''[t] + A[[1, 4]] v4''[t] + A[[1, 5]] v5''[t] + B[[1, 1]] v1[t] + B[[1, 2]] v2[t] + B[[1, 3]] v3[t] + B[[1, 4]] v4[t] + B[[1, 5]] v5[t] == Cv[[1]], A[[2, 1]] v1''[t] + A[[2, 2]] v2''[t] + A[[2, 3]] v3''[t] + A[[2, 4]] v4''[t] + A[[2, 5]] v5''[t] + B[[2, 1]] v1[t] + B[[2, 2]] v2[t] + B[[2, 3]] v3[t] + B[[2, 4]] v4[t] + B[[2, 5]] v5[t] == Cv[[2]], A[[3, 1]] v1''[t] + A[[3, 2]] v2''[t] + A[[3, 3]] v3''[t] + A[[3, 4]] v4''[t] + A[[3, 5]] v5''[t] + B[[3, 1]] v1[t] + B[[3, 2]] v2[t] + B[[3, 3]] v3[t] + B[[3, 4]] v4[t] + B[[3, 5]] v5[t] == Cv[[3]], A[[4, 1]] v1''[t] + A[[4, 2]] v2''[t] + A[[4, 3]] v3''[t] + A[[4, 4]] v4''[t] + A[[4, 5]] v5''[t] + B[[4, 1]] v1[t] + B[[4, 2]] v2[t] + B[[4, 3]] v3[t] + B[[4, 4]] v4[t] + B[[4, 5]] v5[t] == Cv[[4]], A[[5, 1]] v1''[t] + A[[5, 2]] v2''[t] + A[[5, 3]] v3''[t] + A[[5, 4]] v4''[t] + A[[5, 5]] v5''[t] + B[[5, 1]] v1[t] + B[[5, 2]] v2[t] + B[[5, 3]] v3[t] + B[[5, 4]] v4[t] + B[[5, 5]] v5[t] == Cv[[5]], v1[0] == 1, v1[1] == 0, v2[0] == 1, v2[1] == 0, v3[0] == 1, v3[1] == 0, v4[0] == 1, v4[1] == 0, v5[0] == 1, v5[1] == 0}, {v1[t], v2[t], v3[t], v4[t], v5[t]}, t, WorkingPrecision -> 50, Method -> {"Chasing", Method -> "StiffnessSwitching"}, MaxSteps -> Infinity]  Attachments:
3 Replies
Sort By:
Posted 9 years ago
 Not sure what Cv[[i]] is I thought it's a vector of time dependent functions? If so I would construct the equations this way: eqns = Join[ Table[Sum[A[i, j] v[j]''[t] + B[i, j] v[j][t], {j, 1, 4}] == cv[i][t], {i, 1, 4}], Table[v[j][0] == 0, {j, 1, 4}], Table[v[j][1] == 0, {j, 1, 4}]] and thenNDSolve[eqns, {v[1][t], v[2][t], v[3][t], v[4][t]}, {t}]sorry for the double post
Posted 9 years ago
 Dear Kay. You can make sure, that Cv is 5-dimentional function-vector. Get[":\\env.txt"] Plot[{Cv[[1]], Cv[[2]]}, {t, 0, 1}] This gives the following:Other components of Cv are also function-vectors.
Posted 9 years ago
 Not sure what Cv[[i]] is I thought it's a vector of time dependent functions? If so I would construct the equations this way: In[7]:= eqns = Join[Table[ Sum[A[i, j] v[j]''[t] + B[i, j] v[j][t], {j, 1, 4}] == cv[i][t], {i, 1, 4}], Table[v[j][0] == 0, {j, 1, 4}], Table[v[j][1] == 0, {j, 1, 4}]] Out[7]= {B[1, 1] v[1][t] + B[1, 2] v[2][t] + B[1, 3] v[3][t] + B[1, 4] v[4][t] + A[1, 1] (v[1]^\[Prime]\[Prime])[t] + A[1, 2] (v[2]^\[Prime]\[Prime])[t] + A[1, 3] (v[3]^\[Prime]\[Prime])[t] + A[1, 4] (v[4]^\[Prime]\[Prime])[t] == cv[1][t], B[2, 1] v[1][t] + B[2, 2] v[2][t] + B[2, 3] v[3][t] + B[2, 4] v[4][t] + A[2, 1] (v[1]^\[Prime]\[Prime])[t] + A[2, 2] (v[2]^\[Prime]\[Prime])[t] + A[2, 3] (v[3]^\[Prime]\[Prime])[t] + A[2, 4] (v[4]^\[Prime]\[Prime])[t] == cv[2][t], B[3, 1] v[1][t] + B[3, 2] v[2][t] + B[3, 3] v[3][t] + B[3, 4] v[4][t] + A[3, 1] (v[1]^\[Prime]\[Prime])[t] + A[3, 2] (v[2]^\[Prime]\[Prime])[t] + A[3, 3] (v[3]^\[Prime]\[Prime])[t] + A[3, 4] (v[4]^\[Prime]\[Prime])[t] == cv[3][t], B[4, 1] v[1][t] + B[4, 2] v[2][t] + B[4, 3] v[3][t] + B[4, 4] v[4][t] + A[4, 1] (v[1]^\[Prime]\[Prime])[t] + A[4, 2] (v[2]^\[Prime]\[Prime])[t] + A[4, 3] (v[3]^\[Prime]\[Prime])[t] + A[4, 4] (v[4]^\[Prime]\[Prime])[t] == cv[4][t], v[1][0] == 0, v[2][0] == 0, v[3][0] == 0, v[4][0] == 0, v[1][1] == 0, v[2][1] == 0, v[3][1] == 0, v[4][1] == 0}