MathGroup Archive 2008

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

Search the Archive

Re: NDSolve and error

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92563] Re: NDSolve and error
  • From: Peter Pein <petsie at dordos.net>
  • Date: Sun, 5 Oct 2008 06:06:33 -0400 (EDT)
  • References: <gc7fql$elo$1@smc.vnet.net>

dodatki at poczta.fm schrieb:
> Hello!
> Lately I wrote simple code in Mathematica
> 
> sol[p_] :=
>   NDSolve[{Sqrt[
>           1 + (y'[t])^2] == (x^(p - 1) + (y[x])^(p - 1)*y'[x])/(x^p +
>                 y[x]^p)^(1 - 1/p), y[1] == 6}, y, {x, 1, 4}]
> 
> but when I typed sol[2] the following kind of error was shown:
> 
> NDSolve::"ndnum": "Encountered non-numerical value for a derivative at
> \
> \!\(x\) == \!\(4.587812868332132`*^-296\)."
> 
> May I know what I'm doing wrong? Or how can I improve that code to
> work correctly?
> Thank you in advance
>                                   John
> 

Hi John,

try to replace y'[t] in the call to Sqrt by y'[x], and you'll get an exact
solution for p=2:
In[3]:= DSolve[{Sqrt[Derivative[1][y][x]^2 + 1] ==
     (x^(p - 1) + y[x]^(p - 1)*Derivative[1][y][
         x])/(x^p + y[x]^p)^(1 - 1/p),
    y[1] == 6} /. p -> 2, y, x]
Out[3]= {{y -> Function[{x}, 6*x]}}

Peter


  • Prev by Date: How do I recover GridLines when using Prolog?
  • Next by Date: Finding the optimum by repeteadly zooming on the solution space (or something like that)
  • Previous by thread: Re: NDSolve and error
  • Next by thread: Re: NDSolve and error