 Welcome to dealing with materials data. In this course we are going to learn about collection, analysis and interpretation of data from material science and engineering. So we have been looking at error and its propagation. In the last session we looked at how error propagates and we just looked at how the error in one quantity namely conductivity propagates when you do the conductivity measurements using eddy current method in terms of the thickness of the skin. So we did this calculation in the previous session but we want to deal with a slightly more complicated propagation of error and that is what we are going to do in this session. So this is about combining the uncertainties and how do we combine uncertainties if suppose we have a quantity f and this quantity f depends on these variables x, y, z etc. And if you assume that the uncertainties in x, y, z etc are independent then the variance in the quantity f is given by this formula where you take the partial derivative of f with respect to x, square it, multiply by the variance and again take the partial derivative with respect to y and multiply by the variance and so on. So you can do this and if suppose these quantities are not independent then you have to take this covariance is also intercount. So it is dou f by dou x whole squared sigma x squared plus dou f by dou y whole squared sigma y squared and 2 times dou f dou x dou f dou y covariance of x, y and so on. So this is how the combining of uncertainties is done. And in the case of independent quantities if suppose f depends only on x and y then you can learn how to combine the uncertainties in this fashion. So it is, so if it is plus or minus then the uncertainty is just added. If it is multiplication or division then it is a relative uncertainty that gets added and x, y power n or x by y power n is also relative uncertainty except that this factor of n shows up here and if it is f is dependent on x logarithmically then it is 1 by x is the sigma f, it is a sigma x by x and f if it is exponential x then you can see sigma f is f times sigma x. So these are the formula that one can use but in all this we are assuming that the uncertainties in x, y is independent. If it is not so you have to also consider the covariances. Now let us consider the Hall-Petch relation between grain size d and the flow stress sigma of d. Sigma of d is known to be sigma naught plus k d to the power minus half where k is the Hall-Petch coefficient. This relationship assuming that it is d to the power minus half is due to Hall-Petch. So this constant that you will get if you fit to this function form is known as Hall-Petch coefficient and sigma 0 is the materials constant for initiating the dislocation motion. Now as you can see there could be uncertainty in many of these quantities. For example there could be uncertainty in the k that you have evaluated, there could be uncertainty in the sigma 0 that you have evaluated. Obviously we also know that the grain size is not a single number. So it has uncertainty. In addition we also know that it also has different distributions. I mean when we say uncertainty in k and sigma naught for example, we are assuming that it is random noise. So the distribution of the error is normal distribution. But that need not be so like we have seen in one of the earlier sessions that the grain size distribution can follow a non-normal distribution and in the case we saw it was beta. So in such cases how do we deal with? And typically sometimes you will also see that the grain size actually follows large normal distribution and if so how do we get the error that you get in the flow stress. This session is about propagation of error. We have error in these quantities. If we know how much is the uncertainty can we say anything about the uncertainty in this quantity. That is what we are trying to calculate and let us do the first one. Let us say that the k value is this is for copper. The k value is 112 plus or minus 2 and this is calculated assuming that your grain sizes are given in microns and sigma naught is 18.6 plus or minus 1.7. So this is the sigma for k and this is the sigma for sigma naught and so we want to find out the uncertainty in the flow stress. We are going to assume that these two uncertainties are independent and so it is one of addition. So we can do this in R. So we want to say k is 112 and uncertainty in k is 2 S naught is 18.6 and d S naught is 1.7. So now we want to calculate the uncertainty in sigma and because these quantities are in addition all you need to do is to look at the corresponding formula. So it tells you that so if it is x plus or minus y then the sigma f squared is nothing but sigma x squared plus sigma y squared. So that is the uncertainty. So the uncertainty just gets added up. So you will get square root of 2 squared plus 1.7 squared. So that is of the order of 2.6. So that is what we are finding here. Now what happens if suppose we have uncertainty in k and d let us consider a quantity f which is the flow stress for a given grain size minus sigma naught. So let us consider that quantity and let us look at the uncertainty. In this case this is of the form x by y to the power n. So and let us say the d is 5.3 the uncertainty in d is 1.2. So in this case we have found that the uncertainty has to be calculated using this formula. So the relative uncertainty is square root of sigma x by x whole squared plus n squared sigma y by y whole squared. And sigma x happens to be in this case k and y happens to be d. So it is k by dk whole squared plus n is half. So it is 1 by 4 multiplied by d by dd whole squared and the entire thing you have to take the square root. So this is the quantity we have and there seems to be some problem sorry. So it is the other way around by k. So it is about 11.4 percent and this quantity is nothing but the delta f by f. So if you multiply this quantity by f and you can evaluate f for a given set of parameters then this delta f happens to be about 7.7. So you can calculate f. Let us say that we know that it is S naught plus k divided by square root of d. So that is f. So if you multiply f by 11.5 then you get 11.5 percent right. So it is 7.7 percent. So that is what is shown here. So you get the error to be about 7.7. And of course you can now consider the error in all the three quantities sigma naught k and d and can ask the question what is the uncertainty in sigma. You can do the calculations in series. You can calculate first the uncertainty that is coming from here and how does that uncertainty then add to the uncertainty that is coming from here and then you can get the total uncertainty in sigma naught. But because the error that you are going to get from here is relative and the other one is just the sigma that you are going to get it is going to become much more complicated. But the easier to follow is the partial derivative formula. We have seen that the error for example or uncertainty in the flow stress should be dou sigma by dou sigma naught and the uncertainty in sigma naught multiply plus dou sigma by dou k into this should be uncertainty in k del k plus dou sigma by dou d into del d. So if you do that then you know that in this case for example it is sigma naught. So this derivative just gives sigma naught itself and in this case it will give you the root d remains. So k just gives you del k because 1 by root d del k is what it becomes. And in this case k del d will remain and d will give you minus half d to the power minus 3 by 2. So that comes down. So 2 d to the power 3 by 2 because we have taken mod. So you can now add all these uncertainties. We know that this is 1.7 for example and we know that this is 2 divided by square root of 5.3 and this is for example 112 multiplied by 1.2 divided by 2 5.3 to the power 3 by 2. So we can evaluate this quantity. So let us do that and find out how much is the error. So we want to do the so 1.7 plus the uncertainty in k that is 2 divided by square root of 5.3, 2 divided by square root of 5.3 and then we have k which is 112 and multiplied by the uncertainty indeed divided by 2 into 5.3 to the power 1.5. So you get about 8 and now you also know the relative values. For example of this 8.1, 1.7 comes from sigma naught and 2 by square root of 5.3 that is about 0.8 comes from this uncertainty which is in k and the remaining. So if you have about 1.7 plus 0.8 so about 2.5 so the remaining 5.5 comes from the other quantity. So we can calculate this quantity and this is what the 5.5 comes to. So you can also know that the uncertainties indeed are giving you the contribution. So it is 5.5 divided by some 8.1 so it is about 67, 68 percent contribution is coming from here and then so 1.7 divided by 8.1. So that is another 21 so it is about 68 and 21 so 89 so remaining 11 is what is coming from this. So that is 0.9 divided by 8.1 so that is 11 percent. So you can see the relative contribution to the error also by doing this. So what we are doing in this case is to use the formula and calculate the uncertainty. Of course so we can now combine different things you can assume one of the uncertainties to be 0 and you can find out what is the error that is coming. So we know that it is 5.5 and this is about 11 about 0.8 so that is 6.4 and so you can calculate and if you assume that only uncertainty is coming from del D then you can calculate and so on and so forth. Of course you can also assume that the uncertainties are not independent and then if you know the uncertainty in Sigma 0, K and D how do we get the uncertainty in Sigma and in that case you need to know the covariance that is contributing and for that we can do the Monte Carlo simulation. So that is what I will show next. Let us consider the and for Monte Carlo simulations we are going to use the library propagate, we have the library propagate and then we are going to let us consider these. So what is this? So we are going to assume that the error in K is a normal distribution and the mean is 112 and standard deviation is 2 that we know and in Sigma 0 again we are going to take a mean of 18.6 and standard deviation of 1.7 and again we are assuming that that is normally distributed. For starters we are also going to assume that the grain size is also normally distributed. It need not be we will do log normal for example as one more case and but for starters let us assume that even D is normally distributed. So the other calculations that we have done so far we were assuming implicitly that this is also an error and so that has mean 5.3 and standard deviation 1.2. So we take all these random variants that we have generated for these quantities and then we are going to use the Monte Carlo simulation using them and this is the expression S naught plus K d to the power minus 0.5 and we are then going to find out how much is the error that you get in the resultant quantity because of these variations. So there is lots of information that propagate gives. So it gives you the means and the standard deviations which is not very different from what we have found and from Monte Carlo simulation it gives you the means and standard deviations. So that is also not very different from what you see and what is this degrees of freedom coverage factor etc we will come back. Uncertainty we have already found that it is of the order of 11 we have found and the covariance matrix is given. So it tells you relative importance of these off diagonal terms. So you can see that K sigma naught and D sigma naught these are the covariance values and K d for example. So they are all relatively small. So compared to these quantities they are not very big and you can also see the relative contribution of course this we have seen it is from these simulations you find that 88 percent comes from here about 8 percent comes from sigma naught and K contributes about 2 percent. So in terms of relative contribution again we see that maximum contribution comes from D the next one comes from S naught sigma naught and the third is from the K parameter. And the skewness and excess kurtosis is given here and these some of these tests for normality these are also things that we have not discussed yet like Kolmogorov-Smirnov we will come back to this at a later point. But using such simulation again you can get the error propagation. So this is what the information that we have gotten. Now you can do one more thing you can make sure that the D distribution is not normal but log normal. If suppose that is the case then what happens to your error. So you can do that again the simulations are very helpful because then you can assume any distribution for the quantities and you can generate the variates and then use that in the simulations. So the other quantities are the same K and S naught I am assuming that they are normally distributed with the given mean values and standard deviations. But the grain size I am going to assume log normal distribution with a mean at log 5.3 and standard deviation of log 1.2 and using that as the parameters then we are going to do a Monte Carlo simulation run and we are going to get the information. Again we see that majority of the contribution comes from D about 83 percent and this is about 12 percent and this is about sorry yeah. So this is 0.031 so it is about 3 percent. So and the covariance matrix again you can see that they are not contributing much most of the contribution is coming from the variances. So you can assume that the they are independent that is a fairly good approximation and but you can see that the values that you get for example for mean is not changing much the standard deviation is certainly very different if you assume that it is log normal distribution for the grain size. So which is more meaningful but we do not know in this case when these parameters were obtained S naught K etcetera what was the exact distribution of the grain size we do not know but it might be a good approximation to assume that it is log normal. If so this simulation then tells you how much is the error. So to summarize what is it that we have done we have found out how to calculate error when the function depends on more than one variable and we have calculated the error assuming that the uncertainties in these quantities are independent when you do that there are formula that you can evaluate or you can use the partial derivative formula and directly evaluate the quantity and in some cases you get the error to be the uncertainty in some cases you get the relative error or relative uncertainty delta f by f is the quantity that you get but in either case you can find them out. But if you want to also include the covariances or incorporate distributions which are not normal for doing the error propagation you can use the library propagate and you can carry out Monte Carlo simulations to get the error. So this sort of completes our session on descriptive data analysis we have looked at how to describe data, how to plot data with error bars and also understand how the error propagation happens. And with a summary session we are going to conclude this module and then we will move on to the probability distributions module. Thank you.