Message Boards Message Boards


Error in using NDSolve

Posted 4 months ago
4 Replies
0 Total Likes

n = 2

sol=NDSolve[{Table[{x_i'[t]==ν_i [t],y_i'[t]==ω_i [t],z_i'[t]==ρ_i [t]},{i,1,n}],
Table[{x_i [0]==x0[i],y_i [0]==y0[i],z_i [0]==z0[i]},{i,1,n}]},

This is the error

NDSolve::ndinnt: Initial condition x0[1.] is not a number or a rectangular array of numbers.

Please someone can help me on how to solve this error

4 Replies
Posted 4 months ago

Take a look at the result of evaluating

Table[{x_i'[t]==ν_i [t],y_i'[t]==ω_i [t],z_i'[t]==ρ_i [t]},{i,1,n}]

In the WL underscore represents Blank. Perhaps you meant this?

Table[{x[i]'[t] == ν[i][t], y[i]'[t] == ω[i][t], z[i]'[t] == ρ[i][t]}, {i, 1, n}]
Posted 4 months ago

It is x subscript i.. This problem deals with {x1, y1, z1} {x2 ,y2, z2}. The numbers are subscript.

Posted 4 months ago

Evaluating the code you posted results in

NDSolve::dsfun: x:Blank[1] cannot be used as a function.

Which is different from the error you posted. So, the code you are running is not the code that you posted (which has no Subscript). It is best to avoid the use of Subscript in WL, better to use indexed variables as I suggested. Did you try that?

Posted 4 months ago

Thank you so much... :) it works

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract