Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

# Matrix operations with GSL libraries

Not applicable
Hi,

I want to implement a kalman filter on a project with a XMC4500. I just want to know if it's possible to use GSL (GNU Scientific Library) matrix functions or if I need to make all the matrix operations "by hand".

If it's possible, how can I install the libraries on the DAVE/XMC?

9 Replies

# Re: Matrix operations with GSL libraries

Employee
Employee
Sorry, I am not very sure on this.

# Re: Matrix operations with GSL libraries

Not applicable
And does anyone ever tried to use some matrix library?

# Re: Matrix operations with GSL libraries

Level 4
Level 4
I made my own library, actually in order to implement a Kalman Filter.

May I ask you what is the purpose of the Kalman Filter?

# Re: Matrix operations with GSL libraries

Not applicable
It's to estimate the charge of a battery. I'm need to know if I'll need to make also my own library or if I can get something already done...
Attachments are accessible only for community members.

# Re: Matrix operations with GSL libraries

Level 4
Level 4
Hi,

Here it is one library that I've made to use with a predictive algorithm to a buck converter: .

If you find any bug please post it here, if possible.

# Re: Matrix operations with GSL libraries

Not applicable
Thank you very much for sharing that!! I'll try to use it and see what I can get out of it 😄

Just one simple first question: the pointer *d for the matrix init data must be an array or is the value for each element of the matrix?

# Re: Matrix operations with GSL libraries

Level 4
Level 4
It is an array.

Note that it is not a multidimensional array, so if you want to init a matrix 3x3 matrix A you sould do it like this:
matrix A;
matrix_data *A_data[3*3] = {1, 2, 3, 4, 5, 6, 7, 8, 9};

matrix_init(&A, (matrix_data *) &A_data, 3, 3);

# Re: Matrix operations with GSL libraries

Not applicable
Thanks very much once again. That's right what I needed. Let's see now if this works like a maltab script I have here.

# Re: Matrix operations with GSL libraries

Level 4
Level 4
It should work, I also prototyped the KF first in Matlab and then implemented it in the microcontroller.