Simulating a water rocket motion using a computer programme

In summary, the individual is seeking assistance with modeling the motion of a water rocket using a computer program. They have limited knowledge of programming and are struggling to find the right set of equations. The goal is to predict a force-time graph for the rocket's motion and they are unsure if Mathematica is the best program to use. They have listed the constants and variables involved in the experiment and have made some assumptions. The critical formulas needed for the model are the rate of water ejection and the water pressure as a function of volume. The individual has experience with Excel and has been advised to use Mathematica. The suggested approach is to set up a spreadsheet with initial conditions and use a time step to update the values for each time interval.
  • #1
rocketstudent
8
0

Homework Statement


I am trying to model a water rockets motion using a computer programme in order to compare it to my experimental data. I am studying physics at degree level but I have no knowledge of programming and am finding this particularly difficult. I have thought about using mathematica to solve a set of differential equations that could predict a force time graph for my rocket, however I do not know how to use this and I am finding it difficult to find the right set of equations.

The simulation needs to be able to predict a force time graph for a given set of variables such as volume of fuel, pressure inside the rocket etc.

I need to know what is the best way of going about this as I am not sure if mathematica is the best programme to use. If there is a solution I will also most likely need help in writing this.

Would anyone be able to assist me with this as is it of high priority for me!

Also this is my first post so if I have missed anything out please comment so I can explain!

Thank you
 
Physics news on Phys.org
  • #2
Let's see if I can give you direction without giving you answers.

Would it be acceptable for your model to step through time changing the a description of the state of the rocket as it proceeded? If so, please start by listing (and posting to this thread) the time-dependent variables that would describe the state of the water rocket.
 
  • #3
I'm not quite sure what you're asking, if you are asking for a qualitative description I can give you that, and the variables it depends on, but the model has to be able to predict the force-time graph
 
  • #4
There are different forms of mathematical models. The simplest (involving a minimum of calculus) is simply to step through time.

But no matter what form of model you are using, you're going to need a list of the parameters that will be modeled.
To get you started, here is an example of a time-dependent variable:
* The mass of water contained in rocket, expressed in grams.

Now come up with at least four more parameters that will describe this rocket during its flight. I say "at least four", but there are probably going to be six or seven.
 
  • #5
As I read through your posts more carefully, it looks at though this is a "captured" rocket that has been tied down. So we aren't going to need to keep track of the rockets overall velocity and acceleration. Is that right?

On the other hand, how is the "pressure inside the rocket" determined? Is it a constant?
 
  • #6
OK of course.
Constants in the experiment are:
The rocket is a 1.5 litre PET bottle.
The pressure inside the rocket is pumped up to 40 PSI

Variables:
Mass of the water (fuel) - [kg]
Force of the rocket - [N] (rocket is measured by a force sensor directed slightly above the rocket)
Pressure within the rocket during time of flight - [PSI]
Velocity of rocket - [m/s]
Volume of water during each launch - [ml]

Assumptions:
The rocket launches directly upwards. Motion is in the vertical direction only.
The mass loss rate of the rockets fuel (water) is constant.
Air resistance is negligible.

Of course some of these assumptions are not practical but I want to start at the basic level, then introduce the assumed things as variables once I build upon this model.The way I am testing the rocket at the moment is launching it into a force sensor which is above the rocket, this measures the force so I can produce experimental graphs of force vs time. The launch mechanism for the rocket is a release valve attached to a pump that only releases the water at 40psi. So the pressure inside the rocket initially is going to be the same throughout the experiment. The acceleration could be determined experimentally from a force vs time graph I believe, then from this also the velocity.

My aim is to compare my experimental data with my model and show that it fits, and explain any discrepancies.
 
  • #7
The critical formulas will be:
* the rate at which water is ejected given a certain pressure
* the water pressure as a function of the volume of water

I don't know what you're favorite programming language is, but assuming you stick to simply stepping through time, your basic model is going to look something like this:
Code:
dTimeStep  = 0.1;   // seconds
dWaterMass = 1.65;   // Kgrams
dPressure  = 40.0;   // psi
dVelocity  = 0.0;   // m/s
for(dTime=0.0; dTime<30.0; dTime+=dTimeStep) {
  { ... output current rocket state ... }
  dRate = ...;   // Kgrams/second
  dWaterLoss = dRate*dTimeStep;   // Kgrams
  ...
  dWaterMass -= dWaterLoss;
  ...
}
Get the picture?
 
  • #8
Ok thanks for your help. Unfortunately I haven't got a clue what that means as I don't have programming experience! I am not quite sure how to tackle it.
 
  • #9
Let's start with those critical formulas:
* the rate at which water is ejected given a certain pressure
* the water pressure as a function of the volume of water

Do you have any ideas as to what those formulas should be?
 
  • #10
What potential model programming tools do you have experience with?
Mathematica? Excel? Any programming language?
 
  • #11
Excel I have experience with. I have been advised that I could use Mathematica although I do not have experience with this.
 
  • #12
OK, let's stick with Excel.
Set up column A1 through B2 as follows:
"Time Step (seconds)", 0.1
"Bottle Mass (Kg)", 0.02

We will keep rows 3 to 6 for other global parameters we may need later.

Set up A8 to I8: "Time", "Water Mass", "Total Mass", "Pressure", "Eject Rate", "Eject Mass", "Velocity", "Force","Acceleration"

Set up A9 to G9 with initial conditions: 0.0, 1.70, A9+$B$2, 200*(B9-1.5), 0.4*D9, $A$2*E9, 0.0, ...
You do H9 and I9 (force and acceleration)

Copy row 9 to row 10.
Set A10 to: A9+$A$2
Set B10 to: B9-F9
Set G10 to: G9+($A$2*I9)
Copy row 10 to 11, 12, 13, ...
 
  • #13
Ok thank you I have laid it out as you have said, couple of questions -
what is the bottle mass, 0.02 step for?
Water mass 1.7 - is this an arbitrary value that I can input or is it 1.7 for a reason?
Why is the multiplier for eject rate 0.4?

Also Acceleration values most likely will not be able to measure directly however this isn't too much of a problem.

This is a good start I appreciate it a lot. How would I then go on to predict a force time graph without having to input values for the force?
 
  • #14
The bottle itself will have mass - which will affect the total mass - which will, in turn, affect the acceleration.
The mass of the water will be something over 1.5 (the capacity of the bottle) - otherwise there will be no pressure.
So you pressure formula will be based on (water mass - 1.5). Select your initial value for water mass so that your formula (whatever that will be) gives you 40psi.

I have no idea what the formula for the ejection rate is. You'll have to come up with that yourself. I made it proportional to pressure. Whatever it is, you should check for a negative value and use 0.0 if need be (MAX(...)).

Once you pick you psi formula and your ejection rate formula, columns A and H will give you your predicted time/force graph.
 
  • #15
If you know the ejection rate and the aperture size (diameter of bottle opening), then you should be able to compute the velocity of the ejected water and from that the force being generated.
 
  • #16
I don't want to distract you from trying to understand the numerical approximation method.

It might help you understand parts of this if you develop at the same time the differential equations that this is based on.

There are a couple of differential equations that you might think of how to write down. The first would be m'(t), the derivative of the mass. That should be simple for you to write down and even to solve in your head. The second would be y''(t), the second derivative of the altitude, which is also the acceleration. That is perhaps a little trickier to write down, but if you think very carefully about all the components of your system you might be able to write that down.

All these equations are only during the time from launch until the tank is empty, before and after that different equations will be involved.

With those equations you might be able to solve this directly. And you might be able to compare these with the approximation you are trying to understand. Both those might help you verify what you are doing.
 
  • #17
There is a lot of information related to this problem on the net just Google "Water Rocket Differential equations". This is a very common undergraduate engineering lab
 
  • #18
Thank you Bill. I have been told that the differential equations involved cannot be solved analytically and hence why I have to model it. I do have some equation s to do with the mass loss rate and the acceleration however there are too many variables to solve it.

RTW9
I will search tha term and see what I can find thank you.
 
  • #19
RocketStudent: Have you gotten the Excel to work? If not, what's the problem?
 
  • #20
I have got what you have told me down on the spreadsheet, now I am trying to find out formula for the ejection rate of the water, and also the velocity of the rocket, in order to gain a velocity time graph and then a force time graph.
 
  • #21
What are you using for a delta time in Excel? To get the Excel code working, I suggested 0.1 seconds. But now that you're looking for more precise results, you may want to set it lower - perhaps 0.025 or 0.010.
 
  • #22
You consider using MATLAB to solve your problem. Its a common tool used in engineering schools. A simple alternative would be freemat which has many of the core features of MATLAB.

A fancier tool would be open source physics at www.compadre.org/osp which is a collection of java classes for numerically Integrating differential equations. It would require you to learn some java and the eclipse ide.

One last alternative would be the processing.org ide also java based but very easy to learn and use. You have to implement the differential equation algorithm yourself or find an example that does something similar.
 
  • #23
jedishrfu said:
You consider using MATLAB to solve your problem. Its a common tool used in engineering schools. ...
We ran through several possibilities, including Mathematica, a couple of days ago. He had experience with Excel - and basically nothing else. So I recommended Excel for him.
I don't how much time he has for this. He seems to be making progress.
 

Related to Simulating a water rocket motion using a computer programme

1. What is a water rocket?

A water rocket is a type of model rocket that uses water as its propellant. It typically consists of a plastic bottle partially filled with water and pressurized air. When the pressure is released, the water is forced out of the bottle, creating thrust and propelling the rocket upwards.

2. How does a computer program simulate the motion of a water rocket?

A computer program uses mathematical equations and algorithms to simulate the motion of a water rocket. These equations take into account factors such as the amount of water and air in the rocket, the mass and shape of the rocket, and external forces like gravity and air resistance.

3. What is the purpose of simulating a water rocket motion using a computer program?

The purpose of simulating a water rocket motion using a computer program is to better understand the physics behind the rocket's flight and to predict its trajectory. This can be useful for designing and improving water rockets, as well as for educational purposes.

4. How accurate are the simulations generated by computer programs?

The accuracy of the simulations depends on the quality of the program and the accuracy of the input parameters. With precise input data and advanced simulation techniques, the results can be very accurate. However, there may still be some discrepancies between the simulation and the actual flight due to external factors and variables that are difficult to account for.

5. What are some common challenges in simulating water rocket motion using a computer program?

Some common challenges in simulating water rocket motion include accurately modeling the complex physics involved, accounting for external factors such as wind and air resistance, and obtaining precise input data. Additionally, the simulation may not perfectly match the actual flight due to limitations of the program and unforeseen variables.

Similar threads

  • Aerospace Engineering
Replies
24
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
310
  • Introductory Physics Homework Help
Replies
14
Views
854
  • Engineering and Comp Sci Homework Help
Replies
16
Views
2K
  • Classical Physics
Replies
17
Views
2K
Replies
165
Views
4K
  • Introductory Physics Homework Help
Replies
1
Views
977
  • Introductory Physics Homework Help
Replies
3
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
Back
Top