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.

In Order To Calculate The Sensitivity Matrix Of A PDE By Adjoint Method, The System Equations Need To Be Solved Many Times

Please login with a confirmed email address before reporting spam

Dear all,

Recently, I established an optimized simulation model based on the Aquifer Characterization case (http://cn.comsol.com/model/aquifer-characterization-4410). The optimization method is Levenberg-Marquardt. The supposed measurement values and predictive values are fitted by the Optimization Module -> Least-Squares Objective. When the number of supposed measurement points increases, the optimization calculation becomes slower. We noticed "The adjoint method solves for the derivatives of a single scalar objective function, requiring only one single additional linear system solution." in the Optimization Module User’s Guide. Does this mean that for each additional supposed measurement point in the Optimization Module -> Least-Squares Objective, an additional solving the system equation will be required? Can the Adjoint Method in the Optimization Module calculate the sensitivity matrix by solving the system equation only once, in other words, how can I calculate the derivative of the supposed measurement value vector (supposed measurement values at multiple points) to the control variable vector (all control variables) by solving the system equation only once?

Thanks in advance for the help


2 Replies Last Post Oct 29, 2020, 4:07 a.m. EDT
Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 15, 2020, 4:40 a.m. EDT
Updated: 3 years ago Oct 15, 2020, 5:24 a.m. EDT

Dear Gao Lei

Are you sure that the increase in computational time is not due to finer meshes or more values of a sweep parameter (th)?

Best regards,
Kristian E. Jensen
Technical Product Manager, Optimization

Dear Gao Lei Are you sure that the increase in computational time is not due to finer meshes or more values of a sweep parameter (th)? Best regards, Kristian E. Jensen Technical Product Manager, Optimization

Please login with a confirmed email address before reporting spam

Posted: 3 years ago Oct 29, 2020, 4:07 a.m. EDT

Dear Kristian E. Jensen

Thanks for your reply. In our tests, we find that the finer meshes does increase the calculation time, but increasing the supposed observation stations in the inversion will also slow down the calculation. In the aquifer inversion optimization model, we use the same mesh and then designed three cases with different number of supposed observation stations:
(1) 6 supposed observation stations, (2) 24 supposed observation stations, (3) 72 supposed observation stations.

For the first case (6 observation stations), the time required for each iteration is about 0.7167 seconds. For the second case (24 observation stations), the time required for each iteration is about 4.5806 seconds. For the third case (72 observation stations), the time required for each iteration is about 12.4079 seconds. Combining calculation logs for analysis, we believe that the computation is mainly consumed by solving the sensitivity matrix. For the above three cases, the number of sensitivity matrix solving times are 6, 24, and 72 respectively. However, the use of adjoint method to solve the sensitivity matrix "multiple times" only appears in Levenberg-Marquardt method. When we use the SNOPT method, this "multiple times solving" does not exist, in other words, no matter how the number of supposed observation stations changes, solving the sensitivity matrix only requires "one single additional linear system solution." Therefore for the above three cases, the time required for each iteration is approximately the same with using SNOPT optimization solver.

Our problem is the least squares optimization problem. The documentation demonstrates that” Since the Levenberg-Marquardt method is derived to solve problems of least squares type, it typically converges faster than SNOPT for such problems.” Our example model also verified this point. So, we’d like to use the Levenberg-Marquardt method to gain better convergence effects and acquire higher computational efficiency like that in "one time solving linear systems obtaining the sensitivity matrix" of the SNOPT method.

Best regards, Gao Lei

Dear Kristian E. Jensen Thanks for your reply. In our tests, we find that the finer meshes does increase the calculation time, but increasing the supposed observation stations in the inversion will also slow down the calculation. In the aquifer inversion optimization model, we use the same mesh and then designed three cases with different number of supposed observation stations: (1) 6 supposed observation stations, (2) 24 supposed observation stations, (3) 72 supposed observation stations. For the first case (6 observation stations), the time required for each iteration is about 0.7167 seconds. For the second case (24 observation stations), the time required for each iteration is about 4.5806 seconds. For the third case (72 observation stations), the time required for each iteration is about 12.4079 seconds. Combining calculation logs for analysis, we believe that the computation is mainly consumed by solving the sensitivity matrix. For the above three cases, the number of sensitivity matrix solving times are 6, 24, and 72 respectively. However, the use of adjoint method to solve the sensitivity matrix "multiple times" only appears in Levenberg-Marquardt method. When we use the SNOPT method, this "multiple times solving" does not exist, in other words, no matter how the number of supposed observation stations changes, solving the sensitivity matrix only requires "*one single additional linear system solution.*" Therefore for the above three cases, the time required for each iteration is approximately the same with using SNOPT optimization solver. Our problem is the least squares optimization problem. The documentation demonstrates that” *Since the Levenberg-Marquardt method is derived to solve problems of least squares type, it typically converges faster than SNOPT for such problems.*” Our example model also verified this point. So, we’d like to use the Levenberg-Marquardt method to gain better convergence effects and acquire higher computational efficiency like that in "one time solving linear systems obtaining the sensitivity matrix" of the SNOPT method. Best regards, Gao Lei

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.