hw5_1

# hw5_1 - r= for i =[2:20 stretch=(cell_face(i...

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

%Song, Hwan %AAE 412 %PS 5 clear all clc close all gamma = 2; n = 40; %Part (a) zeta = linspace(0,1,21); cell_face = (1-exp(gamma*zeta))/(1-exp(gamma)); figure scatter(zeta,cell_face,'ko') title({'Part(a)';'x/L vs. Zeta by Song, Hwan'}) xlabel('Zeta') ylabel('x/L') hold on for i = [1:21] x = [zeta(i) zeta(i)]; y = [0 cell_face(i)]; plot(x, y, 'k-') end for i = [1:21] x = [0, zeta(i) ]; y = [cell_face(i), cell_face(i)]; plot(x, y, 'k-') end hold off %Part (b) gamma = 2; n = 20; zeta = linspace(0,1,21); cell_face = 1/2+ sinh(gamma.*(zeta-(1/2)))./(2.*sinh(gamma./2)); figure scatter(zeta,cell_face,'ko') title({'Part(b)';' x/L vs. zeta by Song, Hwan'}) xlabel('Zeta') ylabel('x/L') hold on for i = [1:21] x = [zeta(i) zeta(i)]; y = [0 cell_face(i)]; plot(x, y, 'k-') end for i = [1:21] x = [0, zeta(i)];

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

View Full Document
y = [cell_face(i), cell_face(i)]; plot(x, y, 'k-') end hold off % Find out the Stretch Ratio
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: r=; for i = [2:20]; stretch=(cell_face(i+1)-cell_face(i))/(cell_face(i)-cell_face(i-1)); r = [r,stretch] end figure plot(cell_face(2:20), r) hold on gamma_4 = 4; zeta = linspace(0,1,21); cell_face = 1/2+ sinh(gamma_4.*(zeta-(1/2)))./(2.*sinh(gamma_4./2)); r = ; for i = [2:20]; stretch=(cell_face(i+1)-cell_face(i))/(cell_face(i)-cell_face(i-1)); r = [r,stretch] end plot(cell_face(2:20), r,'r') gamma_6 = 6; zeta = linspace(0,1,21); cell_face = 1/2+ sinh(gamma_6.*(zeta-(1/2)))./(2.*sinh(gamma_6./2)); r = ; for i = [2:20]; stretch=(cell_face(i+1)-cell_face(i))/(cell_face(i)-cell_face(i-1)); r = [r,stretch] end plot(cell_face(2:20), r,'g') title('Stretching at Gamma = 2,4,6 by Song, Hwan') xlabel('x/L') ylabel('r') legend('gamma = 2','gamma = 4','gamma = 6')...
View Full Document

## This document was uploaded on 10/24/2010.

### Page1 / 2

hw5_1 - r= for i =[2:20 stretch=(cell_face(i...

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

View Full Document
Ask a homework question - tutors are online