Grasshopper

algorithmic modeling for Rhino

Hi,

I am working on a customized formfinding component, using vb.net.

I will have to deal with matrix operations (linear algebra), and linear optimization. 

I am looking for a .net free library to do this, but it is hard to find. I found MathNet.Numerics for linear algebra, but it does not include any linear optimization solver.

Any idea ?

Also, could I use Galapagos to solve my linear optimization ? Are there exemples of solving  matrix problems with Galapagos ?

And last question : what libraries were used to create the matrix components on GH (transpose, invert,...) ? 

Thanks

Views: 5281

Replies to This Discussion

The matrix in grasshopper is a representation of a RhinoCommon Transformation:

http://4.rhino3d.com/5/rhinocommon/html/AllMembers_T_Rhino_Geometry...

Here the matrix is represented as 16 seperate members, and not as a seperate matrix kind of object. I don't think it will be much use to you.

There are a lot of linear algebra libraries out there for .net:

Accord.net
https://code.google.com/p/accord/
It seems to have a solver:
http://accord.googlecode.com/svn/docs/html/M_Accord_Math_Matrix_Sol...

Dambach Linear Algebra Framework:

http://linearalgebra.codeplex.com/

Math.Net Numerics

Also the math.net includes several linear optimization solvers:

See also: API Documentation (search for Solve methods)

IlNumerics

http://ilnumerics.net/

Alglib

http://www.alglib.net/

Numerical:

Also seems to have several linear optimization functions

http://numerical.codeplex.com/

Perhaps you can talk about what kind of linear problem you are trying to optimize? There seem to be an awful lot of mathematical libraries for .net; most of them are able to solve a matrix one way or another.

Thanks,

I am looking for a linear optimization solver (linear programming - http://en.wikipedia.org/wiki/Linear_programming ). That is to say :

I am not looking for a simple solver like Ax = B

Math.Net Numerics does not include a linear optimization solver for instance.

I'll have a look at your libraries. 

Could I solve this with Galapagos ?

You can solve almost anything with Galapagos but it probably won't be the most efficient way of doing it.

If your problem can be solved applying linear programming specific algorithms it will guaranty an optimal result (in most cases, I think) and it would solve faster.

Hi Arend,

do you think you could give some insight in how to implement these libraries in GH? I've been trying the last couple of days, but couldn't import any of them. (I'm quite new to the matter)


I want to use the conjugate gradient method to optimize linear equations. Especially Accord.NET sounds promising, but I get

'Import failed for '[....]Accord.Math.dll': Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information'

Some of them work (e.g. "Accord.dll") but most don't. Two days ago it worked, but then it suddenly stopped.

Any help would be of huge interest.

Try http://funclib.codeplex.com/ whats a cool any easy going one.

It has the FuncLib.Optimization.Ipopt.IpoptOptimize implemented, which solves very robust and fast.

You can not only define to solve to min max, but also applying Constrains.

Thanks,

I'll have a look at this too.

Hi Michael,

I was trying to implement this library, but I couldn't even find the correct .dll to reference.

The downloaded folders contain Ipopt39.dll and IpOptFSS39.dll which both fail to load in the GH C# component with the message:

'Import failed for '.....Ipopt39.dll': Could not load file or assembly '.....Ipopt39.dll' or one of its dependencies. The specified module could not be found.' and resp. for IpOptFSS39.dll

The .cs - files say they're "using FuncLib.Function;"    which is nowhere to be found in the downloaded folders.. I also couldn't find these files on the www

Do I need to compile the FuncLib.Function.dll first to reference it into Grasshopper?


Or do you have another suggestion? I want to solve a linear equation system

I would super thankful for a little insight.

Cheers
Benjamin

Hi michacl,

Do you have a sdk or api of FuncLib?I failed to use FuncLib to solve the Max/Min.

Thanks.

Hey Guillaume,

did you make progress on the topic? I'm actually in need of a component like this as well, but I don't know the first thing about coding. Do you think you could give some insight into your accomplishments??

Cheers
Benjamin

Benjamin,

I finally changed my algorithm to avoid using  linear optimization. So I did not go futher...

Hi there,

I've just tried to use FuncLib (http://funclib.codeplex.com/) in a GH component and it worked almost with no complications.

The only little thing to know is that the funclib version on CodePlex targets x86 dlls of IPOPT optimizer. So you need to start your rhino in 32-bit otherwise you will get a "could not load FuncLib.dll" error.

Probably you can manage to replace the given dll of IPOPT in funclib with newer versions and target both x86 and x64 plateforms.

I'll try to do this and post back here if I succeed.

Cheers,

Lionel

Hi Lionel,

Thanks for the useful reference, and I also found your implementation in Github.

It seams it's very handy and robust (the only complaint might be that the internal Linear Algebra library doesn't support sparse matrices..)

though I want to use it for x64.

I tried to compile new dlls from IPOPT projects, but I couldn't manage it...

Did you manage to compile x64 ipopt dlls and call it in c# projects?

Best

Kenryo

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service