PSL - 2
Problem 2
Problem 2
When dropped in a container of water a materials surface area and density can directly affect the velocity experienced. Equation 2, describes the velocity of a sphere given g for gravity, p for density, u for dynamic viscosity of the fluid, and d is the diameter. This is equation is used for the numerical method considering how there is no square root. Equation 3 unlike equation 2 uses Cd, the drag coefficient, to derive the velocity. Equation 4 is used to derive the Reynolds number given the density, velocity, diameter, and dynamic viscosity. This Reynolds number is then used in equation 5 to derive the drag coefficient, which can then be used in equation 3 to verify the velocity derived from equation 2.
Equation 2 provides velocity (v) given the density, dynamic viscosity, gravity (g), and distance (d).
Equation 4 provides Re, Reynolds Number, given the density, dynamic viscosity, v, and d.
Equation 3 is an alternative form to derive v given Cd.
Equation 5 provides Cd, drag coefficient, given the Re.
This equation is derived using equation 3 and plugging in equations 4 and 5 so that everything is in the terms provided. The open methods will be utilizing this equation for each iteration.
The modified secant method uses a small step size rather than using two estimations like the Newton-Raphson method. Although the principle is the same as to how the estimation is derived. The Fixed point method rearranges the function so that the estimation will be at the convergence of the function = x. In this scenario, the derived numerical solution was used since the v can be added to act as x.
%%problem 2
%set parameters
g = 981;% cm/2
d = .02;% cm
p = 1;
ps = 7.847;
u = .014;
% velocity
%v0 = sqrt((g/18)*((ps-p)/u)*d^2);
% reynolds number
%re = (p*v*d)/u;
% drag coefficient
%cd = (24/re) + (3/sqrt(re)) + .34;
%function for secant estimations
fv = -v + sqrt((4*g*(ps-p)*d)/3((24*u)/(p*v*d))+(3/(sqrt(p*v*d)/u)+(.34));
% secant method
es = .001; %stopping criteria
ea = es * 1000;
x0= 3;
while ea > es %while loop will break once ea <= to es
x_vec(iter + 1) = x_vec(iter) - f_poly(x_vec(iter)) / ff_poly(x_vec(iter));
ea = abs((x_vec(iter+1)- x_vec(iter))/(x_vec(iter+1)) )*100;
error_vec(iter) = ea;
iter = iter + 1;
end
%functions for fixed point method
fxvec = v
gxvec = sqrt((4*g*(ps-p)*d)/3(((24*u)/(p*v*d))+(3/(sqrt(p*v*d))/u)+(.34));
%fixed point
fes = .001;% stopping criteria
fea= fes * 1000;
while fea >fes %while loop
fxvec(iter +1) = gxvec(iter)
ea = abs((gxvec(iter+1)- fxvec(iter))/(fxvec(iter+1)) )*100;
iter = iter + 1;
end
When regarding open methods they can move away from the solution if the initial guesses are not right. For example, if a fixed point estimation is not done properly and g’(x) is < 0 the estimations will keep oscillating around the solution. A closed method might take longer at converging onto a solution as compared to an open method. Although if the upper and lower bounds are set to the right spots the closed method will guarantee convergence, whereas an open may not.
The open methods should offer an easier and faster form of getting to the solution when compared to closed methods. The number of iterations used for closed methods should not differentiate as much as it will for open methods.
The secant method arrived faster at an answer than the fixed point method. It only took the secant method three iterations to reach an error of .7%. In this problem, the secant method will work faster than the fixed method.