Hello!
I am a new member in this forum, and am a beginner in programing to arduino ... I wanted to know how to declare a matrix and its inverse and its transpose... etc
Indeed, I want to make a small program for controlling the level of liquid in a tank that needs a idetification real-time parameters of the mathematical model of the controlled system. (I use methods of identifying where there are many matrix computation)..!!
help me I'm lost!!!! :-/
I think you are lost You're in a world of integer-only 8-bit microcontrollers and you're trying to do real-time system identification. That's the wrong world. You want a development platform with some power: 32-bit processing and lots of MHz with floating point support built in (ARM9 architecture for example).
If you do want to start with matrices, I would Google "matrix c++ class". There are lots of C++ implementations of matrices to choose from.
--
Check out our new shield: http://www.ruggedcircuits.com/html/gadget_shield.html
thank you for your response!
I want to know how to declare a matrix in a program Arduino ...and if I can do the matrix calculation (the sum or the product of two matrices, for example)
Thanks for you!
I want to know how to declare a matrix
Same as in C/C++.
Seriously, what RuggedCircuits said - If you're using a 168 processor, you've got at most 1024 bytes to store your matrices, usually much less.
If you want floating-point matrices, this is enough for at most 256 elements, but you won't get anywhere this if you're doing anything else, like using the serial line to communicate your results.
Two 8x8 matrices of "float"s will use up half your total memory.
I think that the best thing you can do is to use the Arduino as a front end, and communicate the data back to a computer through a serial port.
Do you have MATLAB? That is actually based on matrix algebra and has serial port functionality (and possibly the most powerful platform for mathematics in programming form).
http://www.mathworks.com/access/helpdesk/help/techdoc/matlab_external/f63744.html
Otherwise you could use a .NET program and see if you can find matrix object for your program.
http://www.google.com.au/search?q=VB.NET+matrix&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
http://www.google.com.au/search?hl=en&client=firefox-a&hs=cXK&rls=org.mozilla%3Aen-US%3Aofficial&q=C%23+matrix&aq=f&aqi=&aql=&oq=&gs_rfai=
As for
I wanted to know how to declare a matrix and its inverse and its transpose... etc
The answer is that you can create an array and do all the calculations manually (being aware of the memory limitations).
ie.
|a b| X |c| = |ac + db|
|d|
and if
A =
|a b|
|c d|
inv(A) = /in some cases.../
1/det(A) * |d -b|
|-c a|
But as mentioned earlier, your memory is very limited, so this won't get you very far...
How many/how large matrices do you need and how quickly must the operations be performed?