Hi,
I'm trying to model the difference of strength in a cable consisting of N wires in a cable due to different strain values. For this I have created two for loops. In the inner for loop I calculate the strength of the cables for each strain step. These values are sampled in a vector. I want to use Monte Carlo simulations and run the inner for loop K times. For each simulation of K I want to sample the "jobb" vector into a large vector containing every "jobb" vector value. Can this be done?
my script:
clc; clear all; close all; E = 7.75*1e4;Area = 38.48;mu = 0.4343;su = 0.3295; my = 0.8686;sy = 0.1318;k = 8; N = 200; K = 10; for simulations = 1:K; P = rand(N,1); epsilon_y = logninv(P,my,sy); epsilon_u_y = logninv(P,mu,su); epsilon_u = (epsilon_y + epsilon_u_y); n = numel(P); g = 1:k; epsilon_0 = 1; jobb = zeros(k,1); model = zeros(n,1); for epsilon = 1:k; for ii = 1:n; if epsilon_y(ii) >= epsilon ep = epsilon; elseif epsilon_y(ii) < epsilon && epsilon < epsilon_u(ii) ep = epsilon_y(ii); elseif epsilon_u(ii) <= epsilon ep = 0; end model(ii) = ((ep/100)*E); end p = sum(model)*Area; jobb(epsilon) = p; endlarge_vector_that_I_want_to_find = ..;end
Best regards
Trond Oesten
Best Answer