Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1417
| From | Bill Rowe <readnews@sbcglobal.net> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: question about ODE |
| Date | 2011-04-02 07:52 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <in6kkh$2ke$1@smc.vnet.net> (permalink) |
On 4/1/11 at 2:34 AM, alexey_timohin@mail.ru wrote:
>How can I solve this ODE
>x''[t]=-NIntegrate[Sin[x'[t]*L], {L,0,1}] , x[0]=0, x'[0]=10
>The integral in this ODE must be evalueted in each step of solving
>ODE. But I don't know how can I realise it.
Don't use NIntegrate. Since the derivative x'[t] is independent
of the variable of integration, this integral is easily solved
by Integrate. So,
In[3]:= g = Integrate[Sin[x'[t]*y], {y, 0, 1}]
Out[3]= (1 - Cos[Derivative[1][x][t]])/Derivative[1][x][t]
Now the ODE is easily solved with
NDSolve[{x''[t] == -g, x[0] == 0, x'[0] == 10}, x, {t, -1, 1}]
Note, the use of "==" not "=" and I've replaced L with y as it
is unwise to use single uppercase letters as variables in
Mathematica. All to frequently, this will conflict with built-in
usage for these symbols.
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: question about ODE Bill Rowe <readnews@sbcglobal.net> - 2011-04-02 07:52 +0000
csiph-web