Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #2812
| From | Heike Gramberg <heike.gramberg@gmail.com> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Can't make function periodic for t<0 |
| Date | 2011-05-30 11:47 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <is0056$9o5$1@smc.vnet.net> (permalink) |
You can provide an offset for Mod. For example, Mod[a,L,b] will return values between b
and L+b. In your example, you could redefine mekeper according to
makeper[f_,L_,offset_] := f[Mod[#,L,offset]]&
then
x1=makeper[x,1,-1/2]
would be the periodic function you're looking for.
Heike.
On 30 May 2011, at 11:35, yitzhakbg wrote:
> This is the function to make periodic:
> x[t_] := Piecewise[{{-1, -1/2 <= t < 0}, {1, 0 <= t < 1/2}}]
>
> I saw DH's lovely post from 1/14/09:
> "if we want some function f to have period L we may define an operator:
> makeper[f_,L_]= f[Mod[#,L]]&
> Here is an example. We want a sine with period 1:
> sin1= makeper[Sin,1]"
> I can't get it to work for t<0 because Mod always returns positive values.
> Can anyone kindly help?
> Yitzhak
>
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
Re: Can't make function periodic for t<0 Heike Gramberg <heike.gramberg@gmail.com> - 2011-05-30 11:47 +0000
csiph-web