nm 05 matlab case 2

35
8/12/2019 Nm 05 Matlab Case 2 http://slidepdf.com/reader/full/nm-05-matlab-case-2 1/35 Nofrijon Sofyan, Ph.D.

Upload: john-samuel-saragih

Post on 03-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 1/35

Nofrijon Sofyan, Ph.D.

Page 2: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 2/35

Case StudyLecture #05

Disclaimer: This lecture note was edited from various sources for the solely of teaching and learning purposes. It may contain copyrighte

owners; therefore, apart form teaching and learning purposes, this lecture note may not be reproduced, stored, or transmitted in any form or b

Page 3: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 3/35

Outline3

BackgroundFormula

MatLAB Solution

Exercise

Page 4: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 4/35

Case Study4

The strengths of 10 nominally identical ceramwere measured and found to be 387, 350, 3

400, 367, 410, 340, 345, and 310 MPa. (a)

Determine m and 0 for this material, (b) Calc

the design stress that would ensure a survivalprobability higher than 0.999.

Page 5: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 5/35

Background5

When we measure the strength of a series equivalent ceramic specimens we typically

considerable scatter results.

The reason is due to the size distribution of

that are responsible for failure.

This behavior is very different from that of

Page 6: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 6/35

6

Consequently we have to adopt different d

approaches when we use ceramics.

When we design components using metals w

determine the maximum stress that will be p

the component and then select a metal that

larger strength with safety margin is often i This approach is referred to as deterministi

Page 7: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 7/35

7

It does not work with ceramics because of t

scatter; rather we have to use a probabilist

approach in which we represent this scatterquantitative way so that these materials ca

used safely.

The most popular method is to use Weibulldistribution, which are based on the weake

approach.

Page 8: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 8/35

8

The Weibull distribution function gives the

probability of survival (S), or, alternatively,

probability of failure (SF), or Sn = 1 – 

SF

The other way to determine survival proba

nth specimen is through the relation

 = 1   + 1

Page 9: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 9/35

Page 10: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 10/35

10

Since one is dealing with a strength

distribution, the random variable x

is defined as /0, where is thefailure stress and 0 is a

normalizing parameter, required to

render x dimensionless.

Page 11: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 11/35

11

Replacing x by /0 in the Weibull distribution, onthe survival probability, i.e., the fraction of samplewould survive a given stress level, is simply

= /

∝       

or

= exp  

Page 12: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 12/35

12

Rearrange and taking the natural log of bo

twice yields

lnln 1 = ln  = ln ln Plotting  –  ln ln(l/S) versus ln   yields a stra

with slope  – m.

Page 13: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 13/35

13

The physical significance of 0 is now also o

It is the stress level at which the survival pro

is equal to 1/e, or 0.37.

Once m and 0 are determined from the seexperimental results, the survival probabilit

stress can be easily calculated

Page 14: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 14/35

Solution14

Weibull solution to the problem is by using the

= exp  

To determine m and 0, the Weibull plot for th

data has to be made by ranking the specimenof increasing strength, 1 , 2 , 3 , . . . , n , n + 1

where N is the total number of samples.

Page 15: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 15/35

15

Determine the survival probability for the n

specimen

 = 1   0.3 + 0.4 Plot - ln ln( 1 /S) versus ln  , the least-squa

the resulting line is the Weibull moduluslnln 1 = ln  = ln ln

Page 16: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 16/35

16

Summary of data needed to find m from a set of experimental resu

Page 17: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 17/35

17

The last two columns in

previous table are plotted

into a graph.A least-squares fit of the

data yields a slope of 9.5,

which is typical of manyconventional as-finished

ceramics.

Page 18: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 18/35

18

For statistical purposes, from the equation Y

BX

= Σ ΣΣΣ2  Σ 2

  = Σ Σ

It can be shown that 0   381 MPa (i.e. wh1/S = 0).

Page 19: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 19/35

19

(b) To calculate the stress at which the surviprobability is 0.999, use equation:

= exp  

or

0.999 = exp   381 .55from which = 184 MPa

Page 20: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 20/35

MatLAB solution20

%weibull1.m

clear all; clc;

dt = [387, 350, 300, 420, 400, 367, 410, 345, 310];

sigma = sort (dt, 'ascend'); %sort the datan=1:numel(sigma);

Sn=1-(n-0.3)/(numel(sigma)+0.4);

Page 21: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 21/35

21

ln_ln_Sn=-log(log(1./Sn));

ln_sigma=log(sigma);

disp(' Rank Sn sigma ln sigma ln lndisplay text above the table

disp([n' Sn' sigma' ln_sigma' ln_ln_Sn']) %create

p=polyfit(ln_sigma,ln_ln_Sn,1)

sigma_zero = exp(p(2)/-p(1))

sigma_max = sigma_zero*(log(1/0.999))^(1/-

Page 22: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 22/35

Manual graph fitting22

plot(ln_sigma, ln_ln_Sn)

A window will pop up

Click menu Tools, Basic

Fitting

Tick on Linear, then click

on the right Arrow

Page 23: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 23/35

23

Page 24: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 24/35

24

You can also plot the graph in the forms of

model:

mdl=LinearModel.fit(ln_sigma,ln_ln_Sn)) %

command give simple statistic table

plot(mdl) % plot the graph and the linear m

Page 25: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 25/35

Interaction with Excel25

Data can be read from another source such

Excel with the format:

data=xlsread('filename', 'sheet', 'range');

Eg:

sigma=xlsread('data.xlsx','B3:B10');

Page 26: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 26/35

MatLAB m-file26

%Weibull2.m

clear all; clc %Clear all data from memory

data= xlsread('Ceramics data.xlsx', 'C1:L1'); %RExcel data

sigma = sort (data, 'ascend'); %Sort the dataN = numel(sigma); %Number of data

n =1:N;

Page 27: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 27/35

27

Sn = 1 - (n-0.3)/(N+0.4);

ln_ln_Sn = - log (log (1./Sn));

ln_sigma = log (sigma);

p = polyfit (ln_sigma, ln_ln_Sn,1) %1 refer to

plot

sigma_zero = exp(p(2)/-p(1))

sigma_max = sigma_zero*(log(1/0.999))^(1

Page 28: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 28/35

Page 29: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 29/35

MatLAB m-file, interactive way29

%Weibull3.m

clear all; clc

dt = input ('Input the data: '); % data [x1, x2

sigma = sort (dt, 'ascend');

n=1:numel(sigma);

Sn = 1 - (n-0.3)/(numel(sigma)+0.4);

Page 30: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 30/35

30

ln_ln_Sn = - log (log (1./Sn));

ln_sigma = log (sigma);

p = polyfit (ln_sigma, ln_ln_Sn,1) % linear pl

sigma_zero = exp(p(2)/-p(1))

sigma_max = sigma_zero*(log(1/0.999))^(1

Page 31: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 31/35

31

disp('Rank Sn sigma ln sigma ln ln 1/

disp([n' Sn' sigma' ln_sigma' ln_ln_Sn'])

mdl=LinearModel.fit(ln_sigma, ln_ln_Sn);

plot(mdl), xlabel('ln sigma'), ylabel('-ln ln 1/S

Page 32: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 32/35

Quiz32

In an experiment, imagine that you need to d

the activation energy of Cu atom diffuses in A

versa. To carry out the experiment, firstly you

two bars of Al and Cu at certain temperature

time. After the joining process, you will examijoint to see the diffusion distance of the desire

Page 33: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 33/35

33

Knowing the diffusion distance and time of thprocess you will be able to find the diffusion

coefficient at a certain temperature in which. Next, to predict the activation energy (Qneed to do the experiment as a function oftemperature, after then you will be able to p

activation energy and temperature-independexponential (D0) based on the Arrhenius equa

= exp   .

Page 34: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 34/35

34

Sketch your step in doing the experiment by w

on the flowchart, algorithm, and pseudocode.

that, write a small modeling program in MatLto determine the activation energy and tempe

independent pre-exponential factor from tho

experiments.

R f

Page 35: Nm 05 Matlab Case 2

8/12/2019 Nm 05 Matlab Case 2

http://slidepdf.com/reader/full/nm-05-matlab-case-2 35/35

References35

W.Y. Yang, W. Cao, T.S. Chung, J. Morris: App

numerical methods using MATLAB, John WileyInc., Hoboken, New Jersey, 2005.

M.W. Barsoum: Fundamental of Ceramics, InsPhysics Publishing, Philadelphia, 2003.

D. A Porter, and K.E Easterling, Phase Transfoin Metals and Alloys, 2nd ed. Chapman and London, 1992.