Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
6 mai 2012, 23:07 UTC−4
Your objective function would perhaps be better set up as:
(p-15000)^2
which may give a more rapid convergence than your linear formulation.
How you set up your objective function depends on how you will evaluate p. If p is defined on a point, you could use a point objective. If not, you could set up a probe to calculate the average of p over a boundary, and use this in a global objective, replacing 'p' with the probe name.
You would also add a global control variable and specify C. You will need to give an appropriate initial value so that the local minimum objective found is the correct one. If you need to add constraints on C, you can also do this, but since you have only one control variable, this may not be necessary with a good initial guess.
Your objective function would perhaps be better set up as:
(p-15000)^2
which may give a more rapid convergence than your linear formulation.
How you set up your objective function depends on how you will evaluate p. If p is defined on a point, you could use a point objective. If not, you could set up a probe to calculate the average of p over a boundary, and use this in a global objective, replacing 'p' with the probe name.
You would also add a global control variable and specify C. You will need to give an appropriate initial value so that the local minimum objective found is the correct one. If you need to add constraints on C, you can also do this, but since you have only one control variable, this may not be necessary with a good initial guess.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
8 mai 2012, 06:51 UTC−4
Thank you very much for your answer, i found it very useful. I forgot to specify that my model is 3D and p is the average pressure over the domain (my model is a simple cilinder, so there is only one domain); so i setted up a probe to calculate the average of p over the domain (named by comsol "dom2") and setted optimization module this way:
Global Objective: (dom2-15000)^2
Control variable Field : C with an initial value of 1.4e8 (opplied only to outlet boundary)
Pointwise inequality constraint: C with lower bound=1.4e8 and higher bound=2.666e8
I used that values for C because i found on a paper that they should vary from 1.4e8 to 2.666e8, so the optimal value should be between these.
However i think that i should change some setting to consider the hugeness of C values:
infact, as you can see from the attached image, the variations in C value each iteration is too low, so COMSOL returns only a few of results and then stops saying that the current point can't be improved.
LOG:
Optimization Solver 1 in Solver 1 started at 8-mag-2012 11:59:05.
Optimization solver (SNOPT)
Itns Major Minor Step nPDE Error Objective
416 0 416 - 1 0.00115 7.435e+006
516 1 100 0.11 2 0.00115 7.435e+006
616 2 100 0.07 4 0.00115 7.435e+006
716 3 100 1.00 5 0.00115 7.435e+006
Warning: There were 8 warning messages from the linear solver.
Warning: Ill-conditioned preconditioner. Increase factor in error estimate.
Warning: Forward solution failed, requesting reduced step.
Warning: There were 61 warning messages from the linear solver.
Warning: Ill-conditioned preconditioner. Increase factor in error estimate.
then i canceled the process.
Should i increase the C value increase at each iterations?
Thank you very much for your answer, i found it very useful. I forgot to specify that my model is 3D and p is the average pressure over the domain (my model is a simple cilinder, so there is only one domain); so i setted up a probe to calculate the average of p over the domain (named by comsol "dom2") and setted optimization module this way:
Global Objective: (dom2-15000)^2
Control variable Field : C with an initial value of 1.4e8 (opplied only to outlet boundary)
Pointwise inequality constraint: C with lower bound=1.4e8 and higher bound=2.666e8
I used that values for C because i found on a paper that they should vary from 1.4e8 to 2.666e8, so the optimal value should be between these.
However i think that i should change some setting to consider the hugeness of C values:
infact, as you can see from the attached image, the variations in C value each iteration is too low, so COMSOL returns only a few of results and then stops saying that the current point can't be improved.
LOG:
Optimization Solver 1 in Solver 1 started at 8-mag-2012 11:59:05.
Optimization solver (SNOPT)
Itns Major Minor Step nPDE Error Objective
416 0 416 - 1 0.00115 7.435e+006
516 1 100 0.11 2 0.00115 7.435e+006
616 2 100 0.07 4 0.00115 7.435e+006
716 3 100 1.00 5 0.00115 7.435e+006
Warning: There were 8 warning messages from the linear solver.
Warning: Ill-conditioned preconditioner. Increase factor in error estimate.
Warning: Forward solution failed, requesting reduced step.
Warning: There were 61 warning messages from the linear solver.
Warning: Ill-conditioned preconditioner. Increase factor in error estimate.
then i canceled the process.
Should i increase the C value increase at each iterations?
Ivar KJELBERG
COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
8 mai 2012, 08:14 UTC−4
Hi
often before you start an optimisation, then it's worth to prescan the domain (in particular when you have only 1 variable) i.e. run a continuation scan or parametric sweep of your variable and then start your optimisation close to the final value
--
Good luck
Ivar
Hi
often before you start an optimisation, then it's worth to prescan the domain (in particular when you have only 1 variable) i.e. run a continuation scan or parametric sweep of your variable and then start your optimisation close to the final value
--
Good luck
Ivar
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
8 mai 2012, 13:03 UTC−4
Marco,
The ill-conditioned preconditioner warning suggests that your model is not well formulated. As Ivar suggested, try running a parametric sweep on several values of C across your inequality range to make sure the model solves properly. This will need to be fixed first.
Other comments:
I see you have variables C1 as well as C. What is the purpose of C1? You should optimize C directly if C is the parameter in your equation. This may contribute to the lack of progression in your optimization.
I see you have defined a Control Variable Field for C. This should be a Global Control Variable defined as C.
You have defined a pointwise inequality constraint on C1. This perhaps should be a global inequality constraint (again, on C rather than C1). With C defined as a Global Control Variable however, you can provide the upper and lower bounds in that dialog box, eliminating the need for this additional constraint.
Your model is stuck with a pressure of 12947, which is a distance away from your target of 15000. Using the parametric solver, make sure there is not a local minimum near that value of C. Given the form of your equation, I suspect this is not the problem, and reformulation of your model as described above may take care of this.
If these do not solve the problem, send a copy of your model. However, I will not have access to my COMSOL workstation for the next 2 weeks.
Marco,
The ill-conditioned preconditioner warning suggests that your model is not well formulated. As Ivar suggested, try running a parametric sweep on several values of C across your inequality range to make sure the model solves properly. This will need to be fixed first.
Other comments:
I see you have variables C1 as well as C. What is the purpose of C1? You should optimize C directly if C is the parameter in your equation. This may contribute to the lack of progression in your optimization.
I see you have defined a Control Variable Field for C. This should be a Global Control Variable defined as C.
You have defined a pointwise inequality constraint on C1. This perhaps should be a global inequality constraint (again, on C rather than C1). With C defined as a Global Control Variable however, you can provide the upper and lower bounds in that dialog box, eliminating the need for this additional constraint.
Your model is stuck with a pressure of 12947, which is a distance away from your target of 15000. Using the parametric solver, make sure there is not a local minimum near that value of C. Given the form of your equation, I suspect this is not the problem, and reformulation of your model as described above may take care of this.
If these do not solve the problem, send a copy of your model. However, I will not have access to my COMSOL workstation for the next 2 weeks.
Please login with a confirmed email address before reporting spam
Posted:
1 decade ago
14 mai 2012, 07:14 UTC−4
Tahk you very very vey much! Now the optimization works! I followed Ivar'suggestion and i did a prescan using parametric sweep. The i followed Steve'suggestion using global objective and global control variable.
Finally i obtained the results i expected.
Thank you again for your precious suggestion and your great hlpfulness.
Best regards,
Marco
Tahk you very very vey much! Now the optimization works! I followed Ivar'suggestion and i did a prescan using parametric sweep. The i followed Steve'suggestion using global objective and global control variable.
Finally i obtained the results i expected.
Thank you again for your precious suggestion and your great hlpfulness.
Best regards,
Marco