1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

I Amplitude decaying sine function

  1. Nov 26, 2017 #1
    Hello,

    I am numerically plotting a sine function sin(x) with amplitude 1 from x=0 to x=15. No problem with that.

    The next step gives me problems: I would like the sine function amplitude to decay exponentially starting at x=5 and not before that (the amplitude remains 1). I think I need to multiply the sine function by exp[-(x-5)] to have the amplitude decay starting from x=5. But that alone causes problems with the values less than 5...How should I deal with it?

    thanks!
    fog37
     
  2. jcsd
  3. Nov 26, 2017 #2

    mfb

    User Avatar
    2016 Award

    Staff: Mentor

    min(1,exp(5-x))?
     
  4. Nov 26, 2017 #3

    BvU

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Hi,
    At t=5 you want something mathematically and physically rather drastic to happen. That calls for drastic measures such as IF-statements (or functions derived from those, such as the step function).
    Is there a particular language you do this in or is yours more a matehmatics question ?
     
  5. Nov 26, 2017 #4
    I can use matlab. I just would like the amplitude of the sine way to start decaying at x=5 and remain the same unity value between x=0 and x=4... The decay can be smooth but should start at x=5.

    The sole multiplication of sin(x) by the function exp(-0.3*(x-5)) exponentially amplifies the sine function to values larger than 1 in the range x=0 and x=4.
     
  6. Nov 26, 2017 #5
    Thanks mfb but I don't follow your suggestion: what is min(1,exp (5-x)) supposed to do?
     
  7. Nov 26, 2017 #6
    By the way, mfb suggestion works fine:

    min(1, exp(5-x)) * sin (x)

    Makes the sinusoidal function decay start only at x=5 and not earlier than that. I am still not sure what the command min(1, exp(5-x)) does....
     
  8. Nov 26, 2017 #7
    I get it now. that was clever.

    We create a row vector with two elements, i.e. (1, exp(5-x)). The sine amplitude is given by the function min( (1, exp(5-x))) which outputs either the number 1 for x values between 0 and 5, and a value smaller than 1 and equal to exp(5-x) for x>5. Problem solved.

    Great. Thanks!
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Amplitude decaying sine function
  1. Adding sine functions (Replies: 9)

  2. Amplitude of sine wave (Replies: 2)

Loading...