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.

If Statement

Please login with a confirmed email address before reporting spam

Hello,

I am trying to use an if statement or something similar to apply forces at different times, but I am not sure how to do so. My goal is to compress a figure for a certain amount of time, and then when the time period passes, I want a new force to apply tension and stretch the figure. Is this possible to do within comsol? The figure is currently in structural mechanics and time dependent, but those can be adjusted if needed.

Thanks in advance

2 Replies Last Post Apr 16, 2015, 10:56 a.m. EDT

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Apr 16, 2015, 10:14 a.m. EDT
Hello Cory,

If I am not mistaken the "If" statement exists under the "Geometry" branch of the model tree. If you are trying to change your geometry with respect to simulation variable "t", then I would suggest you to use a boundary condition like "Prescribed Displacement".

For the boundary condition to change with respect to time, you can use logical operators; like:
-1[mm]*(t<10)+1[mm]*(t>=10)

Please check the syntax as I am typing it from my memory, secondly, please do not use it as an example since the Time Solver will blame itself in the third person, claiming a discontinuity is bothering the solution process. But, the outline of using logical operators under boundary conditions should be evident.

Hope it helps,
Onur
Hello Cory, If I am not mistaken the "If" statement exists under the "Geometry" branch of the model tree. If you are trying to change your geometry with respect to simulation variable "t", then I would suggest you to use a boundary condition like "Prescribed Displacement". For the boundary condition to change with respect to time, you can use logical operators; like: -1[mm]*(t=10) Please check the syntax as I am typing it from my memory, secondly, please do not use it as an example since the Time Solver will blame itself in the third person, claiming a discontinuity is bothering the solution process. But, the outline of using logical operators under boundary conditions should be evident. Hope it helps, Onur

Please login with a confirmed email address before reporting spam

Posted: 10 years ago Apr 16, 2015, 10:56 a.m. EDT
I will try and see if that works.

Thank You
I will try and see if that works. Thank You

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.