Effacer les filtres
Effacer les filtres

Make this equation periodic (repeating every t_c seconds)

2 vues (au cours des 30 derniers jours)
Hussam
Hussam le 27 Mar 2024
Commenté : Torsten le 28 Mar 2024
Hi, how can I make the following equation periodic to repeat every t_c seconds, given that t_c > t_s. So for t_s<t<t_c the value of Q is zero.
Q=@(t)Q_peak*sin((pi*t)./t_s).^2.*(t<=t_s)
Thanks!
  2 commentaires
Torsten
Torsten le 27 Mar 2024
What is the interval you want to repeat periodically ? [0 t_s] ?
Hussam
Hussam le 28 Mar 2024
That is the equation from [0 t_s], otherwise it is 0. I want this to be periodically repeated every t_c

Connectez-vous pour commenter.

Réponse acceptée

Torsten
Torsten le 27 Mar 2024
Modifié(e) : Torsten le 28 Mar 2024
Maybe like this:
Q_peak = 1;
t_s = 0.1;
t_c = 0.3;
fun = @(t)Q_peak*sin((pi*t)./t_s).^2.*(t>=0).*(t<=t_s);
F = @(t)fun(mod(t,t_c));
t = linspace( -0.6,0.6,2000);
plot(t,F(t))
  2 commentaires
Hussam
Hussam le 28 Mar 2024
Not exactly, I would like the function to include zero for some interval and then repeat, i.e. the sine curve for [0 t_s], zero for [t_s t_c], and repeat every t_c.
Torsten
Torsten le 28 Mar 2024
Done.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by