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.

Express objective function in Optimization study of Frequency domain in Acoustics module

Please login with a confirmed email address before reporting spam

Hi,

I want to run an optimization study in frequency domain. I have experimental values of the variable alpha for specific frequencies and I want to adjust my control variable R in order to match these results. If my experimental results are for frequencies 20, 30, 40 kHz ... then the objective functions to be minimised are:

abs(alpha(20kHz) - expermentvalue1)
abs(alpha(30kHz)- experimentvalue2)
abs(alpha(40kHz)- experimentvalue3)
....

My question is: How do I express in Comsol "alpha(20 kHz)"? Is there an operator to do so?

Thanks

4 Replies Last Post 16 mai 2016, 07:46 UTC−4

Please login with a confirmed email address before reporting spam

Posted: 10 years ago 25 févr. 2015, 16:20 UTC−5
Than:

I am wanting to do something similar in the EM physics. I would like to import experimental values of S21 parameter vs frequency and attempt to match the s parmeter solved for within my model with these values by varying a material property. So far I have had limited success by doing the following:

1) load my experimental values of txt format via interpolation, these value have frequency in the 1st column and S21 in the 2nd column
- within interpolation window:
- function name is S21Exp

2) add an optimization study node
- within this node:
- Nelder-Mead method
- expression (emw.S21dB-S21Exp(freq))^2
- enter your variable you want to vary under control variables

3) add a frequency domain study node
- within this node:
- enter frequency start, step, stop same as in my experimental file


The part I am having trouble with is that the optimization only finds the minimum value of the variable I am varying for the combined frequencies. However, like you I would like it to find the optimized value for each individual frequency and use that value for modeling.

Regards,
Brad
Than: I am wanting to do something similar in the EM physics. I would like to import experimental values of S21 parameter vs frequency and attempt to match the s parmeter solved for within my model with these values by varying a material property. So far I have had limited success by doing the following: 1) load my experimental values of txt format via interpolation, these value have frequency in the 1st column and S21 in the 2nd column - within interpolation window: - function name is S21Exp 2) add an optimization study node - within this node: - Nelder-Mead method - expression (emw.S21dB-S21Exp(freq))^2 - enter your variable you want to vary under control variables 3) add a frequency domain study node - within this node: - enter frequency start, step, stop same as in my experimental file The part I am having trouble with is that the optimization only finds the minimum value of the variable I am varying for the combined frequencies. However, like you I would like it to find the optimized value for each individual frequency and use that value for modeling. Regards, Brad

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 28 avr. 2016, 07:08 UTC−4
I have read you post on the forum about the optimization study. I have to do the some, but I have trouble with that. Did you solve this problem?
I have read you post on the forum about the optimization study. I have to do the some, but I have trouble with that. Did you solve this problem?

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 6 mai 2016, 21:37 UTC−4
I ended up using livelink with matlab. There are two approaches, create a loop in matlab so that it calls comsol to simulate and optimize at one frequency then store the result at each frequency within matlab. The other way is to call comsol but to use an optimization function built in matlab again looping and storing in matlab.
I ended up using livelink with matlab. There are two approaches, create a loop in matlab so that it calls comsol to simulate and optimize at one frequency then store the result at each frequency within matlab. The other way is to call comsol but to use an optimization function built in matlab again looping and storing in matlab.

Mads Herring Jensen COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 9 years ago 16 mai 2016, 07:46 UTC−4
Hi all

Maybe you can find some inspiration in this model from our application gallery:

www.comsol.com/model/shape-optimization-of-a-tweeter-waveguide-24691

The gallery is a great resource for model examples.

Best regards
Mads
Hi all Maybe you can find some inspiration in this model from our application gallery: https://www.comsol.com/model/shape-optimization-of-a-tweeter-waveguide-24691 The gallery is a great resource for model examples. Best regards Mads

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.