Wednesday, April 25, 2012

Homework # 7

7.17

First I solved it graphically and I can approximate the root to 2.55


Matlab:
x = (-8:0.0001:6);
f_x = @(x) x.^3 + 3.5*x.^2 -40;

plot(x,f_x(x));




Then I solved it using the function fzero in Matlab with the result of 2.5676

Matlab:


x = fzero(inline('x.^3 + 3.5*x.^2 -40'),3)


 7.19

I used Wolfram Alpha to calculate the roots for the first part of the equation:

Then I plugged the roots in and got this equation:






8.9

The First thing I did was rearrange the equation to this:

Then I used the zero function in Matlab to solve the equation and I got: 2.9449
Matlab:
x = fzero(inline('(pi*h.^3)/3 - pi*(h.^2)*(1) + (0.5)'),3)




8.14
Matlab:
%Modified Secant Method
P = (0:0.1:20000);
l_k = 50;
Delta = 250;
eck = 0.4;
E = 200000;
lk = 50;
f_x = @(P) (Delta)./(1+((eck)*sec(0.5*sqrt(P/(E))*l_k)));

plot(P,f_x(P));
for iter = 1:3
    
    sol(iter) = P-(Delta*P*f_x(P))/(f_x(P+Delta*P)-f_x(P));
    Delta = P;
    P = sol(iter);
    
end


sol()





8.17



 8.30


8.46







No comments:

Post a Comment