Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- t13=0 //Step Index: how much time a pendulum takes to move from an amplitude to the center, in other words, one-fourth of a period.
- t42=0 //Each integer n time from amplitude to center boosts the pendulum's amplitude
- and is significant in reaching a new set of amplitudes. These amplitudes of quarter period, n,
- are called Rail Amplitudes, as in the map, they lie on the rail of what looks like a ladder.
- //Therefore, integer quarter periods are called Step Indexes cuz they sandwich a series of non-rail amplitudes,
- which we call a step. The step index gives these series of amplitudes a designation.
- public static void static Main whatever{
- for(1~n){ //there are infinite steps so we want only the first n.
- a13=6.5*t13*(t13+1) //derive Rail Amplitudes from the pendulum's Quarter Periods
- a42=215*t42*(t42+1)
- if (a13<a42){ //we choose to analyze the smaller Rail Amplitude.
- //We don't read a42 right after since a13 might still be larger
- print("rail13")
- readStep(a13,t13,42)
- t13++
- }else if(a13>a42){ //this case is a bit less likely to occur, as 42>13. After a42, a13 is always larger.
- print("rail42")
- readStep(a42,t42,13)
- t42++
- print("rail13")
- readStep(a13,t13,42)
- t13++
- }else if (a13==a42){ //this case is BY FAR the least likely to occur. just read both steps.
- print("Intersect!")
- readStep(a13,t13,42)
- t13++
- print("Intersect!")
- readStep(a42,t42,13)
- t42++
- }
- print(stepIndex, amplitude, length, stepType, and connect \n)
- also, store all this data in an array or something. I wanna paste it in a spreadsheet.
- At the end of this for loop, I should've stored the unused amplitude so we don't recalculate it again EVERY for loop,
- but I don't know how to do that.
- }
- next, drawTheDamnMap()
- User can ask for several things now.
- 1. Output the list of steps. Ask to filter certain stepTypes or an entire rail.
- 2. Draw graph of step vs stepLength
- 3. Accept a step index and draw a graph of swing index vs amplitude within that step.
- }
- readStep(amp,stepIndex,startAccel) { //find a step's length, type, and what rail number it connects to.
- /*Fist, if this amp is equal to ANY connect values in the array
- (check given index from biggest array amp's connect to the 1st amp smaller than this amp),
- then skip the entire readStep sequence. Connect = that array amp.
- The stepLength and stepType is identical to that step.*/
- if(this amp equals a connect value in the array){
- skip this whole thing and do what that comment says.
- }else{
- startAmp=amp
- length=0
- prevAmp=0
- accel=startAccel
- nonIntegerT=sqrt(2*amp/accel+.25)-.5
- while (amp!=prevAmp || nonIntegerT%1 != 0){ //this loop swings the pendulum til it find the end of the given step
- prevAmp=amp;
- amp=accel*ceil(nonIntegerT)^2-amp;
- swapAccel(13->42 or 42->13)
- nonIntegerT=sqrt(2*amp/accel+.25)-.5
- length++
- }
- stepType=null; //The Type is purely defined by where the step connects to.
- connect=null; //this is what step index this step connects to. It normally connects to its startAmp,
- in which case, the step is symmetric. But sometimes it goes somewhere random.
- Which rail it connects to is simply if the length is even or odd, so the data is considered stored there.
- if(amp==prevAmp){
- stepType=normal
- connect=stepIndex
- length*=2
- }else if(length%2){
- stepType=13To42
- connect=nonIntegerT
- }else{
- stepType=StepToStep
- connect=nonIntegerT
- }
- }
- return(length, stepType, connect)
- }
Advertisement
Add Comment
Please, Sign In to add comment