@Dmytry (and thus Hybrid too :)
Quote:
The only way to do something with big timestep is to not use forces there but use approximation to true solution for that timestep.
I agree that if a well thought hack works, based on physical observations or on a math study of the differential equations, then it should be prefered to very high integration rates. The volume computations will be time consumming. So risk of global computational 'lags'. Also hydrodynamics are in reality quite complex. Still I don't think it's the approximations of the model that 'cause the jumps'.
I am sure what happense is something like that. At t=0, a volume of 10cm radius is above water, comes with 10m/s. So the next step, t=1/100 sec for intance, it has displaced a height of 10 centimeter. Where it should possibly never have been if the simulation was continuous, this depends on the bal density.And surely never with the velocity it will have at the start of the second frame. I mean in any case energy is artificially created, even with your EM/velocity proposal. I think.
So, until Hybrid tests your solution Dmytry, to see if it works. I would rather go for a event based approach. I suppose it's important to know when the object hits the water/air interface, some kind of collision prediction again or time step refinement. Then integration will surely evolve with sounder initial conditions. Then I'd go for a hugely accelerated sampling rate for the first few seconds. But it's hard to tell on paper the object probably rotates, damping acts...
Quote:Original post by Dmytry
I'm just inagining situation: he have light (think, zero mass) object underwater. Say, hydrogen bubble. So with his model it have extremely big acceleration, >1000g. And it's just plain wrong. It can't have >g upwards, because water have to move down with acceleration not bigger than g. If we model it with 1000g acceleration of bubble, and will add some damping forces as computational afterthought, it will make things worse.
Excuse me if I miss something. It's just that I haven't experienced physic simulations of solids bodies vs liquids. Still I have experienced many other kind of forces. So maybe I miss something crucial in your post.
Still. Zero mass would mean photon to me :). I know that you certainly mean physically infinitesimal (very small but non zero) mass. But your bubble mass is proportional to its volume, which is also proportionnal to a mass of water displaced. So it's all about a ratio of densities (damping left apart), so acceleration is based on it. So your 1000g, OK.
But when you say it's just plain wrong, I think it's because the damping forces lack, not because your EM model lacks. As damping is roughly based on the apparent surface, here the ratio of densities does not count. Thus in results in very high damping, a problem. And there are probably other kinds of forces coming into play for a bubble, all resulting in higher retroaction. Big bubbles do not exist, there is a reason.
So probably the solution is to control artificially and force the evolution towards the limit of the movement that can be studied in theory. Your bubble would quickly reach it's nominal upward velocity. This is roughly what you tried to do with the EM trick, but I am not sure it takes the right params. Where is damping accounted for since it's the main cause of the limit state ? Or I missed something implicit.
Now it would be perfect if this could be done by creating a fake but working force summation. That is force towards the solution at second order. Well near the limit acceleration is null, and you target a speed limit. So more probably, the only stable way is to force control at first order, that is the velocities, with some sort of morphing during the transition between the initial state (for instance a bubble standing still) and the limit state.
Still if you can't change the typical physics interface : user provides forces, only integration modifies velocities and positions, there is a way to do.
I remember that to respond to such issues I had a class of tools that helped me to create the forces required to match a given position, orientation, or linear/angular speed. The time to limit was the second argument of the function.. It did so by reversing the physics integrator. This way for instance I could make keyframed animations compatible with the whole physics engine. And keyframed cyclic stuff like elevators, arbitrarilly of infinite mass, interacted perfectly with free physics objects. this worked perfectly.
Quote:
BTW2, you can also try to use better integration method such as RK4. I was unable to simulate springs for some project with Euler, and was able to do it using RK4 .
Yes good advise. I also experienced that.