summaryrefslogtreecommitdiff
path: root/tests/general_tests/fminbnd
diff options
context:
space:
mode:
authorharpreet2016-04-16 12:12:15 +0530
committerharpreet2016-04-16 12:12:15 +0530
commit10e2e4d8b4a7592a8631ddac8e8d1664d6f0b9e3 (patch)
tree087af3ca1853d01afef58684b09b537597317023 /tests/general_tests/fminbnd
parent8484c85784b84cc3a9257f8d8065b3a8a7800628 (diff)
downloadFOSSEE-Optimization-toolbox-10e2e4d8b4a7592a8631ddac8e8d1664d6f0b9e3.tar.gz
FOSSEE-Optimization-toolbox-10e2e4d8b4a7592a8631ddac8e8d1664d6f0b9e3.tar.bz2
FOSSEE-Optimization-toolbox-10e2e4d8b4a7592a8631ddac8e8d1664d6f0b9e3.zip
fmincon examples
Diffstat (limited to 'tests/general_tests/fminbnd')
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical10.sce30
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical11.sce31
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical12.sce31
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical13.sce32
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical3.sce33
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical4.sce33
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical5.sce31
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical6.sce31
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical7.sce33
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical8.sce33
-rw-r--r--tests/general_tests/fminbnd/fminbnd_logical9.sce30
11 files changed, 348 insertions, 0 deletions
diff --git a/tests/general_tests/fminbnd/fminbnd_logical10.sce b/tests/general_tests/fminbnd/fminbnd_logical10.sce
new file mode 100644
index 0000000..d36072a
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical10.sce
@@ -0,0 +1,30 @@
+
+function y = fun(x)
+ y = -1/(1-x*x);
+endfunction
+x1 = [0];
+x2 = [1000];
+
+//Output
+//
+//Error in step computation (regularization becomes too large?)!
+// lambda =
+//
+// lower: [0x0 constant]
+// upper: [0x0 constant]
+// output =
+//
+// Iterations: 108
+// Cpu_Time: 0.064
+// Message: "Error in step computation (regularization becomes too large?)!"
+// exitflag =
+//
+// 10
+// fopt =
+//
+// []
+// xopt =
+//
+// []
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical11.sce b/tests/general_tests/fminbnd/fminbnd_logical11.sce
new file mode 100644
index 0000000..0681d30
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical11.sce
@@ -0,0 +1,31 @@
+
+function y = fun(x)
+ y = -sqrt(x*x);
+endfunction
+x1 = [-10];
+x2 = [-5];
+
+//Output
+//
+//Optimal Solution Found.
+// lambda =
+//
+// lower: 1.0000018
+// upper: 0.0000018
+// output =
+//
+// Iterations: 5
+// Cpu_Time: 0.036
+// Objective_Evaluation: 6
+// Dual_Infeasibility: 2.390D-11
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// - 9.9999909
+// xopt =
+//
+// - 9.9999909
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
diff --git a/tests/general_tests/fminbnd/fminbnd_logical12.sce b/tests/general_tests/fminbnd/fminbnd_logical12.sce
new file mode 100644
index 0000000..0613aa8
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical12.sce
@@ -0,0 +1,31 @@
+
+function y = fun(x)
+ y = log(x);
+endfunction
+x1 = [-10];
+x2 = [0];
+
+//Output
+//
+//Optimal Solution Found.
+// lambda =
+//
+// lower: 0.0000018
+// upper: 0.0000018
+// output =
+//
+// Iterations: 4
+// Cpu_Time: 0.028
+// Objective_Evaluation: 5
+// Dual_Infeasibility: 0
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 0.
+// xopt =
+//
+// - 0.7727429
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
diff --git a/tests/general_tests/fminbnd/fminbnd_logical13.sce b/tests/general_tests/fminbnd/fminbnd_logical13.sce
new file mode 100644
index 0000000..64debea
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical13.sce
@@ -0,0 +1,32 @@
+
+function y = fun(x)
+ y = -sqrt(x^3);
+endfunction
+x1 = [-10];
+x2 = [-5];
+
+//Output
+//
+//Optimal Solution Found.
+// lambda =
+//
+// lower: 0.0000036
+// upper: 0.0000036
+// output =
+//
+// Iterations: 4
+// Cpu_Time: 0.028
+// Objective_Evaluation: 5
+// Dual_Infeasibility: 0
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 0.
+// xopt =
+//
+// - 5.4668503
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
diff --git a/tests/general_tests/fminbnd/fminbnd_logical3.sce b/tests/general_tests/fminbnd/fminbnd_logical3.sce
new file mode 100644
index 0000000..2687733
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical3.sce
@@ -0,0 +1,33 @@
+
+function y = fun(x)
+ y = -1/x;
+endfunction
+x1 = [0];
+x2 = [1.5];
+
+//Output
+//
+//Stop at Tiny Step
+// lambda =
+//
+// lower: 1.235D+14
+// upper: 0.0000061
+// output =
+//
+// Iterations: 1.663D+09
+// Cpu_Time: 0.112
+// Objective_Evaluation: 34
+// Dual_Infeasibility: 1747.2543
+// Message: "Stop at Tiny Step"
+// exitflag =
+//
+// 3
+// fopt =
+//
+// - 11111111.
+// xopt =
+//
+// 1.000D-07
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical4.sce b/tests/general_tests/fminbnd/fminbnd_logical4.sce
new file mode 100644
index 0000000..69c6960
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical4.sce
@@ -0,0 +1,33 @@
+
+function y = fun(x)
+ y = 1/x;
+endfunction
+x1 = [-10];
+x2 = [0];
+
+//Output
+//
+//Optimal Solution Found.
+// lambda =
+//
+// lower: 0.0000013
+// upper: 1.235D+14
+// output =
+//
+// Iterations: 18
+// Cpu_Time: 0.096
+// Objective_Evaluation: 19
+// Dual_Infeasibility: 0.0232831
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// - 11111339.
+// xopt =
+//
+// - 1.000D-07
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical5.sce b/tests/general_tests/fminbnd/fminbnd_logical5.sce
new file mode 100644
index 0000000..0e9f670
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical5.sce
@@ -0,0 +1,31 @@
+
+function y = fun(x)
+ y = -1/(x*x);
+endfunction
+x1 = [0];
+x2 = [1.5];
+
+//Output
+//
+//Error in step computation (regularization becomes too large?)!
+// lambda =
+//
+// lower: [0x0 constant]
+// upper: [0x0 constant]
+// output =
+//
+// Iterations: 108
+// Cpu_Time: 0.06
+// Message: "Error in step computation (regularization becomes too large?)!"
+// exitflag =
+//
+// 10
+// fopt =
+//
+// []
+// xopt =
+//
+// []
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical6.sce b/tests/general_tests/fminbnd/fminbnd_logical6.sce
new file mode 100644
index 0000000..d030a86
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical6.sce
@@ -0,0 +1,31 @@
+
+function y = fun(x)
+ y = 1/(x*x);
+endfunction
+x1 = [-10];
+x2 = [0];
+
+//Output
+//
+//Error in step computation (regularization becomes too large?)!
+// lambda =
+//
+// lower: [0x0 constant]
+// upper: [0x0 constant]
+// output =
+//
+// Iterations: 108
+// Cpu_Time: 0.06
+// Message: "Error in step computation (regularization becomes too large?)!"
+// exitflag =
+//
+// 10
+// fopt =
+//
+// []
+// xopt =
+//
+// []
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical7.sce b/tests/general_tests/fminbnd/fminbnd_logical7.sce
new file mode 100644
index 0000000..8207f92
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical7.sce
@@ -0,0 +1,33 @@
+
+function y = fun(x)
+ y = exp(x);
+endfunction
+x1 = [-1000];
+x2 = [1000];
+
+//Output
+//
+//Optimal Solution Found.
+// lambda =
+//
+// lower: 9.183D-09
+// upper: 9.001D-09
+// output =
+//
+// Iterations: 10
+// Cpu_Time: 0.064
+// Objective_Evaluation: 11
+// Dual_Infeasibility: 0.0000455
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 0.0000455
+// xopt =
+//
+// - 9.9979363
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical8.sce b/tests/general_tests/fminbnd/fminbnd_logical8.sce
new file mode 100644
index 0000000..fa0785c
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical8.sce
@@ -0,0 +1,33 @@
+
+function y = fun(x)
+ y = sin(x)*exp(x);
+endfunction
+x1 = [-1000];
+x2 = [1000];
+
+//Output
+//
+//Optimal Solution Found.
+// lambda =
+//
+// lower: 9.183D-09
+// upper: 9.001D-09
+// output =
+//
+// Iterations: 10
+// Cpu_Time: 0.064
+// Objective_Evaluation: 11
+// Dual_Infeasibility: 0.0000455
+// Message: "Optimal Solution Found"
+// exitflag =
+//
+// 0
+// fopt =
+//
+// 0.0000455
+// xopt =
+//
+// - 9.9979363
+
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+
diff --git a/tests/general_tests/fminbnd/fminbnd_logical9.sce b/tests/general_tests/fminbnd/fminbnd_logical9.sce
new file mode 100644
index 0000000..7581feb
--- /dev/null
+++ b/tests/general_tests/fminbnd/fminbnd_logical9.sce
@@ -0,0 +1,30 @@
+
+function y = fun(x)
+ y = -1/(x*x);
+endfunction
+x1 = [0];
+x2 = [1000];
+
+//Output
+//
+//Error in step computation (regularization becomes too large?)!
+// lambda =
+//
+// lower: [0x0 constant]
+// upper: [0x0 constant]
+// output =
+//
+// Iterations: 108
+// Cpu_Time: 0.064
+// Message: "Error in step computation (regularization becomes too large?)!"
+// exitflag =
+//
+// 10
+// fopt =
+//
+// []
+// xopt =
+//
+// []
+[xopt,fopt,exitflag,output,lambda] = fminbnd (fun, x1, x2)
+