- #1
Nesrine
- 9
- 0
I need to solve a differential system with mathematica that is presented like this :
eqns = {
X1'[t] ==
A[[1]][[1]] X1[t] + A[[1]][[2]] X2[t] + A[[1]][[3]] X3[t] +
A[[1]][[4]] X4[t] + A[[1]][[5]] X5[t] + A[[1]][[6]] X6[t],
X2'[t] ==
A[[2]][[1]] X1[t] + A[[2]][[2]] X2[t] + A[[2]][[3]] X3[t] +
A[[2]][[4]] X4[t] + A[[2]][[5]] X5[t] + A[[2]][[6]] X6[t],
X3'[t] ==
A[[3]][[1]] X1[t] + A[[3]][[2]] X2[t] + A[[3]][[3]] X3[t] +
A[[3]][[4]] X4[t] + A[[3]][[5]] X5[t] + A[[3]][[6]] X6[t],
X4'[t] ==
A[[4]][[1]] X1[t] + A[[4]][[2]] X2[t] + A[[4]][[3]] X3[t] +
A[[4]][[4]] X4[t] + A[[4]][[5]] X5[t] + A[[4]][[6]] X6[t],
X5'[t] ==
A[[5]][[1]] X1[t] + A[[5]][[2]] X2[t] + A[[5]][[3]] X3[t] +
A[[5]][[4]] X4[t] + A[[5]][[5]] X5[t] + A[[5]][[6]] X6[t],
X6'[t] ==
A[[6]][[1]] X1[t] + A[[6]][[2]] X2[t] + A[[6]][[3]] X3[t] +
A[[6]][[4]] X4[t] + A[[6]][[5]] X5[t] + A[[6]][[6]] X6[t]};
The elements of my matrix A have been already calculated
I used the function NDSolve as follow :
sol = NDSolve[{eqns,
X1[0] == X2[0] == X3[0] == X4[0] == X5[0] ==
X6[0] == {1, 1, 1, 1, 1, 1}}, {X1, X2, X3, X4, X5, X6}, {t, 0,
T}, MaxSteps -> \[Infinity]]
but it only gives me an interpolatingfunction value , or me I need the expression in function of time t of my 6 solutions so that I can use them later for my program.
Can you help me please ??
Thanks a lot
eqns = {
X1'[t] ==
A[[1]][[1]] X1[t] + A[[1]][[2]] X2[t] + A[[1]][[3]] X3[t] +
A[[1]][[4]] X4[t] + A[[1]][[5]] X5[t] + A[[1]][[6]] X6[t],
X2'[t] ==
A[[2]][[1]] X1[t] + A[[2]][[2]] X2[t] + A[[2]][[3]] X3[t] +
A[[2]][[4]] X4[t] + A[[2]][[5]] X5[t] + A[[2]][[6]] X6[t],
X3'[t] ==
A[[3]][[1]] X1[t] + A[[3]][[2]] X2[t] + A[[3]][[3]] X3[t] +
A[[3]][[4]] X4[t] + A[[3]][[5]] X5[t] + A[[3]][[6]] X6[t],
X4'[t] ==
A[[4]][[1]] X1[t] + A[[4]][[2]] X2[t] + A[[4]][[3]] X3[t] +
A[[4]][[4]] X4[t] + A[[4]][[5]] X5[t] + A[[4]][[6]] X6[t],
X5'[t] ==
A[[5]][[1]] X1[t] + A[[5]][[2]] X2[t] + A[[5]][[3]] X3[t] +
A[[5]][[4]] X4[t] + A[[5]][[5]] X5[t] + A[[5]][[6]] X6[t],
X6'[t] ==
A[[6]][[1]] X1[t] + A[[6]][[2]] X2[t] + A[[6]][[3]] X3[t] +
A[[6]][[4]] X4[t] + A[[6]][[5]] X5[t] + A[[6]][[6]] X6[t]};
The elements of my matrix A have been already calculated
I used the function NDSolve as follow :
sol = NDSolve[{eqns,
X1[0] == X2[0] == X3[0] == X4[0] == X5[0] ==
X6[0] == {1, 1, 1, 1, 1, 1}}, {X1, X2, X3, X4, X5, X6}, {t, 0,
T}, MaxSteps -> \[Infinity]]
but it only gives me an interpolatingfunction value , or me I need the expression in function of time t of my 6 solutions so that I can use them later for my program.
Can you help me please ??
Thanks a lot