Amplitude decaying sine function

Click For Summary

Discussion Overview

The discussion revolves around modifying a sine function to have a decaying amplitude that starts at a specific point (x=5) while maintaining a constant amplitude of 1 for values less than 5. Participants explore various mathematical approaches to achieve this effect in a numerical plotting context, specifically using MATLAB.

Discussion Character

  • Exploratory, Technical explanation, Mathematical reasoning

Main Points Raised

  • One participant suggests multiplying the sine function by exp[-(x-5)] to achieve the desired decay starting at x=5, but notes issues with values less than 5.
  • Another participant proposes using the function min(1, exp(5-x)) as a potential solution to ensure the amplitude remains 1 for x values less than 5.
  • A later reply discusses the need for a step function or conditional logic to create a smooth transition at x=5.
  • One participant confirms that the suggestion of min(1, exp(5-x)) effectively allows the sine function to start decaying at x=5 without affecting the amplitude for x<5.
  • Another participant explains the mechanics of the min function, indicating it outputs 1 for x values between 0 and 5 and a decaying value for x>5, resolving the initial problem.

Areas of Agreement / Disagreement

Participants generally agree on the effectiveness of the min function approach, but there are varying opinions on the necessity of using conditional logic or step functions. The discussion remains open regarding the best method to implement the decay.

Contextual Notes

Some participants express uncertainty about the implications of their mathematical choices, particularly regarding the behavior of the sine function and the exponential decay in the specified ranges.

Who May Find This Useful

This discussion may be useful for individuals interested in numerical methods for plotting functions, particularly those working with MATLAB and exploring function modifications in mathematical modeling.

fog37
Messages
1,566
Reaction score
108
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
 
Physics news on Phys.org
min(1,exp(5-x))?
 
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 ?
 
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.
 
Thanks mfb but I don't follow your suggestion: what is min(1,exp (5-x)) supposed to do?
 
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...
 
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!
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
5K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
6K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K