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 2023年12月27日 GMT-5 06:15
Robert Koslover Certified Consultant

Please login with a confirmed email address before reporting spam

Posted: 4 months ago 2023年12月22日 GMT-5 23:35
Updated: 4 months ago 2023年12月22日 GMT-5 23:38

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: 4 months ago 2023年12月27日 GMT-5 06:15

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.

Reply

Please read the discussion forum rules before posting.

Please log in to 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 the Support Center for a more comprehensive response from the Technical Support team.