Note: This discussion is about an older version of the COMSOL Multiphysics® software. The information provided may be out of date.

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.

Changing variable during a frequency sweep

Please login with a confirmed email address before reporting spam

Is it possible to change a variable during a frequency sweep? If so, how?

I have a simple acoustics model with a single power point source in a free field (from PMLs).

I would like to vary the input (Pref) that is designated in the point source menu from frequency to frequency to match test data that I have acquired.

Currently I am stuck changing it by hand for each frequency and manually running each one. If there's some way to automate this it would save my time greatly.

Best Regards,

Hubert Seth Hall

2 Replies Last Post Jun 6, 2014, 11:23 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 6, 2014, 9:46 a.m. EDT
Hi Hubert,

Make sure that you have a function for Pref that is a function of f. I presume that the function you have is actually a table with different values of Pref for different values of f. In the (global) definitions node you can add an interpolation function node, where you can enter your table or load in from file. You can than us that function in your expression for Pref as functionName(f), assuming that f is the variable that represents the frequency in the sweep. Is that what you are looking for?
Hi Hubert, Make sure that you have a function for Pref that is a function of f. I presume that the function you have is actually a table with different values of Pref for different values of f. In the (global) definitions node you can add an interpolation function node, where you can enter your table or load in from file. You can than us that function in your expression for Pref as functionName(f), assuming that f is the variable that represents the frequency in the sweep. Is that what you are looking for?

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago Jun 6, 2014, 11:23 a.m. EDT
Thanks Pieter!

That works great for my issue!
Thanks Pieter! That works great for my issue!

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.