On Sonntag, 25. April 2004 17:24, Nick wrote:
> I took a couple of classes in Matlab/Simulink last month and this was
> addressed specifically in the class.  Matlab permits you to vary timestep
> size as you approach the ground.  It you extrapolate ahead in time to see
> if any of the gear have come in contact with the ground you can then
> retreat to the previous time, cut the timestep size down and then go
> forward again until you capture the ground contact at a fine enough
> stepsize to  prevent instability.  It isn't necessary to run the entire
> simulation at this reduced stepsize if you can run the gear model as a
> faster subtask of the main simulation.  Matlab then does running checks to
> vary the timestep size on the basis of a predictor-corrector algorithm (if
> there is a large discontinuity it will go back and systematically chop down
> the timestep size until the output is "sensible".  It's possible in this
> modern age to find implementation of these algorithms (Adams-Bashforth is
> one that I'm familiar with.  Naturally you are taking a chance on frame
> overruns if you let the program decide its update rate, but then that's
> fixable too in this age, using a faster processor.
There are even phantastic free odesolvers included in MATLAB odesuite 
available. I believe that this toolbox is just delivered with current MATLAB 
versions. You can just plug them in SIMULINK.
So if you are at that situation you can do much more.
If you just want to stay explicit for some reason you can just use an explicit 
solver like the ode45, set the atol and rtol values via odeset and let it 
run. Solvers like ode45 have adaptive stepsize control to get a result with 
that given accuracy. The downside of this approach is that explicit solvers 
will detect this stiffness and dependent on how stiff the problem is will 
reduce the stepsize to something *very* small. Too small to get some realtime 
behavour ...
The other approach is to use the right tool for the given problem, an implicit 
solver like the ode15s of the odesuite. It will integrate well even if the 
problem is stiff or a DAE. ode15s can be restricted to a low order solver if 
your problem is not smooth enough (not enough often steady differntiable). If 
it is kind of smooth, or at least the sharp bends occure not that often, as 
is the case for a gear. A gear model is most likly smooth enough up to the 
point when the tire leaves the ground, at this point it is only steady but 
not differentiable. Then it might be a good idea to use a higher order solver 
anyway. For stiff problems I think it is best to use RADAU5 available from


An excellent page for timestepping anyway. This RADAU5 has order 5 and also if 
required builtin stepsize control. The MATLAB code is not yet there, but I 
know that there is one (I have it here, a collegue implemented it in MATLAB) 
and I also know that the author of that page asked for this MATLAB version of 
RADAU5 to publish it on this page. So it will appear there ...
... wait. It *is* available via


> Hope this helps.
Yep, kind of ...



Mathias FrÃhlich, email: [EMAIL PROTECTED]

Flightgear-devel mailing list

Reply via email to