Browse Search Popular Register Upload Rules User list Login:
Search:
I need some Help!

Image:
screenshot of the scene

Author: Scientific Accuracy

Group: Default

Filesize: 1.65 MB

Date added: 2016-02-05

Rating: 5

Downloads: 1302

Views: 561

Comments: 14

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

Dear (advanced) Algodoo Community,

I need some help in scripting:

Is it possible to simulate an body-bound (earth-bound) atmosphere due to air friction, that thins out smooth and continuously with the increasing distance to the planet??

And If some of you know a way to do that, would you be so kind to show me how to script it?

I thank you ahead!:)
Please log in to rate this scene
edit
Responses to this scene
show list
Title: Free-fall
Rating: 5
Filesize: 65.96 kB
Downloads: 160
Comments: 0
Ratings: 1
Date added: 2016/02/13 22:31:45
Made with: Algodoo v2.1.0
Rating: rated 5
download
There is a way, but I'm not sure how exactly to play around with the variables.

Basically, what you have to keep in mind is, the highter the velocity and the size, the larger the air friction. Then there are some crazy equations that work with orientation and form of the body, but for a general "air friction", you can for example divide the velocity of something by a set value, like 1.0008, every frame(poststep). I am not sure how the exact equations are like, but I can tell you that it bases on steadily slowing the velocity by taking a part of it every frame. If its a standart division, or some sort of square root, I don't know right now, but it's an idea.
Could you try to realize an example and let me know when you succeeded and tell me if/how it exactly works then?? =)

I would be very thankful!
oh an idea (but i really have no idea too realize such a script):

perhaps you could use the air-friction-multiplier and program it on that way, that the multiplicator raises continously per lowering the distance to the planet/object.

Could this be also be doable?
Yeah, you could do that. All you need to do then is use standart air friction, maybe with a highter force, but that could do it.
Asked again: could you create an example, please? ^^
1. Find the equation for air density as a function of altitude from the equations found here.
2. Divide the equation by (air density at sea level) to get the equation for airFrictionMultiplier as a function of altitude.
3. Set scene.my.earthPos = earth's position.
4. Set airFrictionMultiplier for the object of interest to be equal to (math.vec.dist(pos,scene.my.earthPos) - earthRadius)*(function determined from step 2).
Thank you very much s_noonan but the link does not work for me! =(

Could you please write the link as a whole here in the comments?
http://en.wikipedia.org/wiki/Density_of_air#Altitude
If earth positioned at origin then
scene.my.earthPos = [0,0];

in postStep code of object of interest:
h := (math.vec.dist(pos,scene.my.earthPos) - 6.371E6);
h > 20.0E3 ? {airFrictionMultiplier = 0.0}:{};
h < 0.0 ? {airFrictionMultiplier = 1.0}:{};
(h > 0.0) && (h < 20.0E3) ? {airFrictionMultiplier = -4.333E-14*h^3+3.311E-9*h^2-0.9498E-4*h+0.999}:{};­

translation:
The altitude of the object equals the distance between the [center of the object and the center of the earth] minus earth's radius.
If the object is above the troposphere then there is no friction.
If the object is lower than the earth's surface then set airFrictionMultiplier=1.0.
If the object is in the troposphere then set the airFrictionMultiplier equal to the [equation for air density as a function of altitude]/[density at zero altitude].

Note: The troposphere is only about 0.3% of the earth's radius.
Last edited at 2016/02/07 01:53:04 by s_noonan
I thank you very much, again @ s_noonan ! =)

I will try my best to implement that!
You appear to have figured it out. Now. i demand a realistic solarsystem with atmosphere physics

Lol
okay @ MoBuilds & s_noonan

I dont want to lie - I am an absolute loser in scripting - even if you tell me what to to - it is too much to understand, I hate to memorize all of the commands and also the principle of: "tiny mistake = everything goes wrong/nothing works". Could anyone implement the script-formula suggested by s_noonan, please? =D
It's not that hard, you put that on the postStep of the object you want to be influenced by air
I'm not going to do any more work on this since the troposphere is so small compared to the size of the earth. You could make a scene that contains all troposphere, in which case:

in postStep code of object of interest:
h := pos(1);
h > 20.0E3 ? {airFrictionMult = 0.0}:{};
h < 0.0 ? {airFrictionMult = 1.0}:{};
(h > 0.0) && (h < 20.0E3) ? {airFrictionMult = -4.333E-14*h^3+3.311E-9*h^2-0.9498E-4*h+0.999}:{};­­

P.S. I changed my mind, I will respond to this scene.
Last edited at 2016/02/13 22:29:45 by s_noonan