Skip to content

Commit

Permalink
modified: README.md
Browse files Browse the repository at this point in the history
	renamed:    dist/Ceres-v2.0.14.mjs -> dist/ceres.js
	modified:   docs/arrow_functions.html
	modified:   docs/json_syntax.html
	modified:   docs/powell.html
	modified:   docs/quadratic.html
	modified:   docs/rosenbrock.html
	modified:   docs/user1.html
  • Loading branch information
miner committed Jan 4, 2024
1 parent 8a8bebb commit 139e3cc
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 26 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ You can install Ceres.js by including the Ceres.js file in your HTML or js code.
```HTML
<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');
//Your Code Here
}
ceresLoading()
</script>
```

Expand All @@ -27,25 +28,22 @@ Recently in 2024 we have introduced a new syntax for the Ceres js engine.
let jsonSystem = {
"variables": {
"a": {
"lowerbound": 1.6,
"lowerbound": -3,
"guess": 1,
},
"b": {
"upperbound": 1.7,
"upperbound": 5,
"guess": 2,
},
},
"functions": [
"a + 10 * b - 20",
"Math.sqrt(5) * a - b * b"
],
"callbacks": [
"console.log(x)"
"sqrt(5) * a - b * b"
]
};
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');
var solver = new Ceres();
solver.run(jsonSystem);
}
Expand All @@ -62,7 +60,7 @@ Ceres.js takes a vector of residual equations that are all equal to zero when th
```html
<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs'); //Always imported via ES6 import
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js'); //Always imported via ES6 import
var fn1 = function f1(x){
return (x[0]+10*x[1]-20); //this equation is of the form f1(x) = 0
Expand Down
47 changes: 37 additions & 10 deletions dist/Ceres-v2.0.14.mjs → dist/ceres.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/arrow_functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2>User Defined Function</h2>

<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');

let f = function (x, a, b, c){
return a*x[0]*x[0] + b*x[0] + c
Expand Down
4 changes: 2 additions & 2 deletions docs/json_syntax.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ <h2>JSON Syntax Demo Function</h2>
},
"functions": [
"a + 10 * b - 20",
"Math.sqrt(5) * a - b * b + 4"
"sqrt(5) * a - b^2 + 4"
]
};

async function ceresSolve() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.13.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');
let solver = new Ceres();
let results = await solver.run(jsonSystem);
document.getElementById("demo").value = results.report //Print solver report
Expand Down
2 changes: 1 addition & 1 deletion docs/powell.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ <h2>Powell Function</h2>

<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');

var fn1 = function f1(x){
return (x[0]+10*x[1]);
Expand Down
2 changes: 1 addition & 1 deletion docs/quadratic.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h2>Quadratic Function</h2>

<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');

var fn1 = function f1(x){
return (x[0]+10*x[1]-20); //this equation is of the for f1(x) = 0
Expand Down
2 changes: 1 addition & 1 deletion docs/rosenbrock.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2>Rosebrock Function</h2>

<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');

var fn1 = function (x){
return (1.0 - x[0]) * (1.0 - x[0]) + 100.0 * (x[1] - x[0] * x[0]) * (x[1] - x[0] * x[0]);
Expand Down
2 changes: 1 addition & 1 deletion docs/user1.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ <h2>User Defined Function</h2>

<script>
async function ceresLoading() {
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/Ceres-v2.0.2.mjs');
const {Ceres} = await import('https://cdn.jsdelivr.net/gh/Pterodactylus/Ceres.js@master/dist/ceres.js');

var fn1 = function f1(x){
return x[0]/207000 + Math.pow((x[0]/1349),(1/0.282)) - Math.pow((260),2)/(207000*x[0]);
Expand Down

0 comments on commit 139e3cc

Please sign in to comment.