I would like to be able to add a raised cosine to a "standard" raised cosine. With a time delay which I could manipulate (so the shape of the standard cosine function is altered, meaning the function becomes like the image below or a reversed example of this. (But above y=0)
). I do however have one limitation and that is that after a period of 0.3 seconds it should be just a baseline.
The standard cosine is:0.05 + Piecewise[{{3.95 (1 - Cos[2 Pi Mod[t, 1]/0.3])/2, Mod[t, 1] < 0.3}}]
I've tried a Module but seem to get stuck
Manipulatedelastance[t0_, t1_, tdelay_, period_] := Module[{}, Originalfunc = 0.05 + Piecewise[{{3.95 (1 - Cos[2 Pi Mod[t, 1]/0.3])/2, Mod[t, 1] < 0.3}}]; ToBeAddedfunction = 3.95 (1 - Cos[2 Pi Mod[t - tdelay, 1]/period])/2; Combinedfunction = 0.05 + Piecewise[{{(((3.95)*(1 - Cos[2 Pi Mod[t, 1]/period])/2) + EVLtr2)/2, Mod[t, 1] < 0.3}}]; EATtr = 0.17 + Piecewise[{{0.73 (1 - Cos[2 Pi Mod[t - 0.9, 1]/0.1])/2, Mod[t, 1] > 0.9}}]; EPATtr = 0.2 + Piecewise[{{0.5 (1 - Cos[2 Pi Mod[t - 0.9, 1]/0.1])/2, Mod[t, 1] > 0.9}}]; EPVLtr = 0.08 + Piecewise[{{3.95/5 (1 - Cos[(2 Pi Mod[t, 1]/0.3)])/2, Mod[t, 1] < 0.3}}]; {Plot[Originalfunc, {t, t0, t1}], Plot[{Originalfunc, ToBeAddedfunction, Combinedfunction}, {t, t0, t1}, PlotRange -> All, PlotLegends -> {"Originalfunc", "ToBeAddedfunction", "Combinedfunction"}], Plot[{Originalfunc, EATtr, EPATtr, EPVLtr, Combinedfunction}, {t, t0, t1}, PlotRange -> All, PlotLegends -> {"EVL", "EAT", "EPAT", "EPVL", "Enew"}]}] Manipulate[ Manipulatedelastance[t0, t1, tdelay, period], {{t0, 0}, 0, 30}, {{t1, 2}, 0, 20}, {{tdelay, 0.7}, 0, 1}, {{period, 0.3}, 0, 1}] I know this is probably not the best explanation of all but I would really appreciated if somebody could help.
Thank you very much in advance!
