Message Boards Message Boards


Question: compatibility of table in NDSolve

Posted 8 years ago
2 Replies
1 Total Likes

I would like to solve the following simultaneous differential equations by NDSolve. When I tried to include a function g[t] in addition to functions f[t,1-10] that are defined by table, the following message appeared; NDSolve::dsfun:"you cannot use {f[t,1],...,f[t,10]} as a function". When I deleted g[t] from the equations, it worked. What is problem?


POSTED BY: at quantum
2 Replies

Thank you for quick reply. Following your suggestion it worked. Based on this example code, I found that if I rename the function g[t] as f[3][t] it also worked.

POSTED BY: at quantum

If you put your code into a Code Sample (the first icon) it could be copied into Mathematica without having to type it in.

I suspect your code would work if you used f[i][t] for your functions instead of f[t,i].

For example:

NDSolve[{D[f[1][t], t] == f[2][t], D[f[2][t], t] == f[1][t], 
  f[1][0] == 1, f[2][0] == 1}, {f[1][t], f[2][t]}, {t, 0, 1}]
POSTED BY: Frank Kampas
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract