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.

Passing parameters to results

Please login with a confirmed email address before reporting spam

Hello everyone

I have simulated a device, and I would like to plot the retarded potential given by this expression

Is there a way to pass the parameters representing the time delay to the current density variable that I get from COMSOL results?


5 Replies Last Post May 11, 2023, 10:18 a.m. EDT
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 12 months ago May 8, 2023, 10:47 p.m. EDT
Updated: 12 months ago May 8, 2023, 10:46 p.m. EDT
  1. FYI for those who may not recognize it, this is the time-domain antenna question/problem of computing radiated fields from a given (or computed) current density distribution. So you are not the first person to be interested in this question. In principle, the Comsol at operator can be applied here. Look it up in the Comsol help system, under "operators" and perhaps also look at the related operators (e.g., withsol) that concern selecting/gathering local spatial field values from amongst field solutions stored at various times, since such operators may potentially be used with or instead. Beware that you may find your task challenging. After all, you have probably computed your current distribution at a discrete set of times. But your integral is over a continuum of time-shifted values. You will need to properly interpolate between discrete time solutions at any/all spatial points (also being interpolated, if you really think about it) in your volume of interest, without introducing too much noise, all while properly evaluating the spatial integral and... managing certain limitations regarding the operators' usage requirements, which I will leave you to discover for yourself. Anyway, if/when you succeed, please be kind enough to share here the details of what you learn and how well it worked!
  2. I also encourage knowledgeable Comsol staff who may read this post to offer their own professional suggestions in regard to the latest or most-recommended approach (presumably leveraging features in Comsol 6.1 and the RF module) to address this kind of problem, which in my opinion is (at least somewhat) of general interest within the subject of time-domain RF/antenna modeling. Thank you.
-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
1. FYI for those who may not recognize it, this is the time-domain antenna question/problem of computing radiated fields from a given (or computed) current density distribution. So you are not the first person to be interested in this question. *In principle*, the Comsol *at* operator can be applied here. Look it up in the Comsol help system, under "operators" and perhaps also look at the related operators (e.g., *withsol*) that concern selecting/gathering local spatial field values from amongst field solutions stored at various times, since such operators may potentially be used with or instead. Beware that you *may* find your task challenging. After all, you have probably computed your current distribution at a discrete set of times. But your integral is over a continuum of time-shifted values. You will need to properly interpolate between discrete time solutions at any/all spatial points (also being interpolated, if you really think about it) in your volume of interest, without introducing too much noise, all while properly evaluating the spatial integral and... managing certain limitations regarding the operators' usage requirements, which I will leave you to discover for yourself. Anyway, if/when you succeed, please be kind enough to share here the details of what you learn and how well it worked! 2. I also encourage knowledgeable Comsol staff who may read this post to offer their own professional suggestions in regard to the latest or most-recommended approach (presumably leveraging features in Comsol 6.1 and the RF module) to address this kind of problem, which in my opinion is (at least somewhat) of general interest within the subject of time-domain RF/antenna modeling. Thank you.

Magnus Olsson COMSOL Employee

Please login with a confirmed email address before reporting spam

Posted: 12 months ago May 9, 2023, 6:02 a.m. EDT

I do not have much to add to what Dr. Koslover wrote above. The at operator is used to access solution data at a specific time. You will for sure also need the dest operator as your integral involves the distance between your source (current distribution) at r' and your field point at r. You may also need to pay attention to your simulated current distribution and make sure the output is dense enough in time to keep down interpolation errors. Beware also that time derivatives output from a COMSOL simulation are interpolated if one uses Free for Steps taken by solver and can be rather inaccurate so if your current distribution depends on time derivatives of the dependent variable, make sure to switch that setting to Strict or set Times to store to Steps taken by solver. Depending on the number of field points for your retarded potential and the number of degrees of freedom on your source current distribution, the computation of the integral can be rather time consuming so I would start experimenting with rather few field points and a coarsely resolved current distribution and refine once you have got it working.

-------------------
Magnus
I do not have much to add to what Dr. Koslover wrote above. The *at* operator is used to access solution data at a specific time. You will for sure also need the *dest* operator as your integral involves the distance between your source (current distribution) at **r'** and your field point at **r**. You may also need to pay attention to your simulated current distribution and make sure the output is dense enough in time to keep down interpolation errors. Beware also that time derivatives output from a COMSOL simulation are interpolated if one uses *Free* for *Steps taken by solver* and can be rather inaccurate so if your current distribution depends on time derivatives of the dependent variable, make sure to switch that setting to *Strict* or set *Times to store* to *Steps taken by solver*. Depending on the number of field points for your retarded potential and the number of degrees of freedom on your source current distribution, the computation of the integral can be rather time consuming so I would start experimenting with rather few field points and a coarsely resolved current distribution and refine once you have got it working.

Please login with a confirmed email address before reporting spam

Posted: 12 months ago May 10, 2023, 12:45 p.m. EDT

Thanks a lot Dr. Koslover and Mr. Olssen for your insights. I will try to implement your suggestions and see what I get.

Thanks a lot Dr. Koslover and Mr. Olssen for your insights. I will try to implement your suggestions and see what I get.

Please login with a confirmed email address before reporting spam

Posted: 12 months ago May 11, 2023, 8:16 a.m. EDT
Updated: 12 months ago May 11, 2023, 10:05 a.m. EDT

I tried using the 'at' and 'withsol' operators in the expression of surface integration in the derived values section. But when I introduce any spatial coordinate in the delay expression I get the following errors:

  1. For 'at' : The solution specification is nonscalar or out of range.
  2. For 'withsol' : Parameter value is nonconstant.

These errors did not occur when I experemented with delays that are function of time only(like t or sin(t) ... for example).

I tried using the 'at' and 'withsol' operators in the expression of surface integration in the derived values section. But when I introduce any spatial coordinate in the delay expression I get the following errors: 1. For 'at' : The solution specification is nonscalar or out of range. 2. For 'withsol' : Parameter value is nonconstant. These errors did not occur when I experemented with delays that are function of time only(like t or sin(t) ... for example).

Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 12 months ago May 11, 2023, 10:18 a.m. EDT

I encourage you to post your .mph file to the forum to allow others to take a closer look.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
I encourage you to post your .mph file to the forum to allow others to take a closer look.

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.