# Generate random short fiber positioning (RVE)?

16 vues (au cours des 30 derniers jours)
RAJESH le 13 Jan 2023
Commenté : RAJESH le 13 Jan 2023
Kindly, Could you complete the code, i am not not understanding whats going on?
And what are the steps involved to generate input files for Randomly oriented shor fibre in matlab and run inro abaqus, BEAM ELEMNT to check flexuarl strength?
%% Monte Carlo style script for random placement of fibres
%% Block 1: Define RVE Space
RVE_Length = 100; %Length
RVE_Width = 100; %Width
D = 15; %Fibre Diameter
VolFract = 30; %Percentage volume fraction
%Define RVE
figure('Name','RVE with random fibres','NumberTitle','off')
rveBox = axes('Box','on');
xlim([0 RVE_Length]);
ylim([0 RVE_Width]);
xlabel('RVE Length, L (\mum)')
ylabel('RVE Width, W (\mum)')
title('Random positioned fibres RVE')
%% Block 2: Determine total number of fibres, N_total
Ntotal = round( (0.01*VolFract*RVE_Length*RVE_Width)/(pi*D^2) );
disp(['Total Number of Fibre, Ntotal = ',num2str(Ntotal)]);
%% Block 3: Generate random position of first fibre
XYALL(:,:) = zeros; % A hold-all variable for all fibre coordinates
XYALL(1,1) = rand*RVE_Length; %Random x-position for 1st fibre
XYALL(1,2) = rand*RVE_Width; %Random y-position for 1st fibre
Dmin=0.1; R=D/2; Ncurrent = 0.1;
%% Block 4: Check overlap criteria
phi = 20; %Percentage of R parameter
for Ni = 2:Ntotal
while Dmin < 2*R*(1+phi)
%Create a test position [xtest, ytest] to see if it overlaps
xtest = rand*RVE_Length; %Random x-position for next fibre
ytest = rand*RVE_Width; %Random y-position for next fibre
for i = 1:Ncurrent
% Include codes here to test for overlap
% for all current fibre existing in RVE
end
end
% Accept into XYALL the tested coordinate position
% when they pass the overlap test
XYALL(Ni,1) = xtest;
XYALL(Ni,2) = ytest;
end
%% Block 6: Implementation of periodicity of material
b = cell(1);
for m = 1:length(xEdgeFibres) %For xEdge Fibres Only
if XYALL(xEdgeFibre(m),1)<R
b(m) = [XYALL(xEdgeFibres(m),1)+RVE_Length XYALL(xEdgeFibres(m),2) ];
else
b(m) = [XYALL(xEdgeFibres(m),1)-RVE_Width XYALL(xEdgeFibres(m),2) ];
end
end
%Repeat similar coding for yEdgeFibres and cornerFibres
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Walter Roberson le 13 Jan 2023
No, we cannot complete the code. You have an infinite while loop that I have already pointed out to you twice, but you have not made any attempt to fix the loop or describe to us what you expect the while loop to be doing .
You are expecting that someone will take over and rewrite the code to do random fibre generation. However there are so many pieces missing in the existing code that anyone who would be willing to take over the code for you is likely to scrap the whole thing and start over.
If you want to keep going with the existing code you have to start cooperating with the people who are pointing out the problems and starting to fix the points that they are raising.
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
RAJESH le 13 Jan 2023
okay sir, i got it I will try to generate the code again.
Thank you.

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Signal Generation dans Help Center et File Exchange

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by