# Water Rocket Project in Excel Visual Basic

I have a water powered rocket project for my college engineering class, and I have to write a program in Visual Basic in Excel that proves several physics equations about the trajectory of the rocket.

There are 3 phases to the program, but if I could just get one, I believe I could figure out the rest.

I've attached the information in a Word Document.

Thank you!
VBA-Program-of-Water-Rocket.docx
GrahamSkan

Are you the lecturer? It is against the policy of this forum to do students' homework for them.

You have submitted a thirty page explanation of the mathematics involved in this project, but it isn't clear where you are having difficulty. Is it just a matter of converting the equations to code?

I suggest that you put the initial values in a cells of a spreadsheet.

Start at or near the end of the calculation. You will see that the values on the right-hand side need to be determined, so go back and insert the calculation for those values.

In this example I started with acceleration, and saw that we need to find the force and mass of the object, so two more lines have been inserted. But these two lines in turn have right-hand variable that need to be calculated and so on.
``````Option Explicit

Sub Rocket()
'Declare variables
Dim sh As Worksheet
Dim hRocket As Double 'Height

Dim vRocket As Double 'Velocity

Dim mWater As Double 'Mass
Dim mRocket As Double
Dim mAir As Double
Dim mTotal As Double

Dim fNet As Double 'Force
Dim fThrust As Double
Dim fGravity As Double
Dim fDrag As Double

Dim aRocket As Double 'Acceleration
Dim tim As Double 'Time

'Constants
Const g As Double = 9.81

'Get initial values
Set sh = ActiveWorkbook.Sheets(1)
mRocket = sh.Cells(2, 1).Value
mWater = sh.Cells(2, 2).Value

'Calculations
'...

fNet = fThrust - fDrag - fGravity
mTotal = mWater + mPayload + mRocket + mAir

aRocket = fNet / mTotal

End Sub``````
chantalcookware

I'm the Teaching Assistant for the engineering class and have little background in VBA, but I have more experience with the Physics aspect of the code. I'm looking for help in setting up the loops of the program and the code for the actual excel page where data is inputed into. Thank you
GrahamSkan

THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.