Some trig help, please  Printable Version + HP Forums (https://archived.hpcalc.org/museumforum) + Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum1.html) + Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum2.html) + Thread: Some trig help, please (/thread241981.html) 
Some trig help, please  Matt Agajanian  04122013 Hello all, I am trying to develop a sine function such that the negative part of the phase is shorter than the positive part of it. It's a biorhythm curve. But, what makes this curve so different is that as the 23day cycle has 111/2 days in positive and 111/2 in negative area, my variation only has three days below zero line. Now, one of the algorithms I've fiddled with is the trigonometric formation: a * sin [b * (x + c)] + d
Where a will adjust the amplitude of the wave, Although coefficients a and d do not affect the variance in periodicity, I am wondering if adjusting coefficients b and c will produce the variance of periodicity I need. If so, how should I adjust coefficients b & c so that of the 23day cycle, 20 days are spent on the positive part of the graph while the remaining three are in negative range?
Thank you
Re: Some trig help, please  Kiyoshi Akima  04122013 The coefficient c has no effect on the period, only on the phase. To get a period of 23 days, set b to pi/11.5 . To get 20 days above and only three below, set d to 0.9172a. This will give you a sine wave with a period of 23 days, an amplitude of 2a, a minimum of .0828a, a maximum of 1.9172a, and positive everywhere except from day 15.75 to day 18.75 .
Re: Some trig help, please  Matt Agajanian  04122013 So that I understand the trigonometry a bit better, please tell me how you arrived at these numbers.
Thanks
Re: Some trig help, please  Kiyoshi Akima  04122013 I suppose I'm eventually going to have to explain how I arrived at my results, so here goes...
I want to shift the basic sine wave up so that only 3/23 of the period is negative. To do this I found two points 3/23 of a period apart that have the same sine by using this 15C+ program: 01 LBL 9Where Register 0 contains (3/23)*(2pi) and then simply SOLVEd it between pi and 2pi (yes, yes, it might have been a bit quicker to solve between pi and 1.5pi). This gave me 4.3026, and the sine of that is 0.9172 . Edit: Yep, Matt's request for an explanation came while I was composing this.
Edit 2: Now that I've had a night's sleep, I realize I've done this the hard way. The simple way is sin[3pi/2  (1/2)*(3/23)*(2pi)] Edited: 13 Apr 2013, 1:45 p.m. after one or more responses were posted
Re: Some trig help, please  fhub  04122013 Make it sin(2*pi/23*(x+3)), i.e. b=2*pi/23 and c=3.
Franz
Re: Some trig help, please  Kiyoshi Akima  04122013 This still has 11.5 days negative instead of the requested 3.
Re: Some trig help, please  fhub  04122013 No, make a plot and you'll see that it's correct.
Ftanz
Re: Some trig help, please  Kiyoshi Akima  04122013 I did plot it, and half of the graph is negative.
Re: Some trig help, please  fhub  04122013 I guess I misunderstood what Matt wanted!? That's the usual problem with a foreign language ... :(
Franz
Re: Some trig help, please  Kiyoshi Akima  04122013 As I interpreted the question (and it's not my native tongue either) he wants a function which is negative 3/23 of the time and positive the other 20/23.
Re: Some trig help, please  Matt Agajanian  04122013 Quote:No Franz, you were right, the period is 23 days, yes. It's just that the variance in positive/negative duration is very different. It's okay. Re: Some trig help, please  Matt Agajanian  04122013 Yup, that's it.
Re: Some trig help, please  Matt Agajanian  04122013 Okay, got it!
Re: Some trig help, please  Matt Agajanian  04132013 Okay! Now that we solved that, I noticed that the amplitude reaches past +1, the negative period is so short, the negative amplitude is not an issue. So, how can I restrict the maximum positive amplitude to +1? Next, how can I adjust the function so that 0 occurs at x= 16 1/2 and continues decreasing, followed by an upturn which reaches 0 at x=19?
Edited: 13 Apr 2013, 1:16 a.m. after one or more responses were posted
Re: Some trig help, please  Kiyoshi Akima  04132013 Since the maximum is 1.9172a, simply set a to 1/1.9172 .
Re: Some trig help, please  Matt Agajanian  04132013 Now I'm completely confused. When I put in the new value for a, 1/0.917211302 so that f(0)=1, I still get f(0)=0.917211302. After putting the original coefficients you gave me in, 0.917211302 comes as the first value where x=0, so, starting from scratch, how can I adjust the function so that positive maximum is 1, f(15 1/2)=0 decreasing towards an upturn where f(19)=0. Now, with all this restated, what should the coefficients be.
And, please accept my apologies for any confusion or frustration this project has caused. Edited: 13 Apr 2013, 2:22 a.m.
Re: Some trig help, please  fhub  04132013 Quote:Well, now you're indeed a bit confusing: first you wanted a negative interval of 3 days, and now you want 3.5 days (from 15.5 to 19). Or is it 2.5 days (from 16.5 to 19 as in your last post?). Ok, I take these conditions (with 15.5, i.e. a negative interval of 3.5), and I still assume the whole period should be 23 and the maximum value 1. With these conditions your function looks like this: y = a*sin((2*pi/23)*x) + a*sin(8*pi/23) with a=1/(1+sin(8*pi/23))
a = 1/(1+sin(8*pi/23)) = 0.529693219 b = 2*pi/23 = 0.273181969 c = 0 d = sin(8*pi/23)/(1+sin(8*pi/23)) = 0.47030678 i.e. y = 0.529693219*sin(0.273181969*x) + 0.47030678
Franz
Re: Some trig help, please  Walter B  04132013 Good grieve, all that hassle and nine decimals for a biorhythm. Employ RAN# instead ;/
Re: Some trig help, please  fhub  04132013 Quote:Aaah, once again a great comment from our math expert ... ;) Franz
Edited: 13 Apr 2013, 10:47 a.m.
Re: Some trig help, please  Matt Agajanian  04132013 My focus was on f(16.5)=0 downward to f(19)=0, proceeding upward. So, what would the equation look like with this setup? Edited: 13 Apr 2013, 11:51 a.m.
Re: Some trig help, please  Kiyoshi Akima  04132013 Like Franz, I'm getting confused. You now want it negative for 2.5 days instead of the original 3?
Re: Some trig help, please  fhub  04132013 Quote:Well, then the function is: y = a*sin((2*pi/23)*(x1/2)) + a*sin(9*pi/23) with a=1/(1+sin(9*pi/23)) So for your initial function a * sin [b * (x + c)] + d that means: a = 1/(1+sin(9*pi/23)) b = 2*pi/23 c = 1/2 d = sin(9*pi/23)/(1+sin(9*pi/23))
Franz
Re: Some trig help, please  Matt Agajanian  04132013 To Franz and all the group.
Thank you very much. Like I said, I am grateful for all your help on this and, as I'd said before, I apologise for any confusion and frustration my inquiry has caused.
Re: Some trig help, please  Matt Agajanian  04132013 So that I can learn more about how this trig algorithm works, how were these values derived?
Thank you.
Re: Some trig help, please  fhub  04132013 Quote:Oh, that's complicated to describe only with words without showing it on a graph, but I'll try it:
I did it in 4 steps:
2) shift the function upwards, so that y is negative only in an interval of 2.5 (i.e. d=?): Now we have y = f(x) = a*sin(2*pi/23*x) + a*sin(9*pi/23)
3) now scale the function to get a max. yvalue of 1 (i.e. a=?):
4) and finally shift the function in xdirection, so that the first zero should be at x=16.5 (i.e. c=?): These 4 steps together lead to the following solution: y = f(x) = 1/(1+sin(9*pi/23))*[sin(2*pi/23*(x1/2)) + sin(9*pi/23)] Franz
Edited: 13 Apr 2013, 4:23 p.m.
Re: Some trig help, please  Matt Agajanian  04132013 Franz, your explanation is just what I needed to understand this precisely. You are very good at putting the graph into words. With your stepbystep explanation, I am able to understand more clearly how the equation works because you have explained how each step affects the graph's appearance and function's periodicity. That helps me understand precisely how and why the function works the way it does.
Thanks.
Re: Some trig help, please  fhub  04132013 You're welcome, Matt! Quote:Well, after teaching mathematics for about 30 years I guess I have a bit ;) experience in explaining, but of course in German (and with a diagram at hand) I could have done it much better.
Franz
Re: Some trig help, please (illustrated)  C.Ret  04142013 Quote: Re: Some trig help, please  Csaba Tizedes (Hungary)  04152013 Really you're do not need the value of these three function. The "critical days" are where these graphs cross out the xaxis. So the simplest biorithm calculator need only deltadays calculation and a fractional part function, like on 12C:
RCL 0 For running you need to store the birthdate to Reg0 and type in actual date and press R/S. After running you can see the days from the birth, then press RollDown, you can see the Physical cycle fractional part of 23 days, press RollDown, you can see the Emotional cycle fractional part and then press again RollDown, you can see the Intellectual part. Because one day is approx 0.03...0.05 part of the cycle the critical values where the each function crosses the xaxis: 0.00...0.04 and 0.96...1.00 For example Euler Physical, Emotional and Intellectual state on 18. Sept, 1783. (birthdate: 15. Apr, 1707.):
g D.MY
Csaba
Re: Some trig help, please (illustrated)  Matt Agajanian  04182013 Franz, this is fantastic. Not only do I see what you were developing, with the graph's step by step transformation I can clearly understand it. Thanks again!!
Re: Some trig help, please (illustrated)  fhub  04182013 Quote:Matt, this diagrams were made by C.Ret, not by me. ;) BTW, in the last final formula there's a () missing.
Franz
Re: Some trig help, please (illustrated)  Matt Agajanian  04252013 So, how should that last formula read?
Re: Some trig help, please (illustrated)  fhub  04252013 Quote:The error is not in the text but in the last formula in the graphic: Instead of sin(2*pi/23*x1/2) it must be sin(2*pi/23*(x1/2)), i.e. the () around x1/2 is missing.
Franz
Re: Some trig help, please (illustrated)  Matt Agajanian  04292013 Thanks for the clarification. And thanks to you folks here, I'm brushing up on my long forgotten trig properties, axioms and identities.
