Message Boards Message Boards

0
|
2169 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Error in using NDSolve

Posted 3 years ago

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}]},
Flatten[Table[{x_i,y_i,z_i},{i,1,n}]],{t,0,T},
MaxSteps→Infinity,Method→{"DiscontinuityProcessing"→False}]

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

POSTED BY: Praviserk Chand
4 Replies
Posted 3 years 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 BY: Rohit Namjoshi

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

POSTED BY: Praviserk Chand
Posted 3 years 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 BY: Rohit Namjoshi
Posted 3 years ago

Thank you so much... :) it works

POSTED BY: Updating Name
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract