using System; using L=Science.Physics.GeneralPhysics; namespace Serway.Chapter08 { /// /// Example09: Block-Spring Collision /// A block having a mass of 0.80 kg is given an initial /// velocity = 1.2 m/s to the right and collides with a /// spring of negligible mass and force constant k=50 N/m, /// as shown in Figure 8.14. /// (A) Assuming the surface to be frictionless, calculate /// the maximum compression of the spring after the collision. /// x_{max} = 0.15 m /// (B) Suppose a constant force of kinetic friction acts /// between the block and the surface, with \mu_k = 0.50. /// If the speed of the block at the moment it collides /// with the spring is v_A = 1.2 m/s, what is the maximum /// compression in the spring? /// x_c = 0.092 m /// public class Example09 { public Example09() { } private string result; public string Result { get{return result;} } public void Compute() { L.Mass m = new L.Mass(); m.kg = 0.8; L.Velocity vi = new L.Velocity(); vi.X = 1.2; double k = 50.0; double mu = 0.5; //(A) L.KineticEnergy K = new L.KineticEnergy(m,vi); double xmax = Math.Sqrt(2.0*K.J/k); result+=xmax.ToString(); //(B) double[] coe = { -K.J, mu * m.kg * L.Constant.AccelerationOfGravity, 0.5 * k }; L.Complex[] f = L.Calculus.SolutionOfPolynomialEquation(coe); result+="\r\n"+Convert.ToString(f[0].Real); result+="\r\n"+Convert.ToString(f[1].Real); } } } /* 0.151789327688082 -0.249240744554688 0.0924407445546875 */