A specific setup problem

A place to discuss everything related to Newton Dynamics.

Moderators: Sascha Willems, walaber

Re: A specific setup problem

Postby misho » Tue Jan 03, 2017 2:54 pm

Julio Jerez wrote:for example say the you put a coin on a turn table, the coin will not experience any Coriolis forces because the coin is not moving in the turn table, it is only when the coin gain velocity that its espericence these side Coriolis force.


Yeah, I was pulling my hear about that... I understand coriolis effect fairly well, and I was wondering why your formula is producing it even though I am in a perfect orbit. There should be no coriolis effect if I am not moving radially. There IS a radial movement in the case of elliptical orbits, which are not, of course, perfect circular orbits. There IS a coriolis-related effect for perfect orbits called Eötvös effect, which is described fairly well on the Wiki Coriolis page https://en.wikipedia.org/wiki/Coriolis_force and it has almost an identical case to what I was illustrating with my rocket launch east and west (except it has a train in their case).

Also - my orbital speed calculations are accurate and fairly robust. There are a few on-line orbital speed calculators that give values very close to mine, and I think a small discrepancies are due to the varying precision of G, M and earth radius. Those on line calculators also differ amongst themselves, but differences are only within a tenth of a percent.

Looking at your formula closely, I was going to implement it as such:

Code: Select all
dVector vCoriolisVelVector = vVelocityVector - EarthOmega*vPosition;
dVector coriolisAccel = (EarthOmega*vCoriolisVelVector).Scale(-2.0f);


but that won't work either. What do you mean by shipLinearVelocity? Any radial movement by ship? I'm not sure how to get that. All I have is a velocity vector (vVelocityVector) and that's probably not what you had in mind when you said that this component will be zero for perfect orbit (because it won't be).
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: A specific setup problem

Postby Julio Jerez » Tue Jan 03, 2017 6:49 pm

Ok, there is a great confusion, I will explain in detail once again.

let us say you are going to simulate an object standing on the surface of the earth. let us also say the object is a person and is represented by a newton body.

If we were going to use the surface as the inertial frame of reference. the when that person is not moving its velocity is zero, the this is the value you will always read from the newton body. This is how most simulation works in newton.

In your case the surface itself is a rotating frame of reference with the center at the origin of the planet. because of this you need to pick an inertial fame of reference different than the surface.
You selected the center of the planet.

In this case for the same person who is standing on the earth surface, that person will believe he or she is not moving but to an observer outsize the frame of reference, the person will be moving with a velocity.
Code: Select all
crossProduct (OmegaEarth, PositionReltiveToErathCenter)

the moment that person start to walk he will will have a local velocity VelocLocal.
now for an observer outside the frame the person velocity will be:
Code: Select all
Veloc = VelocLocal + crossProduct (OmegaEarth, PositionReltiveToErathCenter)

this is the velocity that you will read from the NewtonBody.

Now when the person moves, he will experience three accelerations
Code: Select all
1-Gravity = -G * M / R^2  aligned with the axis to the center
2-Centripetal = -CrossProduct (OmegaEarth, CrossProduct (OmegaEarth, PositionRelativeToErathCenter)) aligned with the axis to the center.
3-Coriolist = -2 * CrossProduct (OmegaEarth, VelocLocal) perperdicular to the direction of motion an the angular OmegaEarth   


of these three forces Corioslis is the only one the is not aligned to the earth axis and is also very weak because in general VelocLocal is very small to be significant.

Coriolis force are experienced by an object that does not move fast enough so that CrossProduct (OmegaEarth, VelocLocal) is not negligible, for example a long distance sharp shooter has calibrator to compensate for that, an airplane, a very fast race car is on the verge of feeling the effect but he does not because the tire frictions. My favorite example is tornadoes and vortexes.
when you have a low pressure center, the particles of air an water vapor all acquire a fast an ever increasing velocity to the center of low pressure.
Because there is a point at which the product of this velocity and the Earth angular velocity is high enough the particles generate a side velocity fast enough to generate a centripetal acceleration that zero out the Coriolis acceleration and this is what makes the vortex.
if is was not for friction, it will last for eternity like in Jupiter.
anyway I in your case. when you read the velocity from the newton body.

you need to subtract the earth component to get the local velocity of that body.
when a body is in a geo sync orbit that local velocity should be zero.
Is this more clear now?

if not them I will write a demo in the sandbox to show how to write the callback, I always wanted to have a tornado force demo, so I guess this is a good time as any.
plus now that we have particle collision shapes, I can make a good case for a particle based tornado demos.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A specific setup problem

Postby misho » Tue Jan 03, 2017 10:36 pm

Whew - ok, we'll get there ! :mrgreen: I do understand what is going on, but I think I might have skipped something you assumed I've been doing, namely:

In order for this equation to work:

Code: Select all
Veloc = VelocLocal + crossProduct (OmegaEarth, PositionReltiveToErathCenter)


it should already have crossProduct (OmegaEarth, PositionReltiveToErathCenter) in it - but it does not. That is, I did NOT give newton body initial earth rotation, only orbital velocity.

When I create a Newton body, I choose the orbit altitude and body Lat/Long position on earth (which I convert to x,y,z), and calculate a velocity vector dVelocity needed for a stable orbit.
Then, I give a body that velocity vector:
Code: Select all
NewtonBodySetVelocity(nBody, &velocity[0]);


The body then happily spins in a stable orbit. As you mentioned, this would be true if the frame of reference was Earth surface, but it is not, so I need to add an earth rotation velocity vector in this initial creation stage: (and I have NOT been doing that)

Code: Select all
dVector EarthVelocity = cross(EarthOmega, position);
NewtonBodySetVelocity(nBody, &(dVelocity + EarthVelocity));


So, what I am asking is, do I need to give the body initial Earth rotation when it is created? Is that correct?

Assuming it is, in my ApplyForceAndTorqueCallback, you stipulated that I can get LocalVelocity by subtracting cross(EarthOmega, position); from body velocity, and indeed, if I left the body in a stable orbit, this should give me zero local velocity, as it was when I created the body. If I'm still not on the right track, then yes, I think a vortex/tornado example, and the way this should be implemented in the callback would be of GREAT help :oops:

Incidentally, when reading up on coriolis effects, I read that, contrary to what people believe, earth-rotation coriolis force is NOT responsible for the direction of the water draining in the sink, and very little role in the direction of tornadoes and dust devils. Large systems, like hurricanes, pressure cells and sea currents are, on the other hand, greatly affected by earth-spin coriolis effect.
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: A specific setup problem

Postby Julio Jerez » Wed Jan 04, 2017 1:14 am

Code: Select all
dVector EarthVelocity = cross(EarthOmega, position);
NewtonBodySetVelocity(nBody, &(dVelocity + EarthVelocity));

So, what I am asking is, do I need to give the body initial Earth rotation when it is created? Is that correct? .. If I'm still not on the right track, then yes,
...
I think a vortex/tornado example, and the way this should be implemented in the callback would be of GREAT help :oops:

yes you can do that to initialize your object, in fact you has to do that for all object that you place in your simulation. is no different that when you throw a rock from a moving vehicle it inherit the vehicle velocity. you need to
Code: Select all
dVector EarthVelocity = dVelocity + cross(EarthOmega, position);
NewtonBodySetVelocity(nBody, &EarthVelocity);


them your vehicles will start with the desired velocity.
in you call back to the velocity you use for Coriolis and centripetal you do
Code: Select all
NetwonVodyGetVelic (body, &absoluteVeloc);
localVelocity = absoluteVeloc  - cross(EarthOmega, position);

and you calculate you total force acting on your body. all the pervious test apply.


misho wrote:Incidentally, when reading up on Coriolis effects, I read that, contrary to what people believe, earth-rotation Coriolis force is NOT responsible for the direction of the water draining in the sink, and very little role in the direction of tornadoes and dust devils. Large systems, like hurricanes, pressure cells and sea currents are, on the other hand, greatly affected by earth-spin Coriolis effect.


yes, an those people would be wrong, a lot of self appointed expert love to talk out of their asses. Saying that is the equivalent to deny that gravity and the moon generate the tides
https://www.youtube.com/watch?v=XyjGySFCU9c&t=48s

people do not believe the CO2 is warming the planet, people believe vaccines cause Autism, people believe 9/11 was an inside job, people believe the planet is 6000 years old, hey there are people with convincing proof that the earth is flat.
I do not lose any sleep over that, but let us assume they are right and is not the angular velocity of the medium that generate the effect, they are going against calculus of variation and further more is not enough to be a denier they need to make a positive solution, how do they explain that 100% of the time all vortexes spin the same direction in one hemisphere and opposite in the other?

The Coriolis effect is a fact, we all feel it when we move on the surface of a spinning body and it comes out naturally from the Lagragian derivation of the equation of motion.
here is one way it can be demonstrated, take a dump on a toilet spinning on a Mary go round and them take another dump on the same Mary go round but spinning on the opposite direction.
See if is the water spins in different directions when you flush it.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A specific setup problem

Postby Julio Jerez » Wed Jan 04, 2017 1:21 am

I see if I cam make the tornado particle demo this weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A specific setup problem

Postby misho » Wed Jan 04, 2017 2:44 am

LOL I am the last person on earth to subscribe to conspiracy theory, and of course Coriolis force is a fact - all I was mentioning was what I read on the Wiki Coriolis link that you provided https://en.wikipedia.org/wiki/Coriolis_force.

Perfect, thanks, I'll look forward to the tornado demo, and in the mean time I'll adjust my code and see if I can get it going.

Thanks!
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: A specific setup problem

Postby Sweenie » Wed Jan 04, 2017 3:17 am

here is one way it can be demonstrated, take a dump on a toilet spinning on a Mary go round and them take another dump on the same Mary go round but spinning on the opposite direction.
See if is the water spins in different directions.


The law might disagree with that experiment so I suggest using a plastic bucket with a hole in the bottom instead, and no dumping. :lol:
Sweenie
 
Posts: 498
Joined: Mon Jan 24, 2005 7:59 am
Location: Sweden

Re: A specific setup problem

Postby misho » Fri Jan 06, 2017 7:45 pm

Hi Julio,

I'm hoping you'll have time to put together a Tornado example this weekend :mrgreen:

Along the same lines, if you remember, a while ago we also spoke about implementing a method for applying a force to a body on a point other than its centre of gravity, something similar to a method already in Newton Dynamics:

Code: Select all
void NewtonBodyAddImpulse( const NewtonBody* bodyPtr, const dFloat* pointDeltaVeloc, const dFloat* pointPosit)


This function forces a point on a body to achieve the specified instantaneous velocity. pointDeltaVeloc is the desired increase in velocity at point pointPosit.

Any chance you can take a look into implementing this as well?

thanks,
Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: A specific setup problem

Postby Julio Jerez » Sat Jan 07, 2017 9:33 pm

I am posting form an old laptop.
I went to the store and bought gForce 1060 that support direct12 and opengl 4.5 to get ready for the gpu stuff.

after I plug int in my system went dead. I reverse the card again and the system was still dead.
Arter try few time without success. I took to fry's so that figure out was is wrong.
I am without pc for the weekend.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A specific setup problem

Postby misho » Sat Jan 07, 2017 10:51 pm

Yikes!!! This stuff scares me! I am on a lowly Win7 with on-board AMD Radeon HD 8570D, and I dread upgrading!

Sorry to hear that, no hurry, hope you sort it out!

Misho
Misho Katulic
CTO, FSX SpacePort
TerraBuilder
www.terrabuilder.com
misho
 
Posts: 673
Joined: Tue May 04, 2010 10:13 am

Re: A specific setup problem

Postby JoeJ » Sun Jan 08, 2017 3:16 am

I've had the case after upgrading to 1070 the system did not made it past BIOS, but after BIOS update it worked.

edit: Remembering better now, the system had a black screen, so no bios appeared, seemed broken.
I removed the 1070 and used the CPU built in graphics to do the update.

But i guess you already tried booting with old GPU so this won't help :?
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: A specific setup problem

Postby Julio Jerez » Sun Jan 08, 2017 11:03 am

while I am doing nothing I have need ready about openGL 4.5 and Vulkan.e a dumplak for hi on the API. according to them an application will get zero gpu benefit from vulkan. in a nutshell they only credict Vulkan with better cpu driver controll because multithread better that tradional gl drivers.

if you read an AMD paper then vulkan is teh grated gift God gave to human kind.

what I find atractive about vulkan is that does not required rendering, so in that regard it is in fact the replacement of CUDA, (whic i think is the reason nvidia poop poop it)
I wonder if in can coexist with other api, by this I mean using Vulkan for generic high performance computing and the get data for rendering with direct x 12, open gl or vulkan.

I am assuming that rendering in Vulkan lot of stuff can be in GPU an dteh CPU serve as the controller.

I am gathering info for next Newton 3.15 or maybe which will be GpuNewton 4.00
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A specific setup problem

Postby JoeJ » Sun Jan 08, 2017 12:25 pm

Julio Jerez wrote:according to them an application will get zero gpu benefit from vulkan. in a nutshell they only credict Vulkan with better cpu driver controll because multithread better that tradional gl drivers.


IMHO this is very very wrong, although you hear it everywhere.
It is very good that now you can record multiple command lists from multiple threads, but that's not the main benefit if you think further.
With VK / DX12 you can build all your command lists at startup, containing indirect draws or compute dispatches.
At runtime you submit those prebuild command list(s) and that's all. No need for multiple CPU threads because the CPU workload is totally neglibible.
This works by compute shaders calculating the indirect parameters on the GPU,
e.g. compute based frustum culling writes list of visible objects to a list and the count of visible objects to the indirect draw parameter.

The command list for the example looks like:
1. Execute frustum culling (listScene, &listVisible, &visibleCount)
2. DrawObjects (listVisible, visibleCount)

It all works with a single submission of the prebuilt command list per frame - without any more CPU<->GPU interaction.
This way it is possible to implement a whole graphics engine with one 'draw call', if you want.
And that's what has been requested for years, now it's there (but for unknown reasons no one talks about it).
It is even easier if you are only after a compute only solution without the graphics pilepline complexity.
(My GI algorithm is really complex and it's one command list submission per frame - only exception if you want to go async)

All this means: The GPU can work all the time and never needs to wait on CPU - so there's benfit for the GPU as well.

For now most people use multithreded per frame generation of command lists, but this is more like the traditional approach. (Of course it's easier to do for existing engines.)
In reality we'll probably end up using both approches, but avoid per frame generation when possible.
There is also no guarantee a given GPU can shedule itself for complex things, and the driver may need to do CPU<->GPU sunc under the hood.

Julio Jerez wrote:if you read an AMD paper then vulkan is teh grated gift God gave to human kind.

They lead because:
1. They hava a driver since Mantle
2. GCN is designed for efficient compute, NV for efficient rasterization. Modern API makes it more likely to move CPU work to GPU, async compute helps here as well.

Without doupts NV can get better performance from modern APIs as well, but it still takes time for game and driver developers.
The truth is: The longer NV can hold back modern APIs, the longer they win all game benchmarks. I guess they will continue doing this until Volta or they just need better drivers.

Julio Jerez wrote:what I find atractive about vulkan is that does not required rendering, so in that regard it is in fact the replacement of CUDA, (whic i think is the reason nvidia poop poop it)
I wonder if in can coexist with other api, by this I mean using Vulkan for generic high performance computing and the get data for rendering with direct x 12, open gl or vulkan.


Why do you think DX12 can't be used for compute only too?
AFAIK differences between VK and DX12 are almost nothing, and probably all of them relate to the graphics pipeline.
But as said, no data sharing yet. Vulkan will get some in the next version, but i'd still do the other API later or leave it to us.

Pro Vulkan:
GLSL could feed another OpenGL code branch
Linux

Pro DX12:
Probably easier to use HLSL for Vulkan than the other way around
Intel GPU (VK Windows support still beta)
User avatar
JoeJ
 
Posts: 1453
Joined: Tue Dec 21, 2010 6:18 pm

Re: A specific setup problem

Postby Julio Jerez » Thu Jan 12, 2017 3:08 pm

well using my pc with a detached heat sink caused lot of damage, I need to get a new system.
so ordered the part an I just got them:

I bought:
1- Intel® Core™ i7-7700 Processor with the msi motherboard and 16g memory.
1-amd 480 gpu.

I was reading about that CPU and boy this is beyond anything I ever dreamed up.
if has 8 mbyte of cache and run at 4.2 ghz, compared to my intel icore7 2600, is only had 1 mbyte of cache and 3.3 ghz.

the one I want to bue was the it 6800 whi seem to be very popular and come with 15 mg of cache, bu that's because it is a 6 core cpu while the 7700 is a 4 cores cpu.
however core per core the 7700 is about 25% faster than the 6800, and they boat are order of magnitude faster than my old system

I paid $1025.00 for everything and I will assembly it these weekend.

there is one thing that surprised me, the CPU come with an integrated GPU, and the motherboard has a HDMI out for video, so it may be possible that I can test two or maybe even three different high performance computing in one single machine.

1-the CPU with the avx, but that I dough would be of any usage but who knows.
2-Integrated GPU on the CPU.
3-the discrete AMD cpu.

I would be so nice if Vulkan exposes all these devices.

also I was thinking, that if the system come with an integrated on ship GPU, even if eh graphics are not up to the level of a discrete GPU, for high performance computing it may actually beat the GPU because the integrated GPU has to shares memory with the CPU.

so if there is a way to map the buffer this may be fart better that DMA transfer to a GPU via PCI bus.
I am thing of stuff like rigid body solve and collision system stuff that only run on CPU.

If I am right and this speculation, them CPU may has no lost the fight versus GPU, integrated graphics may can be use as math coprocessor fro highly intensive operation both in memory and operations.

My wet dream is that something like Vulkan exposes the integrated GPU and that we can use it just and the interface for high performance computing, disregarding graphics very much like CUDA on NVidia, but far more flexible.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: A specific setup problem

Postby Julio Jerez » Fri Jan 13, 2017 2:33 am

well I plugged every thing and now the machine is up and running, with one exception, window pop a menu telling that I need to register an account.

when I start the machine, if show a black screen prompting me to insert my windows 7 DVD, but when I do it tell me the operation failed. with only two options, enter to continue and coming back to the same menu, or scape and that boot window as if it was normal but keep poop that message.

I think I am going to have to call customer service so that the tell what to do to let them know that I change hardware.

BTW the integrate video seem very nice, so is the AMD video card, which seem to be a monster card. this thing require and extra connector, plus it seem to be water collier, of maybe is jut a huge heat that seem to have tubes. anyway this is the most powerful machine I have ever seeing.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

PreviousNext

Return to General Discussion

Who is online

Users browsing this forum: No registered users and 45 guests