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.

How to get second and third eigenfrequancy values from Eigenfrequency study for optimization?

Михаил Кособоков

Please login with a confirmed email address before reporting spam

How to get second and third eigenfrequency values from Eigenfrequency study for for use in objective function. "freq" - is the first frequency, but what is the names of the ather calculated values?


3 Replies Last Post Jul 19, 2023, 5:27 a.m. EDT
Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 months ago Jul 18, 2023, 2:44 a.m. EDT

Hi

freq is the frequency of the solution. There is no variable for the number of the frequency, but if you know the frequency is between 1 and 2 Hz, you can write

if(abs(freq-1.5[Hz])<0.5[Hz],freq,0) as the objective. Then the objective for the other frequencies will be set to zero.

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

Hi freq is the frequency of the solution. There is no variable for the number of the frequency, but if you know the frequency is between 1 and 2 Hz, you can write if(abs(freq-1.5[Hz])

Михаил Кособоков

Please login with a confirmed email address before reporting spam

Posted: 9 months ago Jul 19, 2023, 4:45 a.m. EDT
Updated: 9 months ago Jul 19, 2023, 4:49 a.m. EDT

Thenk you for idea!

But I found an option using functions "withsol" and "setind" from here:

https://www.comsol.com/forum/thread/129793/could-i-use-a-comsol-eigenfrequency-mode-result-as-initial-value-of-a-time-depen

withsol('sol123',freq,setind(lambda,N))

where N - 1, 2, 3 .... is the mode number. I'm not shure that it is correct, but the objective function works correctly and I get the correct fitting parameters.

Despite this, the COMSOL highlights the expression of the objective function in orange and writes a comment: "Unknow variable root.lambda".

Thenk you for idea! But I found an option using functions "withsol" and "setind" from here: https://www.comsol.com/forum/thread/129793/could-i-use-a-comsol-eigenfrequency-mode-result-as-initial-value-of-a-time-depen withsol('sol123',freq,setind(lambda,N)) where N - 1, 2, 3 .... is the mode number. I'm not shure that it is correct, but the objective function works correctly and I get the correct fitting parameters. Despite this, the COMSOL highlights the expression of the objective function in orange and writes a comment: "Unknow variable root.lambda".

Kristian Ejlebjærg Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 months ago Jul 19, 2023, 5:27 a.m. EDT

Hi

That is probably correct. You can disregard the objective warning for special parameters like "lambda". I thought you wanted to perform gradient based optimization where the withsol() operator would give a wrong gradient, but it should work fine for gradient free optimization.

Best regards,

Kristian E. Jensen Technical Product Manager,

Optimization

Hi That is probably correct. You can disregard the objective warning for special parameters like "lambda". I thought you wanted to perform gradient based optimization where the withsol() operator would give a wrong gradient, but it should work fine for gradient free optimization. Best regards, Kristian E. Jensen Technical Product Manager, Optimization

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.