Hi,
I am trying to add shifted signals of type sin(ω(σt)) in [σ,σ] and 0 elsewhere. I call this function Umin(t). I am using SetCustomExcite. The issue is that these pulses *are shifted* in time. For example, I would like to perform a simulation where I consider say Umin(tσ) + Umin(t+3σ) (two isolated pulses). To define Umin(t+3σ), I tried to use the following string 'if(2σ<t<4σ,sin(ω(σt3σ),0)' where ω, σ are hardcoded (no conversion from variable to string). I noticed that I got a similar behaviour to 'if(t<4σ,sin(ω(σt3σ),0)' and thus the first inequality is not met. However, I get no syntax error. If I try (t>2σ)&(t<4σ) (the AND boolean function ), I get a syntax error without telling me what is wrong.
Am I missing something?
Thank you for the help.
How to use SetCustomExcite for a shifted signal?
Moderator: thorsten
Re: How to use SetCustomExcite for a shifted signal?
Actually, the solution is pretty simple:
do '(if (abs(t5σ)<σ),1,0)' for a rectangular pulse in [4σ,6σ]. This σ needs to be hard coded to a numerical value or use the unfriendly function num2string(). As a proof of concept, please find the code that generates 2 well separated rectangular pulses.
do '(if (abs(t5σ)<σ),1,0)' for a rectangular pulse in [4σ,6σ]. This σ needs to be hard coded to a numerical value or use the unfriendly function num2string(). As a proof of concept, please find the code that generates 2 well separated rectangular pulses.
 Attachments

 dipv5_4long2rect.m
 Code example
 (5.54 KiB) Downloaded 78 times