Code Monkey home page Code Monkey logo

louis-finegan / root-finding-algorithms-c Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 19 KB

Algorithms for root finding writting in c with, bash shell script that compiles and runs all executable files.

Home Page: https://github.com/Louis-Finegan/Root-Finding-Algorithms-c

License: MIT License

Shell 18.75% C 81.25%
algorithms bash-shell-script bisection-method c-programming-language false-position-method fixed-point-iteration gcc-complier linux-shell newton-raphson numerical-analysis

root-finding-algorithms-c's Introduction

Root Finding Algorithms in the c programming language

Writen in Linux Ubuntu 20.04.2 LTS.

Algorithms

  1. Bisection Method.

  2. False Position (Regula Falsi) Method.

  3. Newton-Raphson Method.

  4. Fixed Point Method.

Example Case:

Let $f(x) = 3x^2 - 2x +6$. The value can $x$ such that $f(x)=0$ was calculated by the above algorithms.

How to use

  1. Run the following command in the terminal:

	./run.sh
  1. Enter in the required quantities in the different fields until the program finshes.

Results


	STARTING PROGRAM

	File Names:
	1. bisection-method.c
	2. false-position-method.c
	3. fixed-point-iteration-method.c
	4. newton-raphson-method.c

	Were Compiled
	
	Running applications:


	---STARTING BISECTION METHOD---

	Enter an a: -1
	Enter a b:  0
	Enter the number of iterations: 100

	Bisection Method: Solution is -0.290994
	initial interval: [-1.000000, 0.000000]
 	number of iterations is: 100

	---ENDING BISECTION METHOD---

	---STARTING FALSE POSITION METHOD---

	Enter an a: -1
	Enter a b:  0
	Enter the number of iterations: 100

	False Position Method: Solution is -0.290994
	initial interval: [-1.000000, 0.000000]
	 number of iterations is: 100

	---ENDING FALSE POSITION METHOD---

	---STARTING FIXED POINT ITERATION---

	Enter an initial guess: 0

	Enter a tolerance:  0.00001
	Enter the maximum number of iterations: 1000

	Fixed Point Iteration: Solution is -0.290995

	---ENDING FIXED POINT ITERATION---

	---STARTING NEWTOW RAPHSON METHOD---

	Enter an initial guess: 0
	Enter the number of iterations: 100

	Newton Raphson Method: Solution is -0.290994
	number of iterations is: 100

	---ENDING NEWTON RAPHSON METHOD---

	ENDING PROGRAM

root-finding-algorithms-c's People

Contributors

louis-finegan avatar

Stargazers

 avatar

Watchers

 avatar

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.