Posts

Showing posts from 2017

The water rocket: Numerical calculations

So now we're ready to put all the calculations together: launch tube, water thrust, air thrust, and ballistic flight. The launch tube calculation is more like an initialization for the water thrust phase; we just have one time step of the duration of launch tube traversal. Get the initial pressure $$P_0$$ for water thrust from (L1), and the velocity $$v_0$$ from (L4), and use these values in the first water thrust time step. You may also want to initialize the altitude achieved as the height of the tube. Water thrust calculationFor the water thrust phase, we do the following calculations at each time interval, which should be 1 millisecond or less in duration:At the beginning of time interval $$i$$:Get the pressure $$P_1$$ from (W4), using the change in water volume from the previous time interval.From the water volume, calculate the height of the water in the bottle — needed for $$H$$ in equation (W1). This can be approximated by calculating the height of the water in a cylinder …

The water rocket: Thrust from air

After the water is expended, the tank (bottle) still contains substantial pressure that releases quickly through the nozzle. This final burst of air can impart a significant boost to velocity (at least 30% depending on the mass of the rocket), so we shouldn’t ignore this contribution to thrust. For convenience, however, we will ignore any further affects on air temperature due to water vapor although we will still calculate pressure changes adiabatically. Any water vapor will likely have condensed by the time airflow begins. Thrust from choked airflow When the ratio of ambient pressure to total absolute tank pressure is less than the "choke ratio" $$\alpha_c = \frac{P_a}{P_e} = \left(\frac{2}{\lambda+1}\right)^\frac{\lambda}{\lambda-1} \tag{A1}$$ then the outflow is choked, or limited, to the speed of sound: $$c = \sqrt{\lambda RT} \tag{A2}$$ where$$c$$ = speed of sound in air, approximately 343 m/s at 20°C, 331 m/s at 0°C$$R$$ = ideal gas constant divided by gas molecular w…

The water rocket: Thrust from water

Once the rocket has left the launch tube, the water thrust phase of the flight begins. But before we begin those calculations, we need to have equations for ballistic flight, which is the last step described in the introduction. Why? Because during ballistic flight (coasting through the air), the only forces acting on the rocket are gravity and wind drag — but these are acting on the rocket during the thrust phase too. Ballistic flight is exactly the same, just without the thrust. Ballistic flight We need to know how gravity and drag affect acceleration, velocity, and ultimately altitude during all thrust phases as well as the ballistic trajectory afterward, so we'll start with the ballistic flight equations.Air resistanceFirst we need to get the ambient air density. Denser air results in higher drag, and dry air is more dense than moist air. To get the density, we first need to know the partial pressure of water vapor in the air. To do this, we first get the saturation vapor pres…

The water rocket: Launch tube thrust

A launch tube inside the bottle does two important things:A tube with its open end above the water level keeps the water from spilling into the launcher pipe-work, leaving it inside the bottle for the rocket to use as reaction mass.It allows the bottle to gain velocity as the nozzle slides along the length of the tube, with negligible leakage of the water reaction mass.There are a large number of international standards for 28 mm soda bottle necks. All the PET soda bottles I've seen look like PCO-1881 (PDF) evidenced by the slope of the flange that holds the bottle cap's retaining ring. In any case, all these standards have the same inner diameter: 21.74 mm. Let's assume 21.75 mm for wear and tear, as well as conservatism when calculating leakage. A standard ½-inch Schedule 40 PVC pipe has an outside diameter of 0.840” or 21.36 mm, which fits nicely into the bottle neck with about a 0.19 mm gap all around. The force acting on the bottle is simply the internal pressure mult…

The water rocket: Introduction

I recently became interested in water rocketry after realizing how complicated the physics actually can be, and the fact that the equations are best solved with numerical methods because so many interacting variables change rapidly in a non-linear fashion. For those unfamiliar, a water rocket is a rocket that uses water as its reaction mass, powered by air pressure. The cool thing about it is the easy availability of pressure vessels — soda bottles. You get a free rocket body with each soft drink purchase! A typical soda bottle can withstand an internal pressure of 100 psi easily, and can go up to 160 psi before rupturing.Here's the basic bare-minimum set-up, without explaining how the launcher works. There are plenty of tutorials on building a launcher.Launching just a bottle without anything else attached.Source: by RadioActive~commonswiki on Wikimedia Commons It sounds like a low-cost hobby, right? Wrong. Well, sort of. Cheap is possible if you just want to have fun and aren'…

A hypercube full of rooms

While I'm on the subject of Dungeons & Dragons (see my previous post on ability score probabilities), I recall something I did involving a tesseract way back in 2007 and posted on the community forum of Wizards of the Coast. WOTC took down their forum in 2015, but fortunately the Wayback Machine has an archived copy. Imagine a cubical room. It has four walls, a ceiling, and a floor (six faces). Each face has a door or opening, to allow you to pass through to the next room. Each cubical room connects to six other rooms — but there are eight rooms interconnected this way.This isn't possible to draw in 3 dimensions without distorting some of the rooms. Imagine a central room with a room connected to each face. So you have the center room, the north, south, east, and west rooms, and the top and bottom rooms. That takes care of seven rooms. The eighth room, we'll call it the "outer" room, is connected to those six rooms surrounding the center. Designating the room…

Most probable array of D&D ability scores

There's an element to the game Dungeons & Dragons that lends itself to a numerical analysis: the initial array of ability scores assigned to a character. Some background: A character in the game has scores assigned to each of six abilities (strength, dexterity, constitution, intelligence, wisdom, and charisma). The first step in creating a character is to generate an array of six numbers by rolling dice, using a method known as "4d6 drop lowest". This means, roll four six-sided dice, remove the lowest value, then add the remaining three dice together (the result ranges from 3 to 18). Do this six times to generate an array of six values, then assign these values to your character's abilities as appropriate for the character's role (fighter, cleric, wizard, etc.).The problemThe question I want to answer here is: What does a "typical" array look like? More importantly, how would I know if the array I end up with is better or worse than average?Each res…

Nonrecursive fractal

While thinking about the Koch curve it occurred to me that a recursive algorithm to generate one side of the curve would be trivial, but a non-recursive algorithm is pretty simple as well, although it took a lot of thought on my part to get it to work. I don't claim to be an expert at algorithms but I'm pleased when I can figure something out. Here's what I came up with. Your browser does not support the HTML5 canvas tag.Fractal order: 0 (click the arrows) The idea is to start out with the smallest generator unit, calculating its size by scaling per the length of the parent segments, and accumulating the rotation angles. Then draw the generator unit at that scale and rotation. Repeat for the total number of smallest generator units, which would be the number of segments in the unit to the power of (fractal order − 1).Here's the code including the graphics scaling. // display initialization and scaling var c = document.getElementById("myCanvas"); var ctx =…

Fake data part 4 - Perturbing volatility

And here is part 4, which I drafted years ago but never published on my blog until now. I didn't quite get done with this project the way I wanted, but it's been a long time and I've moved on. Now I want to see if there is any dependency between successive moves in a market, compared to a random walk. I first built a 21×21 table (corresponding to the integers -10 to +10 on each axis) where each cell contains a count of how many times a move of [row] standard deviations was followed by a move of [column] standard deviation. For example, if the cell at [-2,1] contains the value 87, that means during the entire history of the market, a return of -2 standard deviations was followed by a return of +1 standard deviations 87 times. I used 48 years of data, about 12,0000 values for the S&P 500 index.Then I performed a Monte Carlo test. I scrambled the order of log returns (not prices) several hundred times and constructed a similar table containing the average count of each ti…