Monday, April 30, 2012

Homework #13

15.17

Matlab:
w1 = 2;
w2 = 2;

L = @(th,al) w1./sind(th)+w2./sind(180-al-th);

hold off;
L_thmin = [];
for al = [45:135],
th = [10:179-135];
plot(th,L(th,al));
hold on;
[lm,Lin] = min(L(th,al))
L_thmin = [L_thmin,min(L(th(Lin),al))];
end
hold off
plot((45:135),L_thmin);




16.32







For this problem the derivative was taken for the function then the value was places back in the original value to find the maximum.
Matlab:


e_0 = .85e-12;
q = 2e-5;
a = 0.9;
x = (0:0.001:15);
Q = q;


c1 = 1/(4*pi^e_0) *(q*Q);

F =@(x) c1*x./(x.^2+a.^2).^(3/2);

hold off;
plot (x,F(x));

hold on;
plot (a/sqrt(2), F(a/sqrt(2)), '*r');

16.25

The solution can be found at 1,3 based on using the max function in matlab.


Matlab:


s = (0:0.001:10);


T =@(s) 15* (s-s.^2)./((1-s).*(4*s.^2-3*s+4));
hold off
plot (s,T(s));

ess = rand(1,100000) *10;
[y,i] = max(T(ess));
hold on
plot (ess(i),y,'r*');



No comments:

Post a Comment