Help with Acceleration Calculations in Visual Basic

  • Thread starter bsharp
  • Start date
In summary, this program is meant to calculate the time it takes to accelerate at a set rate to a set velocity from a set velocity. It is also meant to calculate the distance it takes to accelerate at a set rate from a set velocity to a set velocity.
  • #1
bsharp
7
0
I am working on a project of my own and need a little help. I am writing a program in Visual Basic that involves some precise calculations of Acceleration. I have looked over quite a bit of information and examples on the web and I am more confused now than when I started. I am sure you all have been here at one point or another.

Basically I need to

1: Find the Time it takes to accelerate at a specified rate to a specified velocity from specified velocity.

2: Find the distance it takes to accelerate at a specified rate from a specified velocity to specified velocity

Below is what I have been playing around with in VB. I think I have confused my self.

'in inches per second/second
Dim MaxAcceleration As Double = 200

'in seconds
Dim MaxAcceltime As Double

'in inches
Dim MaxAcceldistance As Double


'inches per second/second
Dim MaxVelocity As Double = 6000
Dim SetVelocity As Double = 20
Dim IntVelocity As Double = 0
Dim AverageVelocity As Double


' The time it takes to go from 0 to Max Velocity in seconds
'Max Acceleration time
MaxAcceltime = ((MaxVelocity - IntVelocity) / MaxAcceleration)

' I get 30.0


' The Average Velocity
AverageVelocity = ((IntVelocity + MaxVelocity) / 2)

'I get 3000.0


'The distance required to go from 0 to Max Velocity
'MaxAccel Distance in inches
MaxAcceldistance = (AverageVelocity * MaxAcceltime)

' I get 90000.0
 
Engineering news on Phys.org
  • #2
Nice work, bsharp. Your equations and answers are correct.
 
  • #3
Looks good...

But you might want to edit the comment line on your velocity variables...
bsharp said:
'inches per second/second
Dim MaxVelocity As Double = 6000
Dim SetVelocity As Double = 20
Dim IntVelocity As Double = 0
Dim AverageVelocity As Double


units should be inches per second.
 
  • #4
Thank you for the reply's. Some times thinking your incorrect and actually being correct is just as bad as thinking your correct and being incorrect. Although I guess it saves on finding out later on.
 

What is acceleration?

Acceleration is the rate of change of an object's velocity over time. It is a vector quantity, meaning it has both magnitude and direction.

How do I calculate acceleration in Visual Basic?

To calculate acceleration in Visual Basic, you will need to use the formula a = (v2 - v1) / t, where a is acceleration, v2 is the final velocity, v1 is the initial velocity, and t is the time interval. You can use this formula in your code to calculate acceleration for a specific scenario.

What units is acceleration measured in?

Acceleration is typically measured in meters per second squared (m/s2) in the metric system, or feet per second squared (ft/s2) in the imperial system. In some cases, it may also be measured in kilometers per hour squared (km/h2) or miles per hour squared (mi/h2).

What is the difference between average and instantaneous acceleration?

Average acceleration is the change in velocity over a specific time interval, while instantaneous acceleration is the acceleration at a specific moment in time. Average acceleration is calculated using the overall change in velocity, while instantaneous acceleration is calculated using the derivative of the velocity function.

How can I use acceleration calculations in my research or experiments?

Acceleration calculations can be used in a variety of scientific fields, such as physics, engineering, and astronomy. They can help you understand the motion and behavior of objects, and can be used to make predictions and analyze data in experiments and research projects. Some common applications include studying the motion of vehicles, calculating the acceleration of falling objects, and predicting the trajectory of projectiles.

Similar threads

Replies
6
Views
2K
  • Programming and Computer Science
Replies
15
Views
2K
  • Mechanical Engineering
Replies
9
Views
2K
  • General Math
Replies
11
Views
1K
  • Mechanical Engineering
Replies
19
Views
2K
Replies
8
Views
1K
  • Mechanical Engineering
Replies
3
Views
956
  • General Discussion
Replies
12
Views
1K
Replies
2
Views
275
Back
Top