views:

905

answers:

5

I am working on a project (C# and .NET Framework) which requires me to solve some partial differential equations. Are there any specific libraries based on .NET Framework that I could see and make my work simpler?

I have worked with MATLAb and solving partial differential equations is very straightforward there. How can I solve this problem?

+1  A: 

Check out http://www.mathdotnet.com/About.aspx, it may have what you need. However I suspect you should get the best library for you application requirements, and then interface it to your .net application..

You'll probably find that with things like this (except where you using to learn either the language or the maths) there are a number of pre canned libraries.

Preet Sangha
+1  A: 

Another suggestion is AlgLib . I like this because unlike comprehensive libraries where you have to find what you need, AlgLib has all the algoritms separated, and often offered in multiple languages (including C#, in most/all cases). Regarding calculus AlgLib covers:

        Euler's method
        Runge-Kutta method
        Runge-Kutta method for a system of ODEs
        Bulirsch-Stoer method for a system of ODEs

A word of caution, however... upon checking these algorithm at AlgLib, I noted that they were not supported anymore (by AlgLib), because their licenses may be imcompatible with AlgLib's license (which is GPL, I believe).

mjv
The OP is looking to solve PDEs but it appears that AlgLib only solves ODEs.
Jason
Oops... That would deserve a -1. My bad, I missed the 'partial' in OP! +1 for your comment, thank you!
mjv
+4  A: 

Depends on which PDEs you want to solve and how you want to approach them.

Every approach that I know of will require linear algebra. You'll want to find a good matrix package for .NET, the best you can find, one that can handle sparse matricies efficiently.

Linear elliptic (steady state diffusion), parabolic (transient diffusion), and hyperbolic (F= MA dynamic) PDEs require slightly different approaches.

You can use classical finite difference, finite element (weighted residual), or boundary element (Green's functions) to create the system matrix you'd like to solve. General non-linear PDEs are probably best attacked using a finite element/weighted residual technique.

All these are big topics unto themselves. Please Google for some sources, because it's not possible to give more than a cursory overview here.

UPDATE: I recently became aware of the Microsoft Solver Foundation. I haven't looked into it myself, but perhaps it'd be helpful to C# developers in solving this problem.

duffymo
This is the only answer so far that demonstrates any concrete understanding of numerical methods for solving partial differential equations. As duffymo mentions, most of them involve discretizing the PDE to form a matrix equation, which can then be solved using a numerical linear algebra library. Math.NET Numerics seems to provide numerical linear algebra routines in C# for dense matrices, and sparse matrix support is a work in progress: http://nmath.sourceforge.net/doc/numerics/MathNet.Numerics.html
las3rjock
+2  A: 

You could solve the problem in MATLAB and use the MATLAB compiler + Builder NE toolbox to create a .NET assembly which links to the rest of your app.

Richie Cotton
A: 

If the partial differential equations you are interested to solve are the resulting equations from a finite element analysis, then I would suggest to take a look at Anaxsoft. They provide finite element SDKs for the .NET platform.

ileon