Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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}]
- OriginalFn[t_] := 0.05 + 3.95 Piecewise[{{1/2 (1 - Cos[2 Pi Mod[t, 1]/0.3]), Mod[t, 1] < 0.3}}]
- ToBeAddedFn[t_, delay_, period_, amplitude_] := amplitude *
- Piecewise[{
- {1/2 (1 - Cos[2 Pi Mod[t - delay, 1]/period]), Mod[t - delay, 1] < period}
- }]
- Manipulate[
- Row[{
- Plot[{OriginalFn[t], ToBeAddedFn[t, delay, period, amplitude]}, {t, 0, 0.4}, PlotRange -> {0.0, 4}, ImageSize -> 300],
- Plot[1/2 (OriginalFn[t] + ToBeAddedFn[t, delay, period, amplitude]), {t, 0, 0.4}, PlotRange -> All, ImageSize -> 300]
- }],
- {{period, 0.2}, 0.015, 0.3},
- {{delay, 0.003}, 0, 0.3 - period},
- {{amplitude, 1.97}, 0, 8}]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement