GithubHelp home page GithubHelp logo

Nonlinear equation system about csparse.net HOT 13 CLOSED

wo80 avatar wo80 commented on August 20, 2024
Nonlinear equation system

from csparse.net.

Comments (13)

wo80 avatar wo80 commented on August 20, 2024 2

For symmetric, but not positive definite matrices MINRES is a good choice. For general matrices, I like to use Bi-CGSTAB. See http://www.netlib.org/utk/people/JackDongarra/etemplates/node390.html. If you want to get started soon, I'll try to publish some code this weekend or within the next week.

@EduardBargues
Regarding the NonLinearEquationsSolver project: at the moment, it uses dense matrices and any call to matrix.Solve(rhs) (Predictor, Corrector and Solver classes) will perform a dense LU decomposition. This is not desirable with matrices of the size @epsi1on mentioned. I'd suggest to add a ISolver interface into the builder process to be able to configure the solver.

EDIT: Math.NET has a few iterative solvers, see src/Numerics/LinearAlgebra/Double/Solvers. Be aware that only the MILU0 preconditioner is optimized for sparse matrices, so a good combination would be BiCgStab+MILU0.

EDIT 2: also be aware, that Math.NET has no direct solvers for sparse matrices, see Math.NET Numerics and CSparse.

from csparse.net.

romainmesnil avatar romainmesnil commented on August 20, 2024 1

Hello, indeed arclength is a very good place to start.
One thing to keep in mind, as you perform interations, the tangent stiffness matrix will change, and you will have to update the factorization. It is thus likely that iterative solvers will outperform direct methods in this case, since factorization might be time consuming.
If your question is about the implementation of Finite Element in C#, I fear that there are very few librairies that do this, and that you will have to implement them on your own.
Best,
Romain

from csparse.net.

wo80 avatar wo80 commented on August 20, 2024

Hi, I just saw you found out about NonLinearEquationsSolver here on Github. I don't have a lot of experience in structural mechanics, so I can't give you a good advice here, but the arc-length method seems to be a good point to start, if you want to do nonlinear analysis.

from csparse.net.

wo80 avatar wo80 commented on August 20, 2024

@romainmesnil Good point. As I said, I'm not an expert on subject matter and just did a quick look at the arclength method. Performance of course depends on the properties of the matrix (and how much the matrix changes on each update). For example, if the matrix is spd and it's a rank 1 update, this could be efficiently done with Cholesky. If you choose an iterative solver, you could do an incomplete factorization for preconditioning, without updating in each iteration, in case the matrix doesn't change too much.

@epsi1on From the solver/performance point of view, I'd be glad to help.

from csparse.net.

romainmesnil avatar romainmesnil commented on August 20, 2024

Hello, do you have an example of use of CSparse.NET in the context of iterative solver?

from csparse.net.

wo80 avatar wo80 commented on August 20, 2024

Both dense and sparse matrix classes implement the ILinearOperator interface, which is enough to write an iterative solver. Locally, I have a couple of solvers implemented. The CSparse.NET package itself will not get any features extending the original C project, but I might publish a separate package including dense and iterative solvers, if I find the time.

from csparse.net.

epsi1on avatar epsi1on commented on August 20, 2024

@wo80 thanks. I think the stiffness matrix is not necessarily always SPD and can have zero or negative values on the main diagonal if any part of model goes into softening stage which will happen in ultimate condition of member! (SPD matrix do not have non positive on diagonal). and i think it frequently happens.
Arclength can handle such nonlinearities, this is an example of arclength for a 1D problem with one input and one output:

https://www.youtube.com/watch?v=j4IaRcUM0Mk

As you know the newton iterative method cannot pass such curves. I think if we want to do real nonlinear analysis, we will face them always.

@romainmesnil , do you know other nonlinear software in this criteria? i mean software that can handle nonlinear in softening phase, also uses sophisticated and up-to-date formulation for calculating the tangent matrix? i know OpenSEES which is C++ opensource, and can use arc-length together with fiber-element which would be very powerful if works correct and fast at same time.

Do you think same as me that it could be re-invention of the wheel?

I have implemented a somehow good tangent stiffness matrix for 1d composite section (like concrete members etc.) in my masters thesis and during last few years (based on formulas proposed in this article, soon I'll publish in github,

So we can have:

  • High performance and fast iterative linear solver
  • Arc-Length scheme for correction and prediction in solving nonlinear system
  • Precise calculation of tangent matrix and end forces of 1d composite members regarding geometric and material non linearity

I think this is all we need to implement a good static nonlinear finite element analyzer for structures with concrete or steel members that have new features, at least in domain of opensource software!
Just we need a little effort to combine those into one working package.

footnote: I've tagged the guy that does have already implemented arc-length, @EduardBargues. Dear Mr. Eduard Bargues, Can you please take a look at this topic from my first post? Thanks...

I'm OK if you want to continue conversation privately about this topic, via email and CC etc. .

from csparse.net.

EduardBargues avatar EduardBargues commented on August 20, 2024

Hello guys!! I see youve been having a really interesting conversation :).
Indeed my library already implements arclength for solving nonlinear system of equations.
Currently, it uses math.net to manage matrices and vectors and it is not optimized neither for sparse or simmetric matrices. But still works find for limited sized systems (less than 100000 dof). I tried in my master thesis and seemed to work okay.
It is true that, in general, a nonlinear analysis can not assume sdp matrices.
Tomorrow ill check again your whole conversation to get some ideas on what you want to accomplish.
Talk soon!

from csparse.net.

epsi1on avatar epsi1on commented on August 20, 2024

@wo80 , do you have any suggestion for iterative solver for non SPD matrices? You already have contributed PCG to BFE, but as I know the PCG is only for SPD matrices.

Thanks

from csparse.net.

epsi1on avatar epsi1on commented on August 20, 2024

Currently, it uses math.net to manage matrices and vectors and it is not optimized neither for sparse or simmetric matrices. But still works find for limited sized systems (less than 100000 dof). I tried in my master thesis and seemed to work okay.

So math.net should use sparse matrix as 100K dof will cause 100k*100k dense stiffness matrix, which will have 10Billion members, each member 8 byte as double precision data type, and total 80GB of memory is used for only storage only, matrix operations are not counted yet.
Am i right on mathnet also uses sparse matrix on this?

from csparse.net.

EduardBargues avatar EduardBargues commented on August 20, 2024

that's a great explanation @wo80 !! :)
Do you think we can arrange a meeting to discuss it in more detail? I'm still refatoring the code one part at a time.

from csparse.net.

EduardBargues avatar EduardBargues commented on August 20, 2024

@epsi1on , I put an extra 0 on the dimension of the matrix :P ...
Also, Math.Net does not use sparse matrices.

from csparse.net.

EduardBargues avatar EduardBargues commented on August 20, 2024

Hello @epsi1on and @wo80 . I opened a pull-request in my repo where I include a solver interface to allow the use of sparse matrices. I also invited you both to become collaborators so you can review the pull-request. Let me know :) !

from csparse.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.