Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: problem with NDSolve::dvnoarg:

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116545] Re: problem with NDSolve::dvnoarg:
  • From: Daniel Lichtblau <danl at wolfram.com>
  • Date: Sat, 19 Feb 2011 05:12:59 -0500 (EST)

tarun dutta wrote:
> n = 5;
> p = 5/1000;
> q = 1/10;
> c[-1][t] = 0; d[-1][t] = 0;
> c[n + 1][t] = 0; d[n + 1][t] = 0;
> eqn1 = Table[
>    c[i]'[t] == ((1/2)*i (i - 1) - q*i)*c[i][t] -
>      p*(Sqrt[i]*
>          c[i - 1][t]*(Sum[Sqrt[i]*d[i - 1][t]*d[i][t], {i, 0, n}]) +
>         Sqrt[i + 1]*
>          c[i + 1][
>           t]*(Sum[Sqrt[i + 1]*d[i - 1][t]*d[i][t], {i, 0, n}])), {i,
>     0, n}];
> eqn2 = Table[
>    d[i]'[t] == ((1/2)*i (i - 1) - q*i)*d[i][t] -
>      p*(Sqrt[i]*
>          d[i - 1][t]*(Sum[Sqrt[i]*c[i - 1][t]*c[i][t], {i, 0, n}]) +
>         Sqrt[i + 1]*
>          d[i + 1][
>           t]*(Sum[Sqrt[i + 1]*c[i - 1][t]*c[i][t], {i, 0, n}])), {i,
>     0, n}];
> eqn3 = Table[Sum[(c[i]^2)[t], {i, 0, n}] == 1, {i, 1}];
> eqn4 = Table[Sum[(d[i]^2)[t], {i, 0, n}] == 1, {i, 1}];
> eqns = Flatten[Join[eqn1, eqn2, eqn3, eqn4]];
> bcs = {{c[0][0] == d[0][0] == 0.004567},
>    Table[c[i][0] == 0.0000000034, {i, 1, 5}],
>    Table[d[i][0] == 0.0000000034, {i, 1, 5}]};
> var = Join[Table[c[i], {i, 0, 5}], Table[d[i], {i, 0, n}]];
> sol = NDSolve[{eqns, bcs}, var, {t, 1/10}]
> 
> NDSolve::dvnoarg:
> 
> I can not understand the meaning of this kind of error,,
> can anyone explain and give some valuable insight.
> regards,
> tarun

The full message, which you should have shown, is:

"NDSolve::dvnoarg: "The function c[0] appears with no arguments. "

The message tells you VERY CLEARLY what you should look for. It is a 
c[0] without a 't' argument.

In my last response, I stated VERY CLEARLY why this was happening. 
Reluctantly, I quote myself: "You use a notation for summing the squares 
that is not correct. So you get things like c[0]^2 instead of c[0][t]^2."

You might wish to carefully read these things because they can save you, 
and others, considerable time.

Daniel Lichtblau
Wolfram Research




  • Prev by Date: Re: y-axis direction
  • Next by Date: Re: Another point about Mathematica 8.0
  • Previous by thread: problem with NDSolve::dvnoarg:
  • Next by thread: Re: problem with NDSolve::dvnoarg: