Creating a matrix-differential equation from C file

4 views (last 30 days)
I have a set of differential equations in C(created from a tool that takes an xml input), in the following form
#ifdef ODEs
dx[0] = Function1(p[67], p[64], p[66], p[65], p[23], x_c[0], x_c[3], p[49]);//
dx[1] = Function2(p[62], p[64], p[66], p[65], p[23], x_c[1], x_c[3], p[40]);//
#endif /* ODEs */
The .c file is available here
I'm trying to solve a matrix differential equation of the form X' = F(X) + B, in MATLAB. From the above sample code what I have is the content for X' = F(X).
I have created the B matrix in MATLAB. I'm using MinGW in MATLAB to integrate the C code with MATLAB.
I'm facing challenge in converting the set of ODE's in C to a matrix-differential equation form(X' = F(X)), which I can use in MATLAB. Is it possible to import the ODE's from C file and build the matrix within MATLAB?
I would like to ask for suggestions on how this can be done.

Answers (0)

Community Treasure Hunt

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

Start Hunting!