# How to implement a Monte Carlo Simulation for studying uncertainty in dynamic stiffness?

I have a dynamic mechanical system of the form: $$\mathbf{M{\ddot q}+{\Omega_c}G{\dot q}+{Kq}=F(t)}$$

and I need to introduce some uncertainty for the $K$ parameter, which is a symetric matrix of $q$ degrees of freedom.

I did a bit of research of Monte Carlo simulation but I´m a bit confused of how different textbooks approach the problem.

For example , my actual stiffness value is of $1e8$, and I wish to generate values uniformly distributed between $K_l = 1e6$ and $K_u = 1e12$.

I found that I can do this by applying: $$\lambda_i = \mu_{\lambda_i} + \epsilon_i$$ where $\mu_{\lambda_i}$ is the mean value of $\lambda_i$ and $\epsilon$ is a random parameter, and also $$\sigma_{\lambda_i}^2 = E[{(\lambda_i-\mu_{\lambda_i})^2}]$$

I would be using Matlab for running the simulation , with the command rand I can generate a randomly distributed numbers between 0 and 1.

The problem I find with this is that I don't know know to input the boundaries of the $K$ stiffnes values I want.

Then I found another text book that explains how to generate random variables using: $$X_i = A + (B-A)R_i$$ Where $R_i$ is the random number which can be generated by Matlab with rand command to generate a new random variable $X_i$, with lower and upper limits $A$ and $B$. So in matlab I would do a for loop like this:

for i=1:num
Ki=Kl+(Ku-Kl)*rand;
end


My main question would actually be, what is the difference between these two methods and for the first one, would $\epsilon$ just be a random 0-1 number adding to the average designated value?

Thanks

Note that this approach will change the different entries in the $q$-degrees of freedom stiffness matrix by different amounts, and that is probably much more realistic than multiplying the whole matrix by one scalar factor.