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.

Extracting element-level sensitivities for Topology Optimization in LiveLink

Hendrik Mechanical Engineering

Please login with a confirmed email address before reporting spam

Hi all,

For our optimization problem we want to use MATLAB to run MMA and compute the objective function , constraints and sensitivities ( for an objective that is not supported by COMSOL ).

Extracting the global stiffness matrix, load vector and element volumes (for objective function and constraint values) is working fine.

However, computing the sensitivity of any objective function requires the element-level stiffness matrices , because the density variables act on those individual matrices.

Would anyone know how to extract these element matrices ? or a workaround for computing objective function sensitivity in MATLAB? (first we implement a compliance minimization problem to see if the method works).

Thanks in advance!


9 Replies Last Post 27.07.2023, 03:46 GMT-4
Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 18.07.2023, 02:47 GMT-4

Hi Kaap H.

It might be possible to solve it directly in the GUI without any coding. Can you explain the problem you are trying to solve?

Best regards,

Kristian E. Jensen

Technical Product Manager, Optimization

Hi Kaap H. It might be possible to solve it directly in the GUI without any coding. Can you explain the problem you are trying to solve? Best regards, Kristian E. Jensen Technical Product Manager, Optimization

Hendrik Mechanical Engineering

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 18.07.2023, 05:06 GMT-4
Updated: 1 year ago 18.07.2023, 08:13 GMT-4

We are trying to optimize the tensile energy present in a prestressed structure. (using plate elements and topology optimization).

The objective function is the ratio of the geometric stiffness matrix (G) and the "standard" stiffness matrix (K), pre and post multiplied by the eigenmodes (x), so x'Gx/x'Kx

As far as I am aware, COMSOL does not support topology optimization for frequency-related problems, nor custom objective functions such as these.

For the sensitivity analysis, the element-wise matrices would be required

We are trying to optimize the tensile energy present in a prestressed structure. (using plate elements and topology optimization). The objective function is the ratio of the geometric stiffness matrix (G) and the "standard" stiffness matrix (K), pre and post multiplied by the eigenmodes (x), so x'Gx/x'Kx As far as I am aware, COMSOL does not support topology optimization for frequency-related problems, nor custom objective functions such as these. For the sensitivity analysis, the element-wise matrices would be required

Hendrik Mechanical Engineering

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 19.07.2023, 04:19 GMT-4

I believe this problem is definitely manageable if one is able to extract the element level matrices for sensitivity analysis, or implement a custom function for the sensitivity in COMSOL itself.

As far as I understand it right now, it is not possible?

Looking forward to your reply,

I believe this problem is definitely manageable if one is able to extract the element level matrices for sensitivity analysis, or implement a custom function for the sensitivity in COMSOL itself. As far as I understand it right now, it is not possible? Looking forward to your reply,

Hendrik Mechanical Engineering

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 24.07.2023, 09:50 GMT-4

Hi,

I was wondering if extracting element-level matrices is supported.

Please also let me know if this is indeed not possible in COMSOL.

Kind Regards

Hi, I was wondering if extracting element-level matrices is supported. Please also let me know if this is indeed not possible in COMSOL. Kind Regards

Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 25.07.2023, 04:23 GMT-4

COMSOL has full support for gradient based optimization over frequency domain problems. Gradient based optimization with the eigenvalue solver is also supported, but only for objectives expressed in terms of the eigenvalues (not the eigenmodes).

You can, however, formulate your eigenvalue problem as non-linear stationary problem. If you are able to make that work (robustly), you might be able to use gradient based optmization with the stationary solver to achieve your goal.

COMSOL has full support for gradient based optimization over frequency domain problems. Gradient based optimization with the eigenvalue solver is also supported, but only for objectives expressed in terms of the eigenvalues (not the eigenmodes). You can, however, formulate your eigenvalue problem as non-linear stationary problem. If you are able to make that work (robustly), you might be able to use gradient based optmization with the stationary solver to achieve your goal.

Hendrik Mechanical Engineering

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 25.07.2023, 05:45 GMT-4

COMSOL has full support for gradient based optimization over frequency domain problems. Gradient based optimization with the eigenvalue solver is also supported, but only for objectives expressed in terms of the eigenvalues (not the eigenmodes).

You can, however, formulate your eigenvalue problem as non-linear stationary problem. If you are able to make that work (robustly), you might be able to use gradient based optmization with the stationary solver to achieve your goal.

Thanks for your reply. Is support for gradient-based optimization using a Density Model in Topology Optimization also included?

>COMSOL has full support for gradient based optimization over frequency domain problems. Gradient based optimization with the eigenvalue solver is also supported, but only for objectives expressed in terms of the eigenvalues (not the eigenmodes). > >You can, however, formulate your eigenvalue problem as non-linear stationary problem. If you are able to make that work (robustly), you might be able to use gradient based optmization with the stationary solver to achieve your goal. Thanks for your reply. Is support for gradient-based optimization using a Density Model in Topology Optimization also included?

Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 25.07.2023, 07:35 GMT-4
Updated: 1 year ago 25.07.2023, 08:52 GMT-4

Thanks for your reply. Is support for gradient-based optimization using a Density Model in Topology Optimization also included?

Yes, we have many models demonstrating this. You can search the application library and/or gallery to see them. This is a simple example.

>Thanks for your reply. Is support for gradient-based optimization using a Density Model in Topology Optimization also included? Yes, we have many models demonstrating this. You can search the application library and/or gallery to see them. [This](https://www.comsol.com/model/7428) is a simple example.

Hendrik Mechanical Engineering

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 26.07.2023, 05:11 GMT-4
Updated: 1 year ago 26.07.2023, 05:18 GMT-4

You can, however, formulate your eigenvalue problem as non-linear stationary problem. If you are able to make that work (robustly), you might be able to use gradient based optmization with the stationary solver to achieve your goal.

Hi Kristian,

Could you elaborate on the formulation you mentioned? How can the static+eigenfrequency analysis be formulated as a nonlinear stationary problem ?

And how would this be implemented in COMSOL?

>You can, however, formulate your eigenvalue problem as non-linear stationary problem. If you are able to make that work (robustly), you might be able to use gradient based optmization with the stationary solver to achieve your goal. Hi Kristian, Could you elaborate on the formulation you mentioned? How can the static+eigenfrequency analysis be formulated as a nonlinear stationary problem ? And how would this be implemented in COMSOL?

Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 1 year ago 27.07.2023, 03:46 GMT-4

Could you elaborate on the formulation you mentioned?

You will need to create a global dependent variable for the eigenvalue. You will also need to add an equation for normalizing the eigenvector (this is where you use the test function of the eigenvalue).

>Could you elaborate on the formulation you mentioned? You will need to create a global dependent variable for the eigenvalue. You will also need to add an equation for normalizing the eigenvector (this is where you use the test function of the eigenvalue).

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.