CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Finding root of a function (https://www.cfd-online.com/Forums/openfoam-programming-development/58733-finding-root-function.html)

hjasak May 7, 2008 10:27

Finding root of a function
 
Dear All,

I have just implemented root-finding operations of a function f(x) = 0. If someone is interested, have a look at the SVN - it currently lives in the ODE library.

Enjoy,

Hrv

ngj July 15, 2008 08:25

Hihttp://www.cfd-online.com/Op
 
Hihttp://www.cfd-online.com/OpenFOAM_D...part/happy.gif

I am about to be solving 4 sets of non-linear equations on each face on certain boundary-patches. As far as I can see, the function implemented by Hrv is for 1 equation!?!
Is there anywhere in OF implemented some kind of solver for N non-linear set of equations?
If not, could you please suggest to me a suitable open-source implementation, preferable in C++.

Best regards,

Niels

P.S. Thank you for an utterly fantastic workshop.

sabago June 1, 2015 16:05

Dear all,

Has anyone been able to use the BisectionRoot, or RiddersRoot or the NewtonSecant methods in the "findRoot" folder on the svn?

Say I want to solve for x in

0 = -3 + 4(Exp(2x)-Exp(3x))

I have the findRoot folder in src/ODE and added the path to my /make for the solver.

How, then do I implement any of the findRoot methods to get x?

Best regards,
Sandra

sabago November 1, 2015 12:23

I fixed my issue on this link : http://www.cfd-online.com/Forums/ope...ng-method.html
Quote:

Originally Posted by sabago (Post 548481)
Dear all,

Has anyone been able to use the BisectionRoot, or RiddersRoot or the NewtonSecant methods in the "findRoot" folder on the svn?

Say I want to solve for x in

0 = -3 + 4(Exp(2x)-Exp(3x))

I have the findRoot folder in src/ODE and added the path to my /make for the solver.

How, then do I implement any of the findRoot methods to get x?

Best regards,
Sandra


Saideep August 10, 2016 11:16

Hi guys;

I guess my post is best fitted to this thread.

I am trying to solve 2 non-linear equations simultaneously using Newton-secant method.

As Niels had asked the "findRoot" is tested over one equation. How can I couple and use two equations in order to find the solution roots? Any example case already implemented in Foam-extend?

Additionally is it possible to write the number of iterations taken in order to reach the tolerance?

Thanks,
Saideep


All times are GMT -4. The time now is 08:28.