Message Boards Message Boards

0
|
5179 Views
|
1 Reply
|
1 Total Likes
View groups...
Share
Share this post:

I am getting an "NDSolve::ndum:" error and cannot figure out why.

Posted 11 years ago

I looked at the reference material here: http://reference.wolfram.com/mathematica/ref/message/NDSolve/ndnum.html I still cannot figure out what the problem is - only thing I can think of is that I didn't assign a specific value to "t" but it is a variable that changes so I'm not sure how to go about doing that. Here is my differential equation that I am trying to solve graphically:

s = NDSolve[{x'[t] + (6.489 * 10^-28)[(3.84 * 10^27) (1 - t) (10^5 * (1 - t) - (2 * 10^5) * x[t] + 1) (10^5 * (1 - t) + (2 * 10^5) * x[t] + 1)/((4 * 10^10) * (1 - t)^2 + (4 * 10^10) * x[t]^2 - (4 * 10^5) * x[t] + 1)^(7/2) - (3 (1 - t)^3 - 12 (1 - t) * x[t]^2)/(x[t]^2 + (1 - t)^2)^(7/2)] == 0, x[0] == 3}, x, {t, 0, 1}]

Here is the error: NDSolve::ndnum: Encountered non-numerical value for a derivative at t == 0.`. >>

Any help would be appreciated. Thanks.

POSTED BY: Anup Singh

You have an error using square braces where you should have round braces. The working form is

s = NDSolve[{x'[
      t] + (6.489*10^-28) ((3.84*10^27) (1 - 
           t) (10^5*(1 - t) - (2*10^5)*x[t] + 
           1) (10^5*(1 - t) + (2*10^5)*x[t] + 
            1)/((4*10^10)*(1 - t)^2 + (4*10^10)*x[t]^2 - (4*10^5)*
              x[t] + 1)^(7/2) - (3 (1 - t)^3 - 
           12 (1 - t)*x[t]^2)/(x[t]^2 + (1 - t)^2)^(7/2)) == 0, 
   x[0] == 3}, x, {t, 0, 1}]

So here are the rules:

  1. Curly braces are for lists:

    {a,b,c,d}

  2. Square braces are for function calls:

f[x]

and part specification

a[[1]]
  1. Round braces are for order of operation

    (a+b)^c

POSTED BY: Jason Grigsby
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