Thread Subject: numerical integration via mex-file

Subject: numerical integration via mex-file

From: Numerical Integration MEX source code

Date: 7 Jun, 2007 13:21:03

Message: 1 of 4

Hello, I am attempting to create a mex-file analog of ode45 as
painlessly as possible to rapidly increase the speed of the numerical
process. To speed up the looping, I assume that the file of
differential equations would also need to be a mex-file, or bundled
as an internal function directly into the numerical integrator source
code. I was wondering if anyone was aware if this has been done by
anyone? If not, does anyone know a reliable runge-kutta c-based
integrator that may be amenable to conversion into MEX? I would
really like to minimize the amount of time spent significantly
altering such an existing source code written in C and compile in
MATLAB, so any help on this matter is highly appreciated.

Subject: numerical integration via mex-file

From: John D'Errico

Date: 19 Jun, 2007 08:24:52

Message: 2 of 4

Roman Töngi wrote:
>
>
> I'm beginner in Matlab. I just want to implement the
> trapeze-formula
> numerical integration method:
>
> (1/2 * S1 + S2) * h

Um, you do realize that the trapezoidal
rule is not what you have written?

 <http://en.wikipedia.org/wiki/Trapezoidal_rule>

> Here is my trivial implementation using symbolic-math-toolbox
> functions:

Your implementation leaves the substituted
results as symbolic.

John

Subject: numerical integration via mex-file

From: Martin Ozimek

Date: 19 Jun, 2007 08:39:34

Message: 3 of 4

John D'Errico wrote:
>
>
> Roman Töngi wrote:
>>
>>
>> I'm beginner in Matlab. I just want to implement the
>> trapeze-formula
>> numerical integration method:
>>
>> (1/2 * S1 + S2) * h
>
> Um, you do realize that the trapezoidal
> rule is not what you have written?
>
> <http://en.wikipedia.org/wiki/Trapezoidal_rule>
>
>> Here is my trivial implementation using symbolic-math-toolbox
>> functions:
>
> Your implementation leaves the substituted
> results as symbolic.
>
> John
  
I realize that coding my own routine in C++/Fortran is a possible
option, however, there are in fact well-written and more robust
integration routines out there than I would want to spend my own time
writing, some of which I already own. These include higher order
(rk78, rk89) integrators with adaptive step sizing, and reliable
error tolerance monitoring. My question was more along the lines of
whether anyone knew if such high quality integration routines, even
4th/5th order Runga-Kutta had been converted to mex files already, or
if their source codes ext.

I'm currently trying to write the mex interface from a high quality
rkf45 C++ integrator, I just figured that it was possible this was a
common enough problem that maybe someone out there had already done
that, and had it available. In this case though, google has not been
my friend, and therefore I thought someone might have some inputs
here.

Subject: numerical integration via mex-file

From: John D'Errico

Date: 19 Jun, 2007 09:19:34

Message: 4 of 4

Martin Ozimek wrote:
> I realize that coding my own routine in C++/Fortran is a possible
> option, however, there are in fact well-written and more robust
> integration routines out there than I would want to spend my own
> time
> writing, some of which I already own. These include higher order
> (rk78, rk89) integrators with adaptive step sizing, and reliable
> error tolerance monitoring. My question was more along the lines
> of
> whether anyone knew if such high quality integration routines, even
> 4th/5th order Runga-Kutta had been converted to mex files already,
> or
> if their source codes ext.
>
> I'm currently trying to write the mex interface from a high quality
> rkf45 C++ integrator, I just figured that it was possible this was
> a
> common enough problem that maybe someone out there had already done
> that, and had it available. In this case though, google has not
> been
> my friend, and therefore I thought someone might have some inputs
> here.
  
There appears to be a bit of thread
mixing here, since my response was
to someone trying to integrate using
trapezoidal rule.

John

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com