Skip to content

Commit

Permalink
Merge branch 'hotfix/legal'
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Chapligin committed Oct 10, 2013
2 parents e5de7d6 + d166b33 commit 217ffd7
Show file tree
Hide file tree
Showing 9 changed files with 760 additions and 0 deletions.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
Simpson's rule - a method for numerical integration.
====================================================


Just playing with requirjs/bootstrap for learning purposes. Feel free to use it on your as or as
a library in your project.


js/simpson.js
-------------

*** Requires math.js module (http://www.mathjs.org) ***

A javascript module, that implements Simpson's rule. There are two public functions:

* integrate: function(expression, b, a, N)
* inaccuracy: function(expression, b, a, N)

They have same parameters list:

* expression --- a function, dependant on x (and only on x) variable.
* b --- Upper domain bound.
* a --- Lower domain bound.
* N --- Number of steps to calculate. The bigger the number, the slower calculations is, but the
results will be more precise.

integrate function calculates value of a definite integral expression(x) dx in a reange [a;b].

inaccuracy function estimates integral's value inaccuracy using Runge rule. Please note, that this function
recalculates value of the integral two time with different number of steps.


(C) Denis V Chapligin, 2013. Released under terms of GPLv3.
9 changes: 9 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<!doctype html>
<!--
*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*
-->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en-gb"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en-gb"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en-gb"> <![endif]-->
Expand Down
7 changes: 7 additions & 0 deletions src/js/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*/
define([
"jquery",
"bootstrap",
Expand Down
7 changes: 7 additions & 0 deletions src/js/form.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*/
define(["jsrender", "math", "simpson"],function (renderer, math, simpson) {
return {
validateFunction: function(selector) {
Expand Down
7 changes: 7 additions & 0 deletions src/js/simpson.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*/
define(["math"], function(math) {
/**
* Implements Simpson's rule numerical integration algorithm,
Expand Down
9 changes: 9 additions & 0 deletions test/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<!DOCTYPE html>
<!--
*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*
-->
<html>
<head>
<meta charset="utf-8">
Expand Down
7 changes: 7 additions & 0 deletions test/js/testSimpson.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*/
define(function(require) {
var Simpson = require("simpson");

Expand Down
7 changes: 7 additions & 0 deletions test/js/tests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/*
* Copyright (C) 2013 Denis V Chapligin.
* Distributed under the GPLv3.
* (See accompanying file LICENSE or copy at
* http://www.gnu.org/licenses/gpl-3.0.txt)
*
*/
(function() {
QUnit.config.autostart = false;

Expand Down

0 comments on commit 217ffd7

Please sign in to comment.