- Posts: 4819
- Thank you received: 2177
scurve trajectory planner
- Aciera
- Offline
- Administrator
-
Less
More
1 year 8 months ago - 1 year 8 months ago #322065
by Aciera
Replied by Aciera on topic scurve trajectory planner
We also might want to call it a fail if max_iterations have been reached:
Strange that it thinks it has succeeded when the residual is still way off (looks like its happy to have found a local minimum or something):
Solution found after 1000000 iterations: gamma10 = -0.000148, gamma20 = 0.000011, s1 = 66.624893
Strange that it thinks it has succeeded when the residual is still way off (looks like its happy to have found a local minimum or something):
Last edit: 1 year 8 months ago by Aciera.
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
-
Less
More
- Posts: 4819
- Thank you received: 2177
1 year 8 months ago #322070
by Aciera
Replied by Aciera on topic scurve trajectory planner
Is there a particular reason for using 'Multidimensional Minimization' instead of 'Nonlinear Least-Squares Fitting' which would contain the dogleg method?
// Set up the Nelder-Mead solver
const gsl_multimin_fminimizer_type *T = gsl_multimin_fminimizer_nmsimplex2;
gsl_multimin_fminimizer *s = gsl_multimin_fminimizer_alloc(T, 3);
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
-
Less
More
- Posts: 4819
- Thank you received: 2177
1 year 8 months ago #322071
by Aciera
Replied by Aciera on topic scurve trajectory planner
reading this might explain why it is returning a local minimum:
www.gnu.org/software/gsl/doc/html/multimin.html
So in my opinion we are using the wrong solver.
www.gnu.org/software/gsl/doc/html/multimin.html
So in my opinion we are using the wrong solver.
The following user(s) said Thank You: akb1212, Grotius
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
-
Less
More
- Posts: 4819
- Thank you received: 2177
1 year 8 months ago #322073
by Aciera
Replied by Aciera on topic scurve trajectory planner
I'm way out of my depth here but this may help:
www.gnu.org/software/gsl/doc/html/nls.ht...east-squares-example
www.gnu.org/software/gsl/doc/html/nls.ht...east-squares-example
The following user(s) said Thank You: Grotius
Please Log in or Create an account to join the conversation.
- Grotius
- Offline
- Platinum Member
-
Less
More
- Posts: 2419
- Thank you received: 2349
1 year 8 months ago #322075
by Grotius
Replied by Grotius on topic scurve trajectory planner
Hi Arciera,
So in my opinion we are using the wrong solver.
Haha yes indeed we now use : Nelder-Mead simplex method
For now this solver prooved our codebase works ok.
Maybe we can switch solvers with a flag.
Then we can also measure different solvers performance time and choose the best one.
We will add a new dogleg solver soon, as libdogleg was kind of problematic. Github repository
also say's better to use seres solver.
The gauss now works without junction flaws, error solved in eq14_gauss.
It was kind off trickie error. It needed the theta, kappa, sharpness at the given distance.
This in combination with the gauss method, is tricky.
Result:
The drift vs gauss function in the example without fit method:
github updated
So in my opinion we are using the wrong solver.
Haha yes indeed we now use : Nelder-Mead simplex method
For now this solver prooved our codebase works ok.
Maybe we can switch solvers with a flag.
Then we can also measure different solvers performance time and choose the best one.
We will add a new dogleg solver soon, as libdogleg was kind of problematic. Github repository
also say's better to use seres solver.
The gauss now works without junction flaws, error solved in eq14_gauss.
It was kind off trickie error. It needed the theta, kappa, sharpness at the given distance.
This in combination with the gauss method, is tricky.
Result:
The drift vs gauss function in the example without fit method:
github updated
The following user(s) said Thank You: akb1212, Aciera
Please Log in or Create an account to join the conversation.
- Aciera
- Offline
- Administrator
-
Less
More
- Posts: 4819
- Thank you received: 2177
1 year 8 months ago #322076
by Aciera
Replied by Aciera on topic scurve trajectory planner
Why not try the dogleg solver in the GSL library?
Playing around with one of the examples linked above, it looks like we could possibly run 'levenberg-marquard', 'dogleg' and 'double dogleg' and '2D subspace' methods with our function and the Jacobian:
Playing around with one of the examples linked above, it looks like we could possibly run 'levenberg-marquard', 'dogleg' and 'double dogleg' and '2D subspace' methods with our function and the Jacobian:
Code:
/* define function to be minimized */
fdf.f = func_f;
fdf.df = func_df;
//fdf.fvv = func_fvv;
fdf.n = n;
fdf.p = p;
fdf.params = ¶ms;
/* starting point */
gsl_vector_set(x, 0, 6.0);
gsl_vector_set(x, 1, 14.5);
fprintf(stderr, "%-25s %-6s %-5s %-5s %-13s %-12s %-13s %-15s\n",
"Method", "NITER", "NFEV", "NJEV", "Initial Cost",
"Final cost", "Final cond(J)", "Final x");
fdf_params.trs = gsl_multifit_nlinear_trs_lm;
solve_system(x, &fdf, &fdf_params);
//fdf_params.trs = gsl_multifit_nlinear_trs_lmaccel;
//solve_system(x, &fdf, &fdf_params);
fdf_params.trs = gsl_multifit_nlinear_trs_dogleg;
solve_system(x, &fdf, &fdf_params);
fdf_params.trs = gsl_multifit_nlinear_trs_ddogleg;
solve_system(x, &fdf, &fdf_params);
fdf_params.trs = gsl_multifit_nlinear_trs_subspace2D;
solve_system(x, &fdf, &fdf_params);
gsl_vector_free(f);
gsl_vector_free(x);
return 0;
The following user(s) said Thank You: akb1212, Grotius
Please Log in or Create an account to join the conversation.
Time to create page: 0.141 seconds