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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Pi.
  • 145
  • 1
  • 3
  • 7

4 Answers4

7

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.

All three of these PDEs 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.

But the parabolic and hyperbolic PDFs will turn into coupled sets of ODEs once you discretize them. You have to do transient integration to repeatedly solve the time evolution. Parabolic ODEs are first order in time; hyperbolic ODEs are second order in time.

I'm learning about CUDA and NVIDIA. You might want to look into CUDA bindings for your language.

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
  • 305,152
  • 44
  • 369
  • 561
  • 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 Sep 21 '09 at 02:23
  • great link, definitely worth a look. – Alexandre C. Dec 02 '10 at 22:00
3

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
  • 73,152
  • 14
  • 113
  • 156
  • 3
    The OP is looking to solve PDEs but it appears that AlgLib only solves ODEs. – jason Sep 21 '09 at 01:51
  • Oops... That would deserve a -1. My bad, I missed the 'partial' in OP! +1 for your comment, thank you! – mjv Sep 21 '09 at 02:14
2

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
  • 64,563
  • 18
  • 145
  • 216
2

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
  • 118,240
  • 47
  • 247
  • 360