Page 1 of 1 [ 10 posts ] 

Ashton
Blue Jay
Blue Jay

User avatar

Joined: 9 Jun 2008
Age: 33
Gender: Male
Posts: 76

22 Aug 2008, 5:32 am

Ok, here's what I need help with.

I have a Sine curve (-0.5sin(2pi/3 * x)) and I need to learn how to decrease the amplitude, so when x=345, the amplitude is zero.

Can anybody help me out? I'm stumped.....



tomamil
Veteran
Veteran

User avatar

Joined: 13 May 2007
Age: 45
Gender: Male
Posts: 1,015
Location: Jeddah, Saudi Arabia

22 Aug 2008, 6:14 am

it should be something like this:
pow(1.01,-x)*sin((2.0*3.14)*(x)),
it's not exactly what you wanted, but maybe you could follow the logic...



lau
Veteran
Veteran

User avatar

Joined: 17 Jun 2006
Age: 76
Gender: Male
Posts: 9,798
Location: Somerset UK

22 Aug 2008, 6:35 am

Ashton wrote:
Ok, here's what I need help with.

I have a Sine curve (-0.5sin(2pi/3 * x)) and I need to learn how to decrease the amplitude, so when x=345, the amplitude is zero.

Can anybody help me out? I'm stumped.....

Although tomamil's answer is probably the sort of thing you are looking for, bear in mind that it is no longer a sine curve, and an exponential decrease will never attain zero.

If your genuine sine curve is:

y=A*sine(B*x + C)

to ensure this is zero at x=345, either make B*345+C=k*pi or A=0.

Alternatively, if you do not require a sine curve, you could go for many different envelopes... making "A" be f(x), such as:
f(x) = (1-x/345) (linear decreasing envelope)
f(x) = (1-x/345)^2 (quadratic envelope)


_________________
"Striking up conversations with strangers is an autistic person's version of extreme sports." Kamran Nazeer


coyote
Supporting Member
Supporting Member

User avatar

Joined: 10 Nov 2004
Age: 57
Gender: Male
Posts: 388

22 Aug 2008, 7:17 am

the sin function gives 0 for angles of 0deg or 180deg. So for the amplitude to equal 0, you need your (2pi/3 * x) to give 0 or 180 (in degrees). So resolve for:

2pi/3 * x = 0

or

2pi/3 * x = 180

(may i ask why you have that negative sign for your amplitude factor ? this induce a 180degree phase shift....)



traveller011212
Sea Gull
Sea Gull

User avatar

Joined: 26 May 2008
Age: 44
Gender: Female
Posts: 211
Location: Right here!!

22 Aug 2008, 12:55 pm

345 = 115/3

==> -0.5 sin(2/3*pi*345) == -0.5 sin (2*pi*115)

since sin(2*n*pi) = 0

-0.5 sin (2/3*pi*x) = 0 for all x = 3,6,9,12,.... (multiples of three)



Ashton
Blue Jay
Blue Jay

User avatar

Joined: 9 Jun 2008
Age: 33
Gender: Male
Posts: 76

22 Aug 2008, 7:44 pm

lau wrote:
Ashton wrote:
Ok, here's what I need help with.

I have a Sine curve (-0.5sin(2pi/3 * x)) and I need to learn how to decrease the amplitude, so when x=345, the amplitude is zero.

Can anybody help me out? I'm stumped.....

Although tomamil's answer is probably the sort of thing you are looking for, bear in mind that it is no longer a sine curve, and an exponential decrease will never attain zero.

If your genuine sine curve is:

y=A*sine(B*x + C)

to ensure this is zero at x=345, either make B*345+C=k*pi or A=0.

Alternatively, if you do not require a sine curve, you could go for many different envelopes... making "A" be f(x), such as:
f(x) = (1-x/345) (linear decreasing envelope)
f(x) = (1-x/345)^2 (quadratic envelope)


I sort of follow what your doing, I'm not just sure how to go about it. I'm not entirely sure if you get what I'm after either. I need it to stay a genuine Sine curve, have an initial amplitude of -1 and gradually decrease until it reaches 0 at x=345. Sort of like this (Excuse the crudity of the sketch, Yay MS Paint):

Image

Would it be possible to do this without changing the period?



coyote
Supporting Member
Supporting Member

User avatar

Joined: 10 Nov 2004
Age: 57
Gender: Male
Posts: 388

22 Aug 2008, 8:14 pm

now i see what you meant.... multiply the whole thing by (345-x) and then re-divise by 345 to keep the unity (or the peaks will get out of the screen). So something like:


y = ( (345 - x) / 345 ) * ( -0.5sin(2pi/3 * x) )



Ashton
Blue Jay
Blue Jay

User avatar

Joined: 9 Jun 2008
Age: 33
Gender: Male
Posts: 76

22 Aug 2008, 8:53 pm

coyote wrote:
now i see what you meant.... multiply the whole thing by (345-x) and then re-divise by 345 to keep the unity (or the peaks will get out of the screen). So something like:


y = ( (345 - x) / 345 ) * ( -0.5sin(2pi/3 * x) )


You sir, are a God. Thanks very much.

In return - Cookie:

Image

:)



Orwell
Veteran
Veteran

User avatar

Joined: 8 Aug 2007
Age: 35
Gender: Male
Posts: 12,518
Location: Room 101

22 Aug 2008, 9:00 pm

Ashton wrote:
coyote wrote:
now i see what you meant.... multiply the whole thing by (345-x) and then re-divise by 345 to keep the unity (or the peaks will get out of the screen). So something like:


y = ( (345 - x) / 345 ) * ( -0.5sin(2pi/3 * x) )


You sir, are a God. Thanks very much.

In return - Cookie:

Image

:)

I didn't help, but can I have a cookie too?


_________________
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH


coyote
Supporting Member
Supporting Member

User avatar

Joined: 10 Nov 2004
Age: 57
Gender: Male
Posts: 388

22 Aug 2008, 9:05 pm

miam ! thank you :D i'm glad i helped. Typical Asperger here: your visual graph talked to me, and sine waves are.... yes, one of my obessions 8)