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.
Need help setting up optimization objective function in V4
Posted Jul 5, 2010, 8:21 p.m. EDT 6 Replies
Please login with a confirmed email address before reporting spam
My objective function is to minimize (u - 100)^2, where u is the integral of a variable on a given boundary.
I've added the optimization node and a boundary integral to compute u, but don't know how to set up the square of the difference.
This seems like it should be so simple, but I've gotten nowhere. Can anyone advise?
Steve Conrad
Please login with a confirmed email address before reporting spam
Did you add the objective (global or integral) to your opt node? Seems to me just writing the (u-100)^2 in objective expression field should do the job. Can you be more specific about what is the problem.
Kind regards,
Nenad
Please login with a confirmed email address before reporting spam
Putting the expression (u-100)^2 in the expression field results in the integral of the entire expression. I just want to integrate a velocity variable (yielding u), and apply the resulting integral of this variable to the above expression.
Steve
Please login with a confirmed email address before reporting spam
I believe you should use a scalar variable as you have integrated your "u" before (watch out for naming conflicts COMSOL uses already "p,q,r,s,u,v,w,x,y,z", so you are in fact talking about scalars, no ?
Now, as you have a single variable, you could probably use only a "PDE constrined optimisation" without the optimisation module at all.
I usually refer to the example of the structural "Torsional moment" load application p.69 in V3.5a smeug.pdf , where you optimise the moment applied to the desired one, and the applied moment is integrated via a coupling variable
hope this helps
Ivar
Please login with a confirmed email address before reporting spam
I have not integrated u outside of the optimization step, so let me explain in more detail what I want to do. Perhaps I am approaching it wrong.
I have a fluid flow problem (2D axisymmetric) in a domain. My control variable is the permeability at an inlet boundary that allows fluid to enter the domain. Obivously for a given pressure gradient, the permeability will determine the fluid flow. I want to determine the value of permeability such that the volumetric flow that leaves the domain at the outlet is equal to an experimentally determined value (a parameter estimation problem). Thus I want to set up an optimization problem where the objective function returns a minimum when the exit flow is equal to the experimental value. To this end, I chose the objective function (U-10)^2, where U represents the integral of velocity (u) across the outlet to give me flow, and 10 is the experimentally determined value. I square the difference to make sure there is a minimum when the values are equal.
My impression is that I can set up an integral objective function to calculate U, the integral of u. I just don't know how to set up the rest of the optimization interface to achieve what I want to do. If I put the entire expression (u-10)^2 into the integral objective function, then it appears to me that it will integrate the whole expression, and not just u, and that is not what I want.
If anyone has any example of using the optimization feature, please let me know. There is not a single example of using this interface in the COMSOL documentation.
Please login with a confirmed email address before reporting spam
If anyone has any example of using the optimization feature, please let me know. There is not a single example of using this interface in the COMSOL documentation.
Hi,
The model libraries in COMSOL version 4.0a contain several example models using the Optimization interface:
* COMSOL Multiphysics: loaded_knee (Topology Optimization of a Loaded Knee Structure)
* Acoustics Module: horn_shape_optimization (Optimizing the Shape of a Horn)
* Chemical Reaction Engineering Module: microreactor_optimization (Optimization of a Catalytic Microreactor)
* Earth Science Module: aquifer_characterization (Aquifer Characterization)
Search tip: type
optimization
in the Search field on top of the Model Library window and click Search. That search finds all models where optimization appears in the model name or description.
Please login with a confirmed email address before reporting spam
This gave me some insight. It appears that I'll have to compute my error function outside of the optimization feature and refer to that result when setting up optimization, rather than trying to compute the error function within the optimization feature itself.
Steve
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.
Suggested Content
- BLOG Multiparameter Optimization with a Least-Squares Objective
- BLOG Equation-Based Modeling with a Space-Time Discretization
- FORUM Objective Function Gradient Components in Optimization Module
- FORUM Defining Objective function in Optimization
- KNOWLEDGE BASE COMSOL Multiphysics crashes when trying to access the documentation