Quantcast
Channel: Math.NET Numerics - Math.NET
Viewing all articles
Browse latest Browse all 224

Solving for a (M x N) Matrix when N > M

$
0
0

@Jim_R wrote:

Hi, Newbie question here. We are trying to do Fluid Calculations and I set up a basic C# program to test out different scenarios, I'm running into an issue running a MxN matrix where N>M. For example a 4x5 Matrix. I know I am doing something wrong but I just can't figure it out.

Here is the error:
An unhandled exception of type 'System.ArgumentException' occurred in MathNet.Numerics.dll

Additional information: Matrix dimensions must agree: 4x5.

Here is the code snip:
var M = Matrix.Build;
var V = Vector.Build;

        var m = M.DenseOfArray(new double[,] { {a,b,c,cc,ccc},
                                                                     {f,g,h,hh,hhh},
                                                                     {j,k,l,ll,lll},
                                                                     {o,p,q,qq,qqq}
                                                                      });
        var v = V.Dense(new double[] { e, i, n, w });
        var x = m.Solve(v);

Here are the values I am passing:
DenseMatrix 4x5-Double
1 1 1 1 1
0.036 0.0007 0.007 0.0027 0.066
0.125 0.09 0.96 0.18 0.95
0.032 0.032 0.36 0.136 0.79

DenseVector 4-Double
8650.86
185.592
1675.66
133.2

Any help would be appreciated.
Jim

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 224

Trending Articles