MathGroup Archive 1995

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

Search the Archive

Question about NDSolve and loops

  • Subject: [mg1268] Question about NDSolve and loops
  • From: "Michael U. Bogatyriev" <mbog at tulgtu.tula.su>
  • Date: Wed, 31 May 1995 02:25:38 -0400
  • Apparently-to: mathgroup-send at christensen.cybernetics.net
  • Organization: Tula Tech. University

Dear MathGroup,

I have a questions about NDSolve[.] function in Mma
and more generally - about outputs when doing loops.

1. It is  declared  that NDSolve [...., {t,t1,t2}] gives results
as InterpolatingFunction[.] which interpolates data  on the [ t1
- t2] interval. Nevertheless I always get  results  interpolated
on the [0 - t2] intervals as in this simple example:

[In]:

dt=0.1;
t1=0.2;t2=0.3;
NDSolve[{y'[t]+y[t]==1,y[0]==0},y,
{t,t1,t2}]
Evaluate[y[t1+dt/2]/.%]

[Out}:
{{y -> InterpolatingFunction[{0., 0.3}, <>]}}
{0.221198}

I am modelling control systems  which  is changing  differential
equations parameters on each step of modelling.

So my question  is could  the  results  from NDSolve be  correct
interpolated on  the  [0-t2]   interval  insted of   [t1  -  t2]
interval?

Of course  knowing the Mma's  interpolating method may be  there
was no question.

2. I see every loop operator in Mma (For, While,  Do) needs  its
body  contains  expressions divided by semicolons  so  you can't
get output   for example graphics on  the  screen during loop is
doing. It is very unconvenient in  iteractive  evaluations.  May
be somebody knows any way to solve that problem?


Thank you.

                     Michael Bogatyriev
                    Dept. of Automatic Control
                    Tula State Tech. University

                    mbog at tulgtu.tula.su




  • Prev by Date: Re: Reading Bytes: unexpected EOF ???
  • Next by Date: Re: Which of Maeder's Mma Programming Books?
  • Previous by thread: Re: [Q] Factor
  • Next by thread: Re: Which of Maeder's Mma Programming Books?