Re: function of a function
- To: mathgroup at smc.vnet.net
- Subject: [mg62693] Re: function of a function
- From: "Narasimham" <mathma18 at hotmail.com>
- Date: Wed, 30 Nov 2005 22:09:18 -0500 (EST)
- References: <dmjvuc$77e$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Yes, absolutely.. Thanks to you and Jens. :) Actually I was temporarily swayed by so many postings in the thread and accepted the implicit suggestion that the problem is well posed ! [ To solve an ODE F ( f (x), y, y' ) = 0 is OK, but not F ( f (x), f (y), y' ) ! ] Regards Narasimham Andrzej Kozlowski wrote: > On 30 Nov 2005, at 14:07, Narasimham wrote: > > > Jens-Peer Kuska wrote: > > > >> it can't work because f [0] ==1 given in your differential equation > >> f ' [0]==f [1] and NDSolve[] can't find the value for > >> f[1] until it has integrated the equation. > > > > ??? > > > >> The nested dependence is equivalent to an infinite > >> system of ordinary differential equations and it seems to be > >> hard to do this by a finte computer. > > > > I cannot understand this. In the following two examples the first one > > works, not the second. > > > > Clear[x,f,EQ]; > > EQ={f'[x] == f[Cos[x]],f[0]== 1}; > > NDSolve[EQ,f,{x,0,4}]; > > f[x_]=f[x]/.First[%]; > > Plot[f[x],{x,0,4}]; > > > > Clear[x,f,EQ]; > > EQ={f'[x] == Cos[f[x]],f[0]== 1}; > > NDSolve[EQ,f,{x,0,4}]; > > f[x_]=f[x]/.First[%]; > > Plot[f[x],{x,0,4}]; > > > Surely, you mean the second one works, the first one does not!? Also, > I think I agree with Jens. These cases are quite different and the > problem he mentione does not arise in the second case. Ine the second > case the derivative at a point x is defined only in terms of the > value of the function at x. Thus values of the function, it's > derivative, function etc, can be computed sequentially. In the first > case, however, in order to compute the derivative at x you need to > know the value of the function at Cos[x], which in general will not > be known yet. This is, I think, what Jens meant and it seems to me > clearly right. > > > > > It appears (to me) the power of programming with functions in > > Mathematica has not been used to the full. > > > > > > What do you mean? Can you suggest an approximation scheme for this > sort of problem? > > Andrzej Kozlowski > > > > > Jens-Peer Kuska wrote: > >> Hi, > >> > >> it can't work because f[0]==1 give in your > >> differential equation > >> f'[0]==f[1] and NDSolve[] can't find the value for > >> f[1] until it > >> has integrated the equation. > >> The neted dependence is equvalent to a infinite > >> system of > >> ordinary differential equations and it seems to be > >> hard to do > >> this by a finte computer. > >> > >> Regards > >> Jens > >> > >> "Narasimham" <mathma18 at hotmail.com> schrieb im > >> Newsbeitrag news:dmha20$932$1 at smc.vnet.net... > >> | Tried to solve numerically: > >> | > >> | > >> http://groups.google.com/group/sci.math/browse_frm/thread/ > >> 248f76d024c1ac57/0bba983777a07bc9#0bba983777a07bc9 > >> | > >> | thus: > >> | > >> | EQ= { f'[x] == f[f[x]], f[0]== 1} ; > >> NDSolve[EQ,f,{x,0,2}]; > >> | > >> | But gives an error. NDSolve::ndnum: > >> Differential equation does not > >> | evaluate to a number at x = 0. > >> | > >> | Also does not work even with other f[0] values. > >> Any way to do that? > >> | > >