- [math.js ( for calculate matrix, ... )](http://mathjs.org/)
Install math.js via npm
:
npm install mathjs
Run javascript file with NodeJS node cal
/* Example cal.js */
var ana = require('./ana.js');
var f = function(x){
// Secant method
//return 3*x + Math.sin(x) - Math.exp(x);
// Regula Falsi
//return Math.pow(x, 3) + (2*Math.pow(x, 2)) - x +5;
// Newton's method : Exercises -> Section1.3 -> 13
//return ((4*Math.pow(x, 3)) - 1 - Math.exp(parseFloat(Math.pow(x,2))/2));
// Mueller's method :
return 3*x + Math.sin(x) - Math.exp(x);
};
var g = function(x){
// Fixed-Point Iteration method
return Math.sqrt(2*parseFloat(x)+3);
};
//var result = ana.secant(f, 1, 0, 0.0000001);
//var result = ana.regulaFalsi(f, 0, 1, null);
//var result = ana.newton(f, -1, null, null);
//var result = ana.mueller(f, 0.8, 0.9, 1);
var result = ana.fixedPointIteration(g, 4, null);
console.log(result);
// Testing Matrics using math.js
console.log(ana.test());
- Secant method
- Regular Falsi (false position) method
- Newton's method
- Mueller's method
- Fixed-Point Iteration method
- Coming soon...
- Coming soon...
- Coming soon...
- Coming soon...
- Coming soon...
- Coming soon...
- Coming soon...
- Coming soon...
If this project help you reduce time to develop, you can give me a cup of coffee :)
I convert pseudo code from 'Applied Numerical Analysis (7th Edition)' to javascript for my work. I will be happy, if it works for you too.