using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter06 { /// /// Example15: Euler and the Sphere in Oil Revisited /// Consider the sphere falling in oil in Example 6.10. /// Using the Euler method, find the position and the /// acceleration of the sphere at the instant that speed /// reachers 90.0% of terminal speed. /// y = -0.035 cm /// a = -99 cm/s^2 /// public class Example15 { public Example15() { } private string result; public string Result { get{return result;} } private double tau = 0.0051; private double t = 0.0117; private double v_t = -0.05; public void Compute() { // dv/dt = - g + g/v_t*v // at v = 0.9*v_t, dv/dt = - g + g*0.9 double g = L.Constant.AccelerationOfGravity; result += Convert.ToString(-g+g*0.9)+" "; L.Calculus.Function v = new L.Calculus.Function(VvsT); double res = L.Calculus.IntegrationMidpoint(v, 0.0, t); result += res.ToString(); } private double VvsT(double t) { return v_t*(1.0-Math.Exp(-t/tau)); } } } // -0.98 -0.000355716836602458