Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Question on making a piecewise function periodic tia sal2

  • To: mathgroup at smc.vnet.net
  • Subject: [mg95274] Re: Question on making a piecewise function periodic tia sal2
  • From: dh <dh at metrohm.com>
  • Date: Wed, 14 Jan 2009 05:51:36 -0500 (EST)
  • References: <gkh0v8$6hk$1@smc.vnet.net>


Hi,

I do not understand fully what you want to do. But, to make a function 

periodic is a piece of cake. E.g. 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 periode: 1:

sin1= makeper[Sin,1]

you may plot the result: Plot[sin1[x],{x,0,3}]

Of course, when you make a function periodic with the wrong periode, you 

will get y discontinuity.

hope this helps, Daniel



ratulloch at gmail.com wrote:

> Question on making a piecewise function periodic tia sal2

> 

> Greetings All

> 

> I'm trying to make a piecewise function look periodic.

> example (shows the positive humps of the sin wave from 0 to 2Pi)

> Manipulate[test=choice[ Piecewise[{{Sin[a*t],t<Pi},{Sin[a*t-Pi]

> +C,t>Pi}}],{t,0,2 Pi}],{a,1,5},{C,0,2},{choice,{Plot,Expand}}]

> 

> This command will work if t is 0 to 2 Pi but the sin wave goes

> negative after that I think If I use the Mod command example:

> 

> Manipulate[test=choice[ Piecewise[{{Sin[a*t],t<Mod[Pi,4]},{Sin[a*t-Pi]

> +C,t>Mod[Pi,4]}}],{t,0,2 Pi}],{a,1,5},{C,0,2},{choice,{Plot,Expand}}]

> 

> It could work so it would never go negative but I'm not sure how to

> implement mod command so the sin wave won=92t go negative.  I'm also

> open to other suggestions.

> 

> The reason why I'm doing this is that when I do periodic interpolation

> the formula

> Breaks down due to the Gibbs Phenomenon.  The signals I'm creating

> have about 200 separate values that=92s why it breaks down.  But I'm

> using a simple example to see if it can be done.  So I can basically

> stitch multiple simple wave signals together to create one big complex

> one and still have the ability to make the complex signal periodic

> over time.

> 

> Tia sal2

> 




  • Prev by Date: Re: File Corrupted
  • Next by Date: Re: Moving $UserBaseDirectory makes all paclets do not working
  • Previous by thread: Re: Solving nonlinear coupled differential equations in Mathematica
  • Next by thread: Re: Moving $UserBaseDirectory makes all paclets do not working