Ruby linear equation matrix solver

Post any examples or modules that you want to share here
Post Reply
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Ruby linear equation matrix solver

Post by KG_is_back »

The tittle says it all. I've finally got into Ruby and here's one of my first successful attempts to write something useful.
Attachments
RUBY _ matrixSolver.fsm
(1.9 KiB) Downloaded 1206 times
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Ruby linear equation matrix solver

Post by RJHollins »

Looks very usefull KG ...

Question ... how do we use the examples you suppied ?
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Ruby linear equation matrix solver

Post by KG_is_back »

the example is there just to show you how the input array is serialized. There are several different ways to do that, so I picked one.

when you what to solve for example:
1x+1y+1z=9
5x+8y+4z=6
8x+4y+6z=1
then for the input array you simply read those equations line by line:
[1, 1, 1, 9, 5, 8, 4, 6, 8, 4, 6, 1]
I believe you notice the pattern.
RJHollins
Posts: 1573
Joined: Thu Mar 08, 2012 7:58 pm

Re: Ruby linear equation matrix solver

Post by RJHollins »

ah ... ok.

Thanks KG 8-)
User avatar
martinvicanek
Posts: 1334
Joined: Sat Jun 22, 2013 8:28 pm

Re: Ruby linear equation matrix solver

Post by martinvicanek »

Nice one, KG, thanks for sharing! :)
KG_is_back
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: Ruby linear equation matrix solver

Post by KG_is_back »

I'm also working on a ruby module, that can split high order IIR into series of biquads. Actually I already have it working last night, but I have to test it first before posting.
Post Reply