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.

Reusing derived expressions

Please login with a confirmed email address before reporting spam

Hi, Is it possible to reuse the output of derived values in the expression of other derived values, to make the calculation more efficient?

I have a model with magnetic fields, in which I excite different current patterns one-by-one in an auxiliary sweep (using 0/1 flags as multipliers). Let 'i' index the different cases. In order to calculate the self and mutual inductances between these current patterns, I have to evaluate the 3D integrals of the expressions H_iB_i and (H_i+H_j)(B_i+B_j), and use them in further expressions. B_i is obtained by taking the 'i'th parametric case using the 'with' operator: with(i,mf.Bx), with(i,mf.By)... etc. Since these integrals are explicitely written out in the expressions of each of the inductivities, they are (re)evaluated in each case, making the calculation extremely slow.

I thought that if one introduces 'variables', these are evaluated after (or during?) the simulation, and they are then not re-evaluated when using them in derived expressions. Is this true at all?

If it is true, it could be a solution. The 3D integral of HB could be defined as a variable: HBintegral=intop_3D(mf.Hxmf.Bx+mf.Hymf.By+mf.Hzmf.Bz), and one could use it as with(i,HBintegral). However, when taking the cross-terms (i,j) I can not do this.

So my question is, is it possible to do it in a smart way? Can I define derived values for the H*B integrals, including all cross terms as well, evaluate them, and then use these values in the further evaluation of the inductivities?

Thanks daniel


0 Replies Last Post 2020年3月30日 GMT-4 05:35
COMSOL Moderator

Hello Daniel Barna

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.

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.