/* ** The E"otvos Experiment ** Two objects falling in the gravity field ** (apparently one of large mass and one of lesser mass) ** arrive simultaneously if the experiment takes place ** in a cylinder void of air. ** ** To solve pose the query: ** Ma>Mb, two_falling(Ma,Mb,Ta,Tb,D,G). ** ** Copyright (C) 1995 K J Dryllerakis ** ** $Id: falling.eu,v 1.3 1995/03/24 15:42:49 kd Exp kd $ */ two_falling(Ma,Mb,Ta,Tb,D,G):- moving_object(Ma,Ta,D,G), /* No interaction between objects */ moving_object(Mb,Tb,D,G). /* ** moving_object(?Mass,?Distance,?GravityConst,?TimeTaken) */ moving_object(M,T,D,G):- /* Get the force field we are in ** might also have been supplied as a parameter */ reals([M,G,T,D,Uf,Ai,Af]), formulae([F,S,U,A]), gravity_force_field(M,G,F), object_kinematics(S,U,A,[0,T],[0,D],[0,Uf],[Ai,Af]), object_dynamics(F,M,A). /* ** gravity_force_field(?Mass,?GravityConst,?ForceField) ** Describe the force field acting on a mass depending ** on time T(normally one would also include intervals ** of time -initial to final- so that F would be a function ** and not just a formula */ gravity_force_field(M,G,F):- reals([M,G]), formula(F), F=(M*G)//X. /* ** object_kinematics(?Dist,?Velocity,?Acceleration,?InitialValues) ** Describes the kinematics of an object */ object_kinematics(S,U,A,[Ti,Tf],[Si,Sf],[Ui,Uf],[Ai,Af]):- formulae([S,U,A]), reals([Si,Sf,Ua,Uf,Ai,Af,Ti,Tf]), Ti >=0, Tf >=0, S=integral(U), U=integral(A), %continuous(S), /* these will enter when S,U,A are functions */ %continuous(U), S@Ti=Si,S@Tf=Sf,U@Ti=Ui,U@Tf=Uf,A@Ti=Ai, A@Tf=Af. /* ** object_dynamics(?ForceField,?Mass,?Acceleration) ** Describes Netwon's 2nd law of motion ** (Simple isn't it?) */ object_dynamics(F,M,A):- formulae([F,A]), real(M), (1/M)*F=A.