{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

4_Quarterman_Patrick_HW10B

# 4_Quarterman_Patrick_HW10B - Patrick Quarterman Section 4...

This preview shows pages 1–3. Sign up to view the full content.

Patrick Quarterman Section 4, HW10B Part 1: Script: function [] = Explosionloop(p,T,m) %Patrick Quarterman, Section 4 %HW07B %Inputs: density (p), tensile stregnth (T) and mass (m) as vectors %Outputs: Shatter depth as array and as vector for each composition V=[8750 8400 5270]; %Blast velocity (m/s) C=[6239 10.2 120.1]; %Concentration factor (kg^2/m^10) for i=1:length(V) for j=1:length(C) B(i,j)=(10*m*V(j)^2*C(i)^.5/(p*T)); end end B Command window: > Explosionloop(2700,25*10^6,10) B = 8.9592 8.2568 3.2499 0.3623 0.3339 0.1314 1.2430 1.1456 0.4509 Part 2: Script: %distortion script %Patrick Quarterma, Section 4 %calculates distortion of an image for values x and y %create vectors x and y x=linspace(-10,10,21); y=linspace(-15,15,31); %create an array of values for d with x changing in columns and y in rows for i=1:length(y) for j=1:length(x) d(i,j)=(.5*x(j)^3+1/3*y(i)^3)*exp(.001*x(j)^2)*exp(.001*y(i)^2); end end d %find the maximum value of d and its location max1=max(d); %find max value for distortion maxd=max(max1) [ymax,xmax]=find(d==maxd);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
xmaximum=x(xmax) %values for x and y at maximum ymaximum=y(ymax) matlab commands: d = 1.0e+003 * Columns 1 through 7 -2.2490 -2.0227 -1.8438 -1.7052 -1.6007 -1.5248 -1.4723 -1.9020 -1.6874 -1.5183 -1.3877 -1.2897 -1.2188 -1.1702 -1.6127 -1.4084 -1.2477 -1.1240 -1.0315 -0.9650 -0.9197 -1.3733 -1.1778 -1.0244 -0.9066 -0.8189 -0.7561 -0.7135 -1.1771 -0.9891 -0.8419 -0.7292 -0.6454 -0.5857 -0.5455 -1.0178 -0.8363 -0.6944 -0.5859 -0.5056 -0.4485 -0.4103 -0.8904 -0.7143
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

4_Quarterman_Patrick_HW10B - Patrick Quarterman Section 4...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online