function [time1,position1,time2,position2] = effectOfDamping(params,initialPosition,initialVelocity,timeInterval,timeStep)
%   EFFECTOFDAMPING Compute trajectory of 1-D oscillator without and with damping.
%
%   Input arguments:
%   PARAMS - Structure that has fields for the three system parameters
%   springConstant, dampingConstant, and mass
%   INITIALPOSITION, INITIALVELOCITY - intial conditions
%   TIMEINTERVAL - Time interval over which you want to evolve the undamped
%   damped systems, starting from the initial conditions
%   TIMESTEP - Time step to use while evolving the systems
%   
%   Output arguments:
%   TIME1, POSITION1 - Row vectors that contain position vs time data for
%   the undamped oscillator
%   TIME2, POSITION2 - Row vectors that contain position vs time data for
%   the damped oscillator

% Copyright 2020 The MathWorks, Inc. 

% Create and evolve simple oscillator
myOscillator = mySystem.simpleOscillator(params.springConstant,params.mass);
[time1,position1] = myOscillator.evolution(initialPosition,initialVelocity,timeInterval,timeStep);

% Create and evolve damped oscillator
myDampedOscillator = mySystem.dampedOscillator(params.springConstant,params.dampingConstant,params.mass);
[time2,position2] = myDampedOscillator.evolution(initialPosition,initialVelocity,timeInterval,timeStep);
end