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.
with() operator very inefficient for average and std degression
Posted 06.01.2022, 14:14 GMT-5 Acoustics & Vibrations, Parameters, Variables, & Functions, Results & Visualization Version 5.6 0 Replies
Please login with a confirmed email address before reporting spam
Hello,
when I do a frequency analysis I solve for several frequencies and sometimes would like to calculate an average or std. degression than I use for example:
Lp = acpr.Lp
Lp_avg_area = avoep1(Lp) (avoep1 = Average Operator (Non Local Couplings))
Lp_std_deg_area = sqrt(avoep1((Lp-Lp_avg_area)^2))
Lp_avg_total = sum(with(ka,Lp_avg_area/nf),ka,1,nf)
Lp_std_deg_total = sqrt(sum(with((ka,Lp_avg_area-Lp_avg_total)^2/nf),ka,1,nf))
This can actually be quiet computationally costly because for Lp_std_deg_total the functions Lp_avg_area and Lp_avg_total will be called for every step these will call other functions and so on. I couldn't find a more elegant solution so far do you have any ideas?
Kind regards,
Finn
Hello Finn Bosholm
Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.
If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.