Expression =1 every 2 Timesteps
Hello,
im looking for an expression that is 1 every 2 timesteps. I tried to build the expression with a sin function but somehow it does not work propably. (abs(sin(Time*1[rad/s])) =1) is there a easier way? 
Your way is close but you have the expression slightly wrong. And are you interested in every 2 "timesteps" or do you want this as a function of time?
For timesteps your variable needs to be ctstep not Time. Also, your sin function would need to be cos(ctstep*pi) in order to get it to "1" on every even step. But I would be afraid of roundoff error on this and wouldnt trust it to return true using a boolean to evaluate it, so I would switch to a step function. Perhaps: step(cos(ctstep*pi)0.9) 
mod(cstep,2) is simpler and not prone to round off.

Thank you :)

All times are GMT 4. The time now is 08:38. 