Multiple Sensitivity Analysis steps per study

Please login with a confirmed email address before reporting spam

The below post is related to an archived discussion


Hi!

I would like to calculate multiple objective- and sensitivity functions based on a single study, but Comsol does not seem to allow this. What I would really like to avoid is to define a new study per objective, having to repeat a lot of the same finite element analyses. Since I am running a large-scale topology optimization algorithm through LiveLink, I do need these objectives and sensitivities separately but efficiently. I noticed that this old post referred above never got a reply, but I am curious if anyone knows a good work-around.

Kind regards, Casper


2 Replies Last Post 2024年10月18日 GMT-4 05:47
Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 2 months ago 2024年10月8日 GMT-4 04:12
Updated: 2 months ago 2024年10月8日 GMT-4 06:20

Hi Casper

It is correct that the sensitivity study step only supports computation of a single sensitivity, but you can have several inner solutions with each their sensitivity, so you might get something close to what you want, if you

  1. make an inner sweep with a parameter that does not affect the forward solution

  2. use an iterative solver (so that the first forward computation can be somewhat recycled)

  3. make the objective depend on the sweep parameter

Oftentimes, it is significantly easier and faster to solve optimization problems using the built-in COMSOL functionality. Is there anything preventing you from using one of the optimization study steps?

Best regards,

Kristian E. Jensen

Technical Product Manager, Optimization

Hi Casper It is correct that the sensitivity study step only supports computation of a single sensitivity, but you can have several inner solutions with each their sensitivity, so you might get something close to what you want, if you 1. make an inner sweep with a parameter that does not affect the forward solution 2. use an iterative solver (so that the first forward computation can be somewhat recycled) 3. make the objective depend on the sweep parameter Oftentimes, it is significantly easier and faster to solve optimization problems using the built-in COMSOL functionality. Is there anything preventing you from using one of the optimization study steps? Best regards, Kristian E. Jensen Technical Product Manager, Optimization

Please login with a confirmed email address before reporting spam

Posted: 2 months ago 2024年10月18日 GMT-4 05:47

Hi Casper

It is correct that the sensitivity study step only supports computation of a single sensitivity, but you can have several inner solutions with each their sensitivity, so you might get something close to what you want, if you

  1. make an inner sweep with a parameter that does not affect the forward solution

  2. use an iterative solver (so that the first forward computation can be somewhat recycled)

  3. make the objective depend on the sweep parameter

Oftentimes, it is significantly easier and faster to solve optimization problems using the built-in COMSOL functionality. Is there anything preventing you from using one of the optimization study steps?

Best regards,

Kristian E. Jensen

Technical Product Manager, Optimization

Hi Kristian,

Thanks for the reply! I have tried the parametric sweep and function sweep, and also the iterative solver. One of the objectives, f1, consist of the first 6 eigenfrequencies, and the other objective, f2, is a simple volume integral of the control variable field. I swept some parameter k over a list containing 1's and 2's, and made the overall objective f = f1(k==1) + f2(k==2), so that it effectively switches between f1 and f2

I made sure that the solver saves solutions and reuses old ones, which does improve the efficiency somewhat for 'repeated' solves. However, it appears that every iteration of the sweep takes the same amount of time, even when I completely remove f1 (solid.freq) completely from the expression. Also, the iterative solvers for eigenfrequency (BigCGstab and GMRES) are significantly slower than the direct solver somehow.

As for the volume integral f2, it should not be dependent on the state-variable. I could define some dummy study that contains 'easy' physics, but still comsol does not allow a sensitivity analysis without physics.

Why not use the optimization module? Doing this would be ideal, and I have never noticed computational redundancy here (i.e. adding a volume integral and its sensitivity resulted in no extra computational time). Using the Matlab-LiveLink is partially just what some partners want (coupling it to their own software at some point), and continuation or control over certain parameters may be easier using external optimization. Most importantly however, I need modeshape-dependent objectives and sensitivities, which comsol does not yet support. The one solution to everything would be to just export matrices and solve externally, at a significant cost of implementation ease ):

Kind regards, Casper

>Hi Casper > >It is correct that the sensitivity study step only supports computation of a single sensitivity, but you can have several inner solutions with each their sensitivity, so you might get something close to what you want, if you > >1. make an inner sweep with a parameter that does not affect the forward solution > >2. use an iterative solver (so that the first forward computation can be somewhat recycled) > >3. make the objective depend on the sweep parameter > >Oftentimes, it is significantly easier and faster to solve optimization problems using the built-in COMSOL functionality. Is there anything preventing you from using one of the optimization study steps? > >Best regards, > >Kristian E. Jensen > >Technical Product Manager, Optimization Hi Kristian, Thanks for the reply! I have tried the parametric sweep and function sweep, and also the iterative solver. One of the objectives, f1, consist of the first 6 eigenfrequencies, and the other objective, f2, is a simple volume integral of the control variable field. I swept some parameter k over a list containing 1's and 2's, and made the overall objective f = f1*(k==1) + f2*(k==2), so that it effectively switches between f1 and f2 I made sure that the solver saves solutions and reuses old ones, which does improve the efficiency somewhat for 'repeated' solves. However, it appears that every iteration of the sweep takes the same amount of time, even when I completely remove f1 (solid.freq) completely from the expression. Also, the iterative solvers for eigenfrequency (BigCGstab and GMRES) are significantly slower than the direct solver somehow. As for the volume integral f2, it should not be dependent on the state-variable. I could define some dummy study that contains 'easy' physics, but still comsol does not allow a sensitivity analysis without physics. Why not use the optimization module? Doing this would be ideal, and I have never noticed computational redundancy here (i.e. adding a volume integral and its sensitivity resulted in no extra computational time). Using the Matlab-LiveLink is partially just what some partners want (coupling it to their own software at some point), and continuation or control over certain parameters may be easier using external optimization. Most importantly however, I need modeshape-dependent objectives and sensitivities, which comsol does not yet support. The one solution to everything would be to just export matrices and solve externally, at a significant cost of implementation ease ): Kind regards, Casper

Reply

Please read the discussion forum rules before posting.

Please log in to post a reply.

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.