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.

Making a periodic step function

Please login with a confirmed email address before reporting spam

Hi I know this question is already asked, but it seems there is a problem the way I am doing this. I appreciate any help, thanks. I want to simulate a second of pulsed laser with frequency of 10000. So in each second, there are 10000 of laser pulses. I have defined a "rectangle function" and made a step function with lower limit of 0 and upper limit of 15 ns which is the pulse duration. Afterward, I created an "Analytic function" and I defined the function as "rectanlge1(mod(t,1/10000))". I plot this function and the plot is not anything close to what it should be. it is not periodic at all, it is not repeating as it should be. I also enabled the periodic button, still nothing solved the problem.

Thank you


2 Replies Last Post Dec 27, 2023, 6:15 a.m. EST
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 11 months ago Dec 22, 2023, 11:35 p.m. EST
Updated: 11 months ago Dec 22, 2023, 11:38 p.m. EST

Go to Component --> definitions --> functions --> waveform. For type, choose Square. Set your period and duty cycle appropriately, and you are basically done (except for a vertical offset). You might want to set a smaller smoothing transition zone than the default.

-------------------
Scientific Applications & Research Associates (SARA) Inc.
www.comsol.com/partners-consultants/certified-consultants/sara
Go to Component --> definitions --> functions --> waveform. For type, choose Square. Set your period and duty cycle appropriately, and you are basically done (except for a vertical offset). You might want to set a smaller smoothing transition zone than the default.

Please login with a confirmed email address before reporting spam

Posted: 11 months ago Dec 27, 2023, 6:15 a.m. EST

Go to Component --> definitions --> functions --> waveform. For type, choose Square. Set your period and duty cycle appropriately, and you are basically done (except for a vertical offset). You might want to set a smaller smoothing transition zone than the default.

Thank you very much Robert This way setting up an periodic function is much easier and makes sense.

>Go to Component --> definitions --> functions --> waveform. >For type, choose Square. Set your period and duty cycle appropriately, and you are basically done (except for a vertical offset). You might want to set a smaller smoothing transition zone than the default. Thank you very much Robert This way setting up an periodic function is much easier and makes sense.

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.