Message Boards Message Boards

0
|
2622 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Question: compatibility of table in NDSolve

Posted 9 years ago

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?

figure

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
Attachments
Remove
or Discard

Group Abstract Group Abstract