Normalizing time in COMSOL

Please login with a confirmed email address before reporting spam

Hi everybody, I have a probem in data elaboration. I use a time dependent solver and often run simulations that result in having different virtual times. For instance, I can run a parametric sweep changing some parameters and as an outcome, the virtual simulation time can change even in orders of magnitude.

I would like to understand how can I normalize my simulations with time by plotting t/t_max. If I use a nonlocal coupling on time itself, it will result in a vertical line at x=1.

I use both 6.2 and 6.4 versions. Thanks in advance.


6 Replies Last Post 2026年11月13日 GMT+8 12:33
Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 2 days ago 2026年11月12日 GMT+8 03:58

If you want to plot diagrams you can use the t/t_max expression for the x-axis. If you want use the normalized time in a more general approach it may get more complex. You might consider a model method for that.

Cheers Edgar

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
If you want to plot diagrams you can use the t/t_max expression for the x-axis. If you want use the normalized time in a more general approach it may get more complex. You might consider a model method for that. Cheers Edgar

Please login with a confirmed email address before reporting spam

Posted: 2 days ago 2026年11月12日 GMT+8 06:10

Thank you for your reply.

I was, indeed, trying to normalize each of my curves using exactly the maximum value of time for each of my curves. However, t_max isn't a native COMSOL variable. It's fine for me using a postprocessed value. Should I define a custom variable? If so, how? Simply using a nonlocal coupling in the definition node and defining t_max = maxop1(t) to then use an expression like t/t_max gives back the straight line x=1.

Thank you for your reply. I was, indeed, trying to normalize each of my curves using exactly the maximum value of time for each of my curves. However, t_max isn't a native COMSOL variable. It's fine for me using a postprocessed value. Should I define a custom variable? If so, how? Simply using a nonlocal coupling in the definition node and defining t_max = maxop1(t) to then use an expression like t/t_max gives back the straight line x=1.

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 1 day ago 2026年11月12日 GMT+8 19:34
Updated: 1 day ago 2026年11月12日 GMT+8 19:35

Simply define a parameter t_max. You can then use it in the settings for the time stepping and in post processing. Nonlocal couplings are not for this context.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Simply define a parameter t_max. You can then use it in the settings for the time stepping and in post processing. Nonlocal couplings are not for this context.

Please login with a confirmed email address before reporting spam

Posted: 1 day ago 2026年11月12日 GMT+8 20:57

Thanks for your reply. However, this wouldn't work as my graphs have different maxima and a parameter wants to be defined as a number of as a function of other parameters. Could you be more specific? Thanks in advance.

Thanks for your reply. However, this wouldn't work as my graphs have different maxima and a parameter wants to be defined as a number of as a function of other parameters. Could you be more specific? Thanks in advance.

Edgar J. Kaiser Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 23 hours ago 2026年11月13日 GMT+8 00:26

Sorry, I don't have any more suggestion.

-------------------
Edgar J. Kaiser
emPhys Physical Technology
www.emphys.com
Sorry, I don't have any more suggestion.

Robert Koslover RF/Antennas

Please login with a confirmed email address before reporting spam

Posted: 11 hours ago 2026年11月13日 GMT+8 12:33

Are you simply trying to access the last value of the time t (for a time-domain model) for a particular simulation solution? If so, you may find thewithsoloperator useful.

Per Google's AI (more or less quoting the Comsol documentation, I think): "To access the time value of the last time point of a simulation in COMSOL Multiphysics, you use the withsol() operator combined with setind()"

In particular, consider using:withsol('sol1', t, setind(t, 'last')). That should tell you the final time value of the sol1 solution.

-------------------
Robert A. Koslover
Are you simply trying to access the last value of the time t (for a time-domain model) for a particular simulation solution? If so, you may find the **withsol** operator useful. Per Google's AI (more or less quoting the Comsol documentation, I think): "To access the time value of the last time point of a simulation in COMSOL Multiphysics, you use the withsol() operator combined with setind()" In particular, consider using: **withsol('sol1', t, setind(t, 'last'))** . That should tell you the final time value of the sol1 solution.

Reply

Please read thediscussion forum rulesbefore posting.

Pleaselog into post a reply.

Note that while COMSOL employees may participate in the discussion forum, COMSOL®software users who are on-subscription should submit their questions via theSupport Centerfor a more comprehensive response from the Technical Support team.

Baidu
map