Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Consistently optimizing to wrong value

Please login with a confirmed email address before reporting spam

TL;DR: 'self-benchmark' for optimization module is giving a wrong final answer, even though the benchmark was generated with the exact same model.

Hello, and thank you in advance!

I'm trying to use Comsol optimization to find a diffusion coefficient, so I made a simple self-benchmark case to make sure I'm using the software correctly. I defined a simple 2d geometry and used the coefficient form PDE solver to generate a 'baseline' where I diffuse a species for 1 day with an interdiffusion coefficient of 1e-13. I export this to excel, save it as a CSV, and then use it as an objective for a least squares function optimization over an area.

I'll review the settings below, but essentially optimization gives a diffusion coefficient of 1.7e-13, not 1e-13 (or if the baseline is changed, 2.7e-13 instead of 2e-13). It seems very consistent; I can't get the solution to change with different solvers, settings, meshes or geometries. Since the baseline was generated by the exact same model, I see no reason why it should not get within 0.1% or so of the real solution.

Assume defaults unless specified
-1 parameter, Dcoeff, 1e-13 baseline value. This is the only optimization variable.
-Tried starting values of 1e-12, 1e-14 and scales of 1e-13 and 1e-14. Upper limit 1e-8, lower 1e-17. All eventually converge on 1.7e-13
-Nedler-Mead and BOBYQA tried, both converge on 1.7e-13
-Remeshing changes things a little - all previous are on 'fine' quads, switching to 'fine' triangles gives 2.74e-13 instead of 2e-13.
-Turning up the optimality tolerance had no effect
-Objective function is only evaluated at t=86400 s (1 day)
-Geometry is 3 rectangles; two 200x200 um on top and a 400x200 one on bottom, to make a big square. Top left has starting concentration value of 0.5; others start at 0. Zero flux on outer boundaries.

Let me know if any other details or an upload of the model would explain further, thank you!!!

1 Reply Last Post 27.07.2015, 20:28 GMT-4

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 27.07.2015, 20:28 GMT-4
Support helped me out - the baseline I was exporting had spatial coordinates of microns, importing it back in as an optimization target was in meters. Divided by 1,000,000 and everything worked (though I'm pretty amazed it converged on anything at all when I had that wrong!) Thank you!
Support helped me out - the baseline I was exporting had spatial coordinates of microns, importing it back in as an optimization target was in meters. Divided by 1,000,000 and everything worked (though I'm pretty amazed it converged on anything at all when I had that wrong!) Thank you!

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.