Skip to content
Snippets Groups Projects
Commit ffe59c00 authored by James Goppert's avatar James Goppert
Browse files

Added options to trim program.

parent b700265f
No related branches found
No related tags found
No related merge requests found
...@@ -44,9 +44,9 @@ class Callback : public JSBSim::FGNelderMead::Callback ...@@ -44,9 +44,9 @@ class Callback : public JSBSim::FGNelderMead::Callback
public: public:
void eval(const std::vector<double> &v) void eval(const std::vector<double> &v)
{ {
std::cout << "v: "; //std::cout << "v: ";
for (int i=0;i<v.size();i++) std::cout << v[i] << " "; //for (int i=0;i<v.size();i++) std::cout << v[i] << " ";
std::cout << std::endl; //std::cout << std::endl;
} }
} callback; } callback;
...@@ -67,9 +67,9 @@ int main (int argc, char const* argv[]) ...@@ -67,9 +67,9 @@ int main (int argc, char const* argv[])
constraints.velocity = 500; constraints.velocity = 500;
std::string aircraft="f16"; std::string aircraft="f16";
double rtol = std::numeric_limits<float>::epsilon(); double rtol = std::numeric_limits<float>::epsilon();
double abstol = std::numeric_limits<double>::epsilon(); double abstol = 1e-2;//std::numeric_limits<double>::epsilon();
double speed = 2.0; double speed = 1.1; // > 1
double random = 0.1; // 10% random factor added to all simplex calcs double random = 0; // random scale factor added to all simplex calcs
int iterMax = 2000; int iterMax = 2000;
bool showConvergeStatus = false; bool showConvergeStatus = false;
bool pause = false; bool pause = false;
...@@ -150,10 +150,11 @@ int main (int argc, char const* argv[]) ...@@ -150,10 +150,11 @@ int main (int argc, char const* argv[])
prompt("\tshow converge status?\t",showConvergeStatus); prompt("\tshow converge status?\t",showConvergeStatus);
prompt("\tshow simplex?\t\t",showSimplex); prompt("\tshow simplex?\t\t",showSimplex);
prompt("\tpause?\t\t\t",pause); prompt("\tpause?\t\t\t",pause);
//prompt("\trelative tolerance\t",rtol); prompt("\trelative tolerance\t",rtol);
//prompt("\tabsolute tolerance\t",abstol); prompt("\tabsolute tolerance\t",abstol);
//prompt("\tmax iterations\t\t",iterMax); prompt("\tmax iterations\t\t",iterMax);
//prompt("\tconvergence speed\t",speed); prompt("\tconvergence speed\t",speed);
prompt("\trandomization ratio\t",random);
std::cout << std::fixed; std::cout << std::fixed;
// initial solver state // initial solver state
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment