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.

Square wave or rectangle function input voltage

Please login with a confirmed email address before reporting spam

Hello fellow COMSOLers,

I am trying to model an electrical pulse going through a metal trace (similar to the classic beginner's tutorial showing Joule heating of an aluminum film on a silicon substrate). The pulse will be a repeating rectangle function -- the voltage will be turned on and off repeatedly to create fatigue stress in the trace.

I am currently using version 4.0, but also have a license for 3.4. In 4.0, I found that you can define rectangle functions by right clicking on "Global Definitions". (This was described in the 4.0 introductory workshop). However, I'm not sure how to actually use the function once I've defined it.

Does anyone know of a way that I could do this, in either 4.0 or an earlier version? I also have MATLAB, and would be interested in learning how to script this if there's no way to do it through the COMSOL GUI.

Thanks!
-Anna

1 Reply Last Post 2010/06/25 9:37 GMT-4
Ivar KJELBERG COMSOL Multiphysics(r) fan, retired, former "Senior Expert" at CSEM SA (CH)

Please login with a confirmed email address before reporting spam

Posted: 1 decade ago 2010/06/25 9:37 GMT-4
Hi

the easiest is to define the "rectangle" pulse in V4 as this implements the Heaviside functions to smoothen the turn on and off (plot the figure (click on the icon) to check the shape and the order of varibles, and check the doc for the variables and operators p 170 MPH_UG.PDF) Its easier than in the earler versions. The turn on and off time is by default 0.1, see the "smooting tab". then you call it with simply "rect1(t-Dt)" where Dt is the time to the middle of the pulse. To make it periodical use a modulo call on t "mod(t-Dt,DDt)" see p179 where DDt is the full period

As the function modulates from 0 to 1 without units you must multiply it by some amplitude depending where you use it

have fun Comsoling
Ivar
Hi the easiest is to define the "rectangle" pulse in V4 as this implements the Heaviside functions to smoothen the turn on and off (plot the figure (click on the icon) to check the shape and the order of varibles, and check the doc for the variables and operators p 170 MPH_UG.PDF) Its easier than in the earler versions. The turn on and off time is by default 0.1, see the "smooting tab". then you call it with simply "rect1(t-Dt)" where Dt is the time to the middle of the pulse. To make it periodical use a modulo call on t "mod(t-Dt,DDt)" see p179 where DDt is the full period As the function modulates from 0 to 1 without units you must multiply it by some amplitude depending where you use it have fun Comsoling Ivar

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.