Acceleration, velocity, distance .. fastest calculation method please

Hi,
Knowing the velocity x in m/s, acceleration y in m/s^2, and duration of acceleration t in seconds, I will want to calculate distance travelled during time period t and velocity at the end of that time period t.
I'm going to need to do this a lot of times (potentially order of 1E10 times).
Please can anyone tell me what they think the likely fastest way to do this in matlab would be and why it's likely to be fastest.
Many thanks in advance.

6 Comments

I think that's part of my question. There seem to be several approaches ( eg Euler, Runge-Kutta etc ) but the choice might depend on how matlab goes about things (ie actual speed of processing).
I guess my questions requires a respondent to know the alternative methods of calculation as well as how matlab would process them and then to give a justified recommendation.
Obviously I can just try various approaches myself but it's also interesting for me to see what levels of support are available within the community here.
I can write the code myself I'm sure (I used to be afortran programmer) but I find higher level languages like matlab (when I'm new to them) more difficult to see through.
There must be something that you haven't explained here. Knowing initial velocity and acceleration and knowing the duration, it's trivial to calculate distance traveled and final velocity. It's just simple multiplications and sums, you don't need a solver for that.
Indeed .. v=u+at & s=ut +1/2 at^2 are probably what folk learn at age 16 (or earlier) and obviously aren't wrong.
I was thinking Runge-Kutta (4th order) as a way of solving the general second order ode (d2s/dt2)=k. My instinct is that building from this may ultimately make more sense (but I may be wrong). Hence processing speed questions.
I'm not explaining my core problem well as I haven't understood it properly yet (it's a bit like travelling in hope to find Ruritania, with no map or certainty that such a place exists!).
I expect to be expanding the core process (multi-vector forces applying to multiple bodies in a 3D system - with various perturbations - accelerating them and changing position & velocity) by starting with largely simple planetary motion, adding complexity and then trying to use this as a proxy for electron quantum effects (at a rather smaller scale) (and am assuming the complex plane is going to need to be involved in the maths..not sure the maths exists yet... but the quantum satellite network and google bristlecone do!).
In the short term, using simple formula may be easiest but I can't imagine serious modelling of planetary motion without pde involvement.. so starting down a calculus path may be better.
Equally, I might just be overthinking things!
I suggest reading this chapter from Cleve Moler's book to get an introduction to this topic: Numerical Computing with MATLAB. This introduction will help explain why MATLAB has a variety of methods for ODE solution and why you almost certainly don't want to write your own.
Thanks .. that's a nice chapter! (I'd largely forgotten about Jacobians and Gauss-Seidel ... my poor ageing brain!)
It looks as if the ode functions (solvers) within Matlab are well established.
I only took maths to bachelor degree level so pretty much all I know seems well encapsulated within Matlab! This is just a fun project for me.
Thanks to all three of you for the comments.
No doubt I shall bumble around happily for some time and come up with nothing .. but at least I'll enjoy the journey!

Sign in to comment.

Answers (0)

Categories

Find more on Mathematics in Help Center and File Exchange

Products

Release

R2018a

Tags

Asked:

on 15 Jun 2018

Commented:

on 15 Jun 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!