What is Velocity.length_squared?

In summary: Ablation is the process of breaking down a solid or liquid substance by vaporization and dissociation of the molecules from the surface of thesolid or liquid.
  • #1
Amsalja
14
3
Homework Statement
I am homeschooled and my dad isn't a physicist so he said I can ask questions for this. I am in 7th grade so if you could explain it carefully it would be appreciated. I have searched everywhere, even ChatGPT and ChatGPT says go and find an expert.

I chose for my final project to make a simulation of an asteroid falling from space to the Earth. I'm simulating how big it must be to reach the Earth's surface without being destroyed.

My asteroid's terminal velocity starts high, cause its in space (no air), so its going fast, but when it starts going into the atmosphere, it's terminal velocity becomes lower than its velocity. I need the equation for how much it slows down until it reaches its terminal velocity.

Also, I need the equation for ablation, like how much it breaks down or is burnt up whilst falling. I have the brittleness as a variable that the user can change.

I know that there are a lot of things that changes and a lot of ifs and stuff, but I can do that if I know the equations. I can create variables for those.

Here's the list of the variables that I have known:
Gravity - static - Earth only gravity. (Plan user control in future)
Drag Coefficient - static - the shape is predefined and stays (unrealistic, I know, but for ease)
Air Density - changes based on altitude (predefined from 'average' by altitude (earth))
Air Temperature - same as air density (based on altitude and known 'average')
Mass - predefined but changes as it is ablated. (Plan user control)
Volume - predefined but changes as it is ablated (Plan user control)
Shape - (Basic shapes - cube, sphere, etc) (Plan user control) (shape will not change once asteroid is launched)

Cross Section Area - predefined but changes as it is ablated
Altitude - starts at 80 km
Time - obvious
Terminal Velocity - predefined but also changes dependent on air, mass, volume, etc
Velocity - starts at 0 m/s. (But plan to allow user control)
C - (asteroid structure as a constant value average between .1 - 1.0 (user controlled))

This is a program/simulation so it's changing 60 times per second.
I have everything working except ablation over time and the asteroid slowing (at the correct amount of speed) to terminal velocity once it's within atmosphere.
Relevant Equations
Cross Section Area = with * length
Volume of cube is width * height * length, for sphere, 4/3 * pi * radius^3
Terminal velocity is Root((2 * Mass * Gravity) / (Air Density * Cross Section Area * DragCoefficient))
New Velocity = Current Velocity + Gravity * Time^2
I'm not sure.
A source said New Velocity = Current Velocity - TerminalVelocity every second until New Velocity = TerminalVelocity
But it doesn't seem right
 
  • Wow
Likes OmCheeto
Physics news on Phys.org
  • #2
You haven't mentioned approach path, i.e. how close it would come to Earth's centre if initial course were maintained. There's also the temperature, how this varies due to drag and radiation, and how it affects ablation rate.

For the velocity changes, you need to consider the net force and apply one of Newton's equations.
 
  • #3
haruspex said:
You haven't mentioned approach path, i.e. how close it would come to Earth's centre if initial course were maintained. There's also the temperature, how this varies due to drag and radiation, and how it affects ablation rate.

For the velocity changes, you need to consider the net force and apply one of Newton's equations.
I've never taken physics, this is the first real physics project I did, and for path, its just going straight down to Earth, and which newton's equation should I use, i'm sorry, I don't know these
 
  • #4
Amsalja said:
I've never taken physics, this is the first real physics project I did, and for path, its just going straight down to Earth, and which newton's equation should I use, i'm sorry, I don't know these
Net force = mass x acceleration.
Heading straight towards the centre of the Earth is rather unrealistic.
 
  • #5
haruspex said:
Heading straight towards the centre of the Earth is rather unrealistic.
Nah - Just a low probability... and an easier way to start for a first Physics project!

:welcome:
For ablation, what are two or three main things that you think can affect this? (hint: you have have already mentioned them in the Homework Statement)

For New Velocity, I agree with you; it doesn't seem at all right. Can you figure out a way to use the ablation rate, and then conservation of energy? (Google it) (That's probably not the simplest way, just the first thing that came to mind.)

Cheers,
Tom
 
  • #6
Tom.G said:
For ablation, what are two or three main things that you think can affect this? (hint: you have have already mentioned them in the Homework Statement)
I would think temperature (air and asteroid), friction, air density, velocity, asteroid material, as for the other things.

FYI, I don't know ablation rate, and I don't know the speed reduction rate to terminal velocity. All I need are the formulas for them then I can plug them into my script.
I'll look up and see if I can use ablation rate and conservation of energy to calculate the reduction of speed to terminal velocity
 
  • #7
Hi Amsalja,

:welcome:

What an interesting choice for a project! There are a few challenges there we can help you with, but first you say this is your "final project" but you have not studied physics so can I ask:
  1. Is this a final project in computer science or similar?
  2. This project is way above 7th grade level (I'd say its about 13th grade) but it's not unusual for home-schoolers to be working above their notional "grade". Compared to a mainstream schooler, what level of study are you at in this subject (computer science?), and also what level of study are you at in Mathematics and in Science?
  3. What similar projects have you done before? Have you done anything modelling motion (a car rolling down a slope for instance)?
  4. How will this project be programmed?
 
Last edited:
  • #8
Amsalja said:
All I need are the formulas for them then I can plug them into my script.
I'm afraid it doesn't really work like that: the processes affecting meteoroid break up are chaotic. See https://en.wikipedia.org/wiki/Chaos_theory for the implications.

Amsalja said:
I'll look up and see if I can use ablation rate and conservation of energy to calculate the reduction of speed to terminal velocity
It doesn't work like that either, forget about "terminal velocity", we need to calculate reduction of speed a different way.

I've got another post coming up with some useful information, please be patient.
 
  • #9
Amsalja said:
Homework Statement: I am homeschooled and my dad isn't a physicist so he said I can ask questions for this. I am in 7th grade so if you could explain it carefully it would be appreciated. I have searched everywhere, even ChatGPT and ChatGPT says go and find an expert.
Never, ever, use ChatGPT for an answer to a technical question; it is not designed to give correct answers to technical questions.

Amsalja said:
My asteroid's terminal velocity starts high, cause its in space (no air), so its going fast, but when it starts going into the atmosphere, it's terminal velocity becomes lower than its velocity. I need the equation for how much it slows down until it reaches its terminal velocity.
"Terminal velocity" is not going to help here, the rate at which the object slows down (we say "accelerates" even though it is slowing down) is determined by the forces on the object so we need to calculate those forces.

Amsalja said:
Also, I need the equation for ablation, like how much it breaks down or is burnt up whilst falling. I have the brittleness as a variable that the user can change.
Ablation is a really complicated process, I suggest you leave that for now and concentrate on calculating the motion of the object, then move on to how its temperature changes.

Amsalja said:
I know that there are a lot of things that changes and a lot of ifs and stuff, but I can do that if I know the equations. I can create variables for those.
As I mentioned in my previous post, it doesn't work like that for processes that are partly chaotic: if it did we we would have weather forecasts that are 100% reliable.

Amsalja said:
Gravity - static - Earth only gravity. (Plan user control in future)
Good, gravity creates a force which can be approximated by ## \frac{GMm}{r^2} ## where G is a constant, M is the mass of the Earth, m is the mass of the object and r is the distance from the centre of the Earth.

Amsalja said:
Drag Coefficient - static - the shape is predefined and stays (unrealistic, I know, but for ease)
Yes you will have to assume the drag coefficient is constant. I will use the symbol ## C_d ## for this.

Amsalja said:
Air Density - changes based on altitude (predefined from 'average' by altitude (earth))
We use the symbol ## \rho ## (read as "rho") for this. You will need to know how this varies with altitude.

Amsalja said:
Air Temperature - same as air density (based on altitude and known 'average')
Air temperature is more or less irrelevant here: the object is going to be heating up to thousands of degrees so a variation of less than 100 degrees is not going to matter - we can add it later if necessary.

Amsalja said:
Mass - predefined but changes as it is ablated. (Plan user control)
Volume - predefined but changes as it is ablated (Plan user control)
Cross Section Area - predefined but changes as it is ablated
Let's start out by having these fixed user inputs.

Amsalja said:
Shape - (Basic shapes - cube, sphere, etc) (Plan user control) (shape will not change once asteroid is launched)
The shape is taken into account in the drag coefficient so we can ignore it.

Amsalja said:
Altitude - starts at 80 km
You might want to make this a bit higher but that will do for now.

Amsalja said:
Time - obvious
Our model will work with small intervals of time which we usually call ## \Delta t ## read as "delta t".

Amsalja said:
Terminal Velocity - predefined but also changes dependent on air, mass, volume, etc
As mentioned above this is irrelevant.

Amsalja said:
Velocity - starts at 0 m/s. (But plan to allow user control)
Initial velocity (i.e. speed and direction) is the single biggest factor affecting the subsequent motion so you can't ignore it or assume it is headed directly for the centre of the Earth.

So you need two variables: speed and approach angle.

C - (asteroid structure as a constant value average between .1 - 1.0 (user controlled))

Amsalja said:
This is a program/simulation so it's changing 60 times per second.
You may only display the results 60x a second but you may need to do the calculation more often (i.e. make ## \Delta t < \frac 1{60} \text{s} ##

Amsalja said:
I have everything working except ablation over time and the asteroid slowing (at the correct amount of speed) to terminal velocity once it's within atmosphere.
How are you coding this? Can you link to this on GitHub or similar?
 
Last edited:
  • #10
You will also need the drag equation ## F_d =\frac12 \rho v^2 c_d A ##

You need to know how density varies with altitude. I suggest you use the International Standard Atmosphere model from which I have adapted the table below:

AltitudeDensityDensity lapse rate
## z ## (m)ρ (kg/m3)(kg/m3)/m
0Troposphere-6111.2985-8.03611E-05
1Tropopause11,0190.3639-3.05064E-05
2Stratosphere20,0630.088-6.18233E-06
3Stratosphere32,1620.0132-7.37424E-07
4Stratopause47,3500.002-4.92247E-07
5Mesosphere51,41300
6Mesosphere71,80200
7Mesopause86,00000
 
  • #11
My script:

#this is process, it is called every frame, so we need delta to divide it by fps; this allows me to regulate to the time movement / action / time if FPS changes

func process(delta): #Camera and Lights go down with your object (and object (position.y) begins falling here) (Initial velocity = 0 for now) position.y -= Velocity * delta $"../Camera3D".position.y -= Velocity * delta $"../DirectionalLight3D".position.y -= Velocity * delta #If i hit the ground, stop if position.y < 0: Velocity = 0 Altitude = "0" else: #I recheck the variables VariableRecheck() #if velocity is lower, go up, else go down if Velocity < TerminalVelocity: # pow() = to raise a variable / number to the power of #; here its basically doing seconds^2 Velocity += (Gravity * pow(Seconds, 2)) * delta else: Velocity -= (Gravity * pow(Seconds, 2)) * delta func VariableRecheck(): #Make a temp var var Snap if position.y > 10000: #Air densities only have like 1000: is blah, and 2000: blah, but when it reaches 20000, it only goes by tens #So I am making sure the air density changes appropriately based on altitude (this is brute force method) Snap = snapped(position.y, 10000) else: Snap = snapped(position.y, 1000) #so snap to the variables AirDensity = AirDensities[Snap] AirTemperature = AirTemperatures[Snap] #Change Cross Section Area and Volume because of ablation (this is only graphical change; so functional does nothing; when I change the graphics size, then crosssectoin and volume will change here; right now it is not changing at all since i'm not changing mesh sizes) CrossSectionArea = mesh.size.x * mesh.size.z Volume = mesh.size.x * mesh.size.z * mesh.size.y #Mass is Volume * 1600, the weight of stone in grams (I'll change this to player controlled later (within a range)) Mass = Volume * 1600 #Terminal Velocity Changes cause of ablation and air density TerminalVelocity = sqrt((2 * Mass * Gravity) / (AirDensity * CrossSectionArea * DragCoefficient)) #for ease, say km instead of 80000m if position.y > 1000: Altitude = str(round(position.y / 1000)) + "km" else: Altitude = str(round(position.y)) + "m"
 
  • #12
pbuk said:
You will also need the drag equation ## F_d =\frac12 \rho v^2 c_d A ##

You need to know how density varies with altitude. I suggest you use the International Standard Atmosphere model from which I have adapted the table below:

AltitudeDensityDensity lapse rate
## z ## (m)ρ (kg/m3)(kg/m3)/m
0Troposphere-6111.2985-8.03611E-05
1Tropopause11,0190.3639-3.05064E-05
2Stratosphere20,0630.088-6.18233E-06
3Stratosphere32,1620.0132-7.37424E-07
4Stratopause47,3500.002-4.92247E-07
5Mesosphere51,41300
6Mesosphere71,80200
7Mesopause86,00000
I have my own already:
https://www.engineeringtoolbox.com/standard-atmosphere-d_604.html
 
  • #13
Amsalja said:
My script:
You should post code blocks in CODE tags, not ICODE, like this (assuming it is Python, which it looks like):
Python:
func process(delta):
 
    #Camera and Lights go down with your object (and object (position.y) begins falling here) (Initial velocity = 0 for now)
    position.y -= Velocity * delta
    $"../Camera3D".position.y -= Velocity * delta
    $"../DirectionalLight3D".position.y -= Velocity * delta
   
    #If i hit the ground, stop
    if position.y < 0:
        Velocity = 0
        Altitude = "0"
    else:
       #I recheck the variables
        VariableRecheck()
        #if velocity is lower, go up, else go down
        if Velocity < TerminalVelocity:
             # pow() = to raise a variable / number to the power of #; here its basically doing seconds^2
            Velocity += (Gravity * pow(Seconds, 2)) * delta
        else:
            Velocity -= (Gravity * pow(Seconds, 2)) * delta

func VariableRecheck():
    #Make a temp var
    var Snap
    if position.y > 10000:
    #Air densities only have like 1000: is blah, and 2000: blah, but when it reaches 20000, it only goes by tens
    #So I am making sure the air density changes appropriately based on altitude (this is brute force method)
        Snap = snapped(position.y, 10000)
    else:
        Snap = snapped(position.y, 1000)
   
    #so snap to the variables
    AirDensity = AirDensities[Snap]
    AirTemperature = AirTemperatures[Snap]
   
    #Change Cross Section Area and Volume because of ablation (this is only graphical change; so functional does nothing; when I change the graphics size, then crosssectoin and volume will change here; right now it is not changing at all since i'm not changing mesh sizes)
    CrossSectionArea = mesh.size.x * mesh.size.z
    Volume = mesh.size.x * mesh.size.z * mesh.size.y
   
    #Mass is Volume * 1600, the weight of stone in grams (I'll change this to player controlled later (within a range))
    Mass = Volume * 1600

    #Terminal Velocity Changes cause of ablation and air density
    TerminalVelocity = sqrt((2 * Mass * Gravity) / (AirDensity * CrossSectionArea * DragCoefficient))
  
    #for ease, say km instead of 80000m
    if position.y > 1000:
        Altitude = str(round(position.y / 1000)) + "km"
    else:
        Altitude = str(round(position.y)) + "m"

What graphics module are you using, (I don't recognise syntax like $"../Camera3D".position.y -= Velocity * delta?
 
  • #14
It is the Godot Engine $"../blah" is my tree. so my camera3d's y position goes down
 
  • #15
Amsalja said:
It is the Godot Engine $"../blah" is my tree. so my camera3d's y position goes down
Ah, OK, so this is GDScript. It's close enough to Python for PhysicsForums syntax highlighter to do a good job.

Is this the first time you have modelled anything with "proper" physics? I think you should be using https://docs.godotengine.org/en/stable/tutorials/physics/kinematic_character_2d.html#physics-process rather than process, have you learned how to do that, and update position and velocity values according to calculated forces? The classic tutorial project for this is a "lunar lander" game, have you done something like that?

Once you have the code for a 2-d lunar lander working (i.e. moving sideways as well as vertically) we can help you add the effects of atmosphere to the physics.
 
  • #16
Thank you for everything.
I have to go to bed. See you tomorrow.
 
  • Like
Likes jim mcnamara and berkeman
  • #17
pbuk said:
Once you have the code for a 2-d lunar lander working (i.e. moving sideways as well as vertically) we can help you add the effects of atmosphere to the physics.
I have all of that. All I need is ablation and accelerating to terminal velocity (minus the engine. I already made another game with asteroids like control (up for thrust, turn left and right for rotation). I don't need any of that in this project. There is no control (aside from choosing initial factors for the asteroid / planet / etc). I have the asteroid falling and the terminal velocity equation, the air density depending on altitude and all of it affecting the speed of the asteroid as it falls. All I need are the equations for ablation and accelerating to terminal velocity. It's already done. (Except for what I wrote before).

Also, how do I use the drag equation. Do I go down by velocity - drag? Or is my velocity increasing by Gravity * Seconds^2 - drag.
 
  • #18
That's not a very good attitude: you remind me of a drowning man flapping his arms shouting "teach me to swim" and ignoring someone telling him that the water is only 3 feet deep and he can stand up.

But considering your age and that you are new here I'm going to give you another chance.

In your "asteroids" program did you have some code like this?
GDScript:
# Calculate acceleration.
if engineIsOn:
  acceleration.x = ...
  acceleration.y = ...
else
  acceleration.x = 0
  acceleration.y = 0

# Update velocity.
velocity.x += acceleration.x * deltaT
velocity.y += acceleration.y * deltaT

# Update position.
position.x += velocity.x * deltaT
velocity.y += velocity.y * deltaT

The code you need now is similar, except the calculation of acceleration is more complicated, and we also need to calculate changes in mass and temperature. I can help you with all of this, but I need you to show me that you are doing the work (this is a PhysicsForums rule, and besides if I do everything for you how will you learn anything?)

First though you need to understand why we your idea of starting with zero initial velocity and falling straight down is not going to work. Real meteoroids hit the atmosphere at between 10 and 40 kilometers per second, that's why they burn up. We have examples of people starting from 40 km up with zero velocity (relative to the surface of the Earth) https://en.wikipedia.org/wiki/Space_diving.

Now for direction, for an incoming meteoroid to be aiming at the centre of the Earth means that it must match very closely 6 different parameters simultaneously (position and velocity, each in 3 dimensions). There is basically 0 chance of this happening, and if it did then the outcome would be very different (you can try to use your model to see this although with deltaT = 1/60 s and simple step calculations it won't be very accurate).

Anyway, let's make a start:

GDScript:
# Update temperature.
temperatureRate = 0 # We will change this later.
temperature += temperatureRate * deltaT

# Update mass.
massRate = 0 # We will change this later.
mass += massRate * deltaT

# Calculate acceleration due to gravity.
acceleration.x = 0
acceleration.y = ... # Can you do this?

# Add acceleration due to drag.
speedSquared = ... # Do you know Pythagoras theorem?
dragForce = 0.5 * rho * speedSquared * dragCoefficient * area

## Calculate angle of approach.
theta = ... # Do you know any trigonometry?

acceleration.x -= dragForce * (something involving theta) / mass
acceleration.y -= dragForce * (something else involving theta) / mass

# Update velocity.
velocity.x += acceleration.x * deltaT
velocity.y += acceleration.y * deltaT

# Update position.
position.x += velocity.x * deltaT
velocity.y += velocity.y * deltaT
 
  • #19
pbuk said:
That's not a very good attitude: you remind me of a drowning man flapping his arms shouting "teach me to swim" and ignoring someone telling him that the water is only 3 feet deep and he can stand up.
I apologize. I didn't know I had a poor attitude? I wasn't ... being rude or attempting to. I just... don't need to make a lunar lander game as I already have the program for all of that, and the asteroids clone (i understand how to change velocity and I use vectors, not each .x and .y) taught me velocity change using vectors (although that is still basic and confusing to me as well). It's quite easy to do. I also have the gravity. I have tried to add in atmosphere and terminal velocity, but I just don't understand or know the formulas to do so. All the formulas I have found are because I searched the internet and was able to add them to my code.

I've never studied trigonometry. I've never studied physics. I've never studied calculus or even geometry, either. My math level is basic algebra. I didn't even know what ablation was until I read a website that used that word. I don't know any of the formulas or the variables in the formulas as well. I had to look them up, understand them, then code them into my simulator (a very poor one, I know).

I just know how to code and do 3d graphics pretty well. Math... is hard for me, although I've finished 7th grade math but ... the hints about how to add theta (what is theta? I didn't know until i looked it up? Google said its an angle. Is that right?) don't help because I've never even heard them before. I'm still in junior high. I don't even know what trigonometry is either... I looked it up... its a kind of math, but I don't know it or what it's used for.

But, i'm using vectors and my current vector is (0,1) (just 2d for now, but can easily change to 3d etc since all i am doing now is affecting ONLY Y (up / down axis) so then would I be able to just use that to give my velocity using that as a percentage to divide my velocity between the vectors? So, if I want a path perpendicular to gravity, I would just do (1, 0) or (-1, 0)

So then to add dragforce now...
velocity += ((Gravity * seconds^2) - dragforce / mass) * delta

I only need theta if I'm going to have the asteroid have an initial velocity in any direction but directly at earth's center.

But if I want to add angles, then it would be...

velocity (vec3) += (gravity * seconds ^2) - (dragforce * vectorangleofspeed (vec3)) / mass) * delta

vectorangleofspeed would = (?, ?, ?) where ? is between -1 ~ 1 and the absolute value of the total added together = 1
and then dragforce would be divided up into the various vectors (x, y, z) be the vectorangle.

the initial values would be chosen by the user, but how would changes be done to vectorangleofspeed now? Gravity would add speed on the Y axis only, not the X and Z while drag would really ONLY affect X and Z (until terminal velocity?) Right? Do i then need to reevaluate the vectorangleofspeed each time by adding total speed (on x and z) with new speed on y (due to gravity acceleration) find their new percentages in relation to one another then apply them to vectorangleofspeed.x .y, and .z?

Also, why do you need to divide everything by mass?
 
  • #20
Wow, that's a lot to take in. I'll tackle it in parts in no particular order.

Amsalja said:
Also, why do you need to divide everything by mass?
Because the most important equation in mechanics is ## \mathbf F = m \mathbf a ##: force is equal to mass times acceleration: this means that acceleration is equal to force divided by mass (note that force and acceleration are vectors here).

Amsalja said:
I apologize. I didn't know I had a poor attitude? I wasn't ... being rude or attempting to. I just... don't need to make a lunar lander game as I already have the program for all of that, and the asteroids clone (i understand how to change velocity and I use vectors, not each .x and .y) taught me velocity change using vectors (although that is still basic and confusing to me as well). It's quite easy to do. I also have the gravity.
The reason I want you to show your code for e.g. a lunar lander or asteroids is so that I can show you how to modify it for atmospheric drag. Surely it still has some calculations using .x and .y like this code in the example at https://github.com/godotengine/godo...master/3d/kinematic_character/player/cubio.gd

Amsalja said:
I have tried to add in atmosphere and terminal velocity, but I just don't understand or know the formulas to do so. All the formulas I have found are because I searched the internet and was able to add them to my code.
Please stop talking about "terminal velocity", it is useless here: meteoroids travel much faster than terminal velocity, that's why they burn up or hit the ground before they have slowed to terminal velocity. Just don't mention it again. Forget it. Please :smile:

Amsalja said:
I've never studied trigonometry. I've never studied physics. I've never studied calculus or even geometry, either. My math level is basic algebra.
Then you need to understand that this project is aiming pretty high, and you need to trust me when I tell you what you need to concentrate on and what you need to forget about. For now we need to get the basic equations for an object falling with drag in 2 or 3 dimensions, and to do this we need to concentrate on gravity and drag.

Amsalja said:
I just know how to code and do 3d graphics pretty well. Math... is hard for me, although I've finished 7th grade math but ... the hints about how to add theta (what is theta? I didn't know until i looked it up? Google said its an angle. Is that right?) don't help because I've never even heard them before. I'm still in junior high. I don't even know what trigonometry is either... I looked it up... its a kind of math, but I don't know it or what it's used for.
You can't do any physics, even game physics, without trigonometry. But that's OK, I'll help you with the trigonometry. Are we settled on using Vector3s i.e. 3D graphics?
 
  • #21
Then is this right? If i'm understanding it right?

Code:
Dragforce.y = 0.5 * AirDensity * pow(Velocity.y, 2) * DragCoefficient * CrossSectionArea
Dragforce.x = 0.5 * AirDensity * pow(Velocity.x, 2) * DragCoefficient * CrossSectionArea
Dragforce.z = 0.5 * AirDensity * pow(Velocity.z, 2) * DragCoefficient * CrossSectionArea

Acceleration.y = (Gravity * pow(Seconds, 2) - DragForce) / Mass
Acceleration.x = (Gravity * pow(Seconds, 2) - DragForce) / Mass
Acceleration.z = (Gravity * pow(Seconds, 2) - DragForce) / Mass

Velocity.y += Acceleration.y * delta
velocity.x += acceleration.x * delta
velocity.z += acceleration.z * delta

pbuk said:
Then you need to understand that this project is aiming pretty high, and you need to trust me when I tell you what you need to concentrate on and what you need to forget about. For now we need to get the basic equations for an object falling with drag in 2 or 3 dimensions, and to do this we need to concentrate on gravity and drag.
Yes, I know its hard. I got halfway through and I was like, this is easy, until I got to the equations and ablation, then I was like, well, I got this far, let's just try to finish this. I understand I'll have to trust you. I had to trust all the websites too. I just don't understand how it works. I know how to stick equations into the code, but I don't know what how it works

pbuk said:
Are we settled on using Vector3s i.e. 3D graphics?
Yes, 3D is basically the same as 2D, only one more axis, Godot makes it very easy to do both.
 
  • #22
Amsalja said:
Then is this right? If i'm understanding it right?

That's close, but you need a bit more understanding of vectors to get it right. The code below should work (I've never used the Godot engine though so it might not!) - see how vectors make things really concise (e.g. you don't have to update the (x, y, z) components of Velocity and Position individually).

GDScript:
# Aerodynamic drag depends on speed squared...
speedSquared = Velocity.length_squared()
dragForceMagnitude = 0.5 * airDensity * speedSquared * dragCoefficient * crossSectionArea
# ...and acts in the opposite direction to the velocity so we create a vector,
# remembering to scale Velocity to a unit vector.
speed = sqrt(speedSquared)
DragForce = -dragForceMagnitude * Velocity / speed

# Calculate the acceleration vector, starting with drag scaled by 1 / mass.
Acceleration = DragForce / mass
# Add gravity acting only downwards.
Acceleration.y = -gravity

# Now we can update the velocity and position vectors.
Velocity += Acceleration * delta
Position += Velocity * delta

A channel called 3Blue1Brown does some excellent video tutorials and you can learn some more about vectors at https://www.3blue1brown.com/topics/linear-algebra.
 
Last edited:
  • #23
pbuk said:
Code:
# Add gravity acting only downwards.
Acceleration.y = -gravity
isn't acceleration.y = (DragForce / mass) - (gravity * time^2)

because another source said normal gravitational acceleration = (gravity * time^2) - DragForce?
 
  • #24
Amsalja said:
isn't acceleration.y = (DragForce / mass) - (gravity * time^2)

because another source said normal gravitational acceleration = (gravity * time^2) - DragForce?
No, that would not make sense: gravity does not depend on time. Consider an aeroplane in flight; the effect of gravity in a minute's time will be exactly the same as it is now.
 
Last edited:
  • #25
It seems to me that your project is far too ambitious. If I were you I'd discuss it with my teacher. He/she can give you something you can realistically do.
 
  • Like
Likes erobz
  • #26
Hornbein said:
It seems to me that your project is far too ambitious. If I were you I'd discuss it with my teacher. He/she can give you something you can realistically do.
I know, but I chose this, and I'm already halfway through. That's the reason why I'm still going. If at the beginning I knew this was what I had to do, I wouldn't have done this. But I didn't, and got halfway through.
pbuk said:
No, that would not make sense: gravity does not depend on time.
Oops, you're right, it doesn't matter on time. That source was wrong. I looked up on DK, and they said you were right, it is 9.8 on the first, 19.6 on the second etc.

Also, if an asteroid started at 20,000km, and started falling at 10km/h, and if it was a 1 cubic meter, and it didn't melt at all, would it slow down to around 300m/h at the end? Like, is that the average (Mass = 1600/m^3)
It's just cause, I don't know what would happen. If this is close, than yay, finally, but if it isn't, then something's wrong.
 
  • #27
Amsalja said:
I know, but I chose this, and I'm already halfway through. That's the reason why I'm still going. If at the beginning I knew this was what I had to do, I wouldn't have done this. But I didn't, and got halfway through.
Well good for you. I realized much too late that anyone who makes it in math doesn't rely on teachers. They study the stuff themselves from a young age and develop their skills. It's like being a concert pianist. If you haven't got much of your skill by age of 14 then it's too late.
 
  • #28
Amsalja said:
Oops, you're right, it doesn't matter on time. That source was wrong. I looked up on DK, and they said you were right, it is 9.8 on the first, 19.6 on the second etc.
Is DK Dorling Kindersly? That's a reasonable source: other good places to learn about meteoroids are NASA and National Geographic.

Amsalja said:
Also, if an asteroid started at 20,000km, and started falling at 10km/h, and if it was a 1 cubic meter, and it didn't melt at all, would it slow down to around 300m/h at the end?
This simulation you are working on will be able to work this out! But you do need to be careful with units: remember meteoroids hit the atmosphere at between 10 and 70 km/s, not km/h, and a speed of 300 m/h is 300 metres per hour, which is hardly moving at all. Perhaps you meant 300 m/s (which is about the speed of sound) or 300 mi/h (miles per hour), which is a reasonable impact speed for a small meteorite (smaller than a cubic metre though).

Amsalja said:
It's just cause, I don't know what would happen.
Program it in and run it!
 
  • #29
I programmed it and ran it and your right, it is m/s and km/s (Sorry for the typo) And is that the average? If it is then all I need is the ablation. The ablation will have the chaos factor, and I'll just put in a slider or something.

Another thing, is drag is able to go below terminal velocity and I know that you said not to talk about terminal velocity, but, if I start my velocity at my terminal velocity, then I fall in, the velocity goes below it's terminal velocity due to drag, so does that mean my drag is wrong?
 
Last edited:
  • #30
I'd just like to take moment to tip my hat to the OP for rising to the task of such an ambitious project at their age! You will go far.

In Grade 7, I think my science project might have been a model of a birch bark canoe!
 
  • #31
Amsalja said:
And is that the average?
Average what? The physics model calculates the instantaneous speed at each point in time.
Amsalja said:
If it is then all I need is the ablation.
That's easy to say, but meteoroid ablation is a really complicated subject that is not fully understood. Even a basic study in this area would be at the level of a final year project for an undergraduate. Also, most of the relevant texts are not freely available on the internet: you would need access to a university library for this.

Having said that, this paper quotes an equation for the ablation rate (quoted from V. A. Bronshten, Physics of Meteoric Phenomena, Reidel Publishing Co., Dordrecht, Netherlands, 1983)
$$ \frac{dm}{dt} = -\sigma K \rho_{air} m^{2/3} v^3 $$
where σ and K are constants. The paper also provides some values for σ between = 0.035 and 0.081 s2km-2, and another expression that after a bit of work gives ## Km^{2/3} = \frac 1 2 C_D A ##, so the equation above becomes
$$ \frac{dm}{dt} = - \frac 1 2 \sigma C_D A \rho_{air} v^3 = \sigma F_D v $$
I'm not sure this makes sense, but taking it at face value and coding it we have:

GDScript:
# sigma is an input parameter in the range 0.035 - 0.081 s^2 km^{-2}
# so we need to convert to s^2 m^{-2}
convertedSigma = sigma / 1000000
# From the calculations at
# https://www.physicsforums.com/threads/7th-grade-asteroid-simulator.1053384/post-6908342
# we can update mass
mass -= convertedSigma * dragForceMagnitude * speed * delta

Amsalja said:
Another thing, is drag is able to go below terminal velocity and I know that you said not to talk about terminal velocity, but, if I start my velocity at my terminal velocity, then I fall in, the velocity goes below it's terminal velocity due to drag, so does that mean my drag is wrong?
Yes there was an error in the code I posted: the calculation of the amount of deceleration due to drag was correct, but when converting this to a vector to get it in the right direction I forgot to use a unit vector. The correction is below, I have amended this in the post above:
GDScript:
# Aerodynamic drag depends on speed squared...
speedSquared = Velocity.length_squared()
dragForceMagnitude = 0.5 * airDensity * speedSquared * dragCoefficient * crossSectionArea
# ...and acts in the opposite direction to the velocity so we create a vector,
# remembering to scale Velocity to a unit vector.
speed = sqrt(speedSquared)
DragForce = -dragForceMagnitude * Velocity / speed
[/QUOTE]
 
Last edited:
  • #32
What is Velocity.length_squared? Is it the length axis, or is it something else.
 
  • #33

1. What is the definition of velocity.length_squared?

Velocity.length_squared is a mathematical formula that calculates the squared length of a velocity vector. It is often used in physics and engineering to determine the total distance traveled by an object in a given time.

2. How is velocity.length_squared different from velocity.length?

Velocity.length_squared is the squared value of the length of a velocity vector, while velocity.length is the actual length of the vector. The squared value is often used in calculations and equations, while the actual length is used for measurement purposes.

3. Why is velocity.length_squared important in physics?

Velocity.length_squared is important in physics because it allows us to calculate the total distance traveled by an object without having to know the direction of the velocity. It is also used in many equations to determine the acceleration, force, and energy of an object.

4. How is velocity.length_squared calculated?

Velocity.length_squared is calculated by multiplying the x-coordinate of the velocity vector by itself, adding it to the square of the y-coordinate, and then adding that to the square of the z-coordinate. This gives us the squared length of the velocity vector.

5. Can velocity.length_squared ever be negative?

No, velocity.length_squared can never be negative. This is because it is calculated by squaring the individual components of the velocity vector, which will always result in a positive value. Negative values can only occur if the direction of the velocity changes, which would then result in a different vector altogether.

Similar threads

  • Introductory Physics Homework Help
Replies
3
Views
639
  • Introductory Physics Homework Help
Replies
3
Views
249
  • Introductory Physics Homework Help
Replies
21
Views
183
  • Introductory Physics Homework Help
Replies
16
Views
666
  • Introductory Physics Homework Help
Replies
5
Views
2K
Replies
23
Views
478
  • Introductory Physics Homework Help
Replies
19
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
894
  • Introductory Physics Homework Help
Replies
2
Views
820
Back
Top