Commit efdf1629 authored by Turnhout, M.C. van's avatar Turnhout, M.C. van
Browse files

starting ani-films

parent 8afa89e8
......@@ -3,16 +3,13 @@ clear all; close all;
sigma = linspace(0, 2.5e-2, 26);
param = TF_labconfig;
param.Efilm = 1.75; % MPa, mean/median of iso-param
param.tfilm = 8.5e-3; % mm, mean/median of iso-param
param.tcells = 3e-3; % mm, mean/median of iso-param
param.length(1, 3) = 4;
param.width(1, 3) = 1.75;
param.nframe = 3;
param.fibdef = {'fiblab'};
param.refframe = 3;
param.nfilm = 1;
param.FEMbuild = 'python';
param.FEMbuild = 'matlab';
if exist('pspaceaniparam.txt', 'file')
done = size(load('pspaceaniparam.txt'), 1);
......@@ -21,16 +18,14 @@ else
end
% inparam = load('pspaceaniinputparam.txt');
for m = done+1:111
for m = done+1:100
tic
param.expname = sprintf('pspaceani%i', m);
% randomise parameters
param.fiblab = [pi/2*rand(1) 0.3*rand(1) rand(1)];
param.width(1, 3) = .5+3.5*rand(1); % mm
param.fiblab = [pi/2*rand(1) pi/6*rand(1) rand(1)];
% param.fiblab = inparam(m, 2:4);
% param.width(1, 3) = inparam(m, 5); % mm
fid = fopen(sprintf('pspaceani%i_results.txt', m), 'w');
for s = 2:numel(sigma)
......@@ -38,7 +33,6 @@ for m = done+1:111
fprintf('simulation %i, sigma %i of 25: ', m, s-1)
param.sigmax(1, 1) = sigma(s);
param.nelx = round(5*param.width(1, 3));
TF_writeFEMinc(param, 1, 1);
TF_buildFEM(param, 1, 1);
......@@ -49,14 +43,41 @@ for m = done+1:111
if status
% job failed, report impossible values
R = -1; l = -1; dL = -1;
R = -1; l = -1; dl = [NaN NaN];
mkap = dl; skap = dl; cskap = NaN; cmkap = NaN;
else
% analyse FEM curvature
[R, l, dL] = TF_getFEMR(param, 1, 1);
fprintf('sigmax: %e MPa ->\n', param.sigmax(1, 1));
fprintf('deformed length: %f mm\ncurvature: %f mm\n', l, R);
% total deformed length
dl = [sum( sqrt(sum(dL(:, 1:3).^2, 2)) ), ...
sum( sqrt(sum(dL(:, 4:6).^2, 2)) )];
kappa = TF_lokappal(dL);
% mean local kappa
mkap = [mean( sqrt(sum(kappa(2:end, 1:3).^2, 2)) ), ...
mean( sqrt(sum(kappa(2:end, 4:6).^2, 2)) )];
% std local kappa
skap = [std( sqrt(sum(kappa(2:end, 1:3).^2, 2)) ), ...
std( sqrt(sum(kappa(2:end, 4:6).^2, 2)) )];
% analysis on centre instead of edges
[Rc, ~, dL] = TF_getFEMR(param, 1, 1, 1);
% total deformed length
ndist = [sum( sqrt(sum(dL(:, 1:3).^2, 2)) ), ...
sum( sqrt(sum(dL(:, 4:6).^2, 2)) )];
kappa = TF_lokappal(ndist);
% mean local kappa
cmkap = mean( sqrt(sum(kappa(2:end, 1:3).^2, 2)) );
% std local kappa
cskap = std( sqrt(sum(kappa(2:end, 1:3).^2, 2)) );
end
fprintf(fid, '%i, %e, %f, %f, %f\n', s, sigma(s), l, R, dL);
fprintf(fid, '%i, %e, %f, %f, %f, %f, %f, %f, %f, %f, %f, %f\n', ...
s, sigma(s), l, R, dl, mkap, skap, cmkap, cskap);
end
fclose(fid);
......
......@@ -80,10 +80,10 @@ xlabel('$\frac{t_\text{film}}{L}\,\left[10^{-3}\right]$')
ylabel('\raisebox{0.25em}{$\frac{l}{L}$\,[-]}')
% ylim([2 1.01])
% set(gca,'ytick',2:.5:4)
svgprint(get(gca, 'parent'), 'pics/pspacefailed')
% svgprint(get(gca, 'parent'), 'pics/pspacefailed')
% pspaceiso_eqstabs(X, Y, yvar, fname)
% % pspaceiso_eqstabs(X, Y, yvar, fname)
Y = msig(gidx);
figure
[c, bp] = hist(Y, 25);
......@@ -91,8 +91,8 @@ h = bar(bp, c);
set(h, 'facecolor', [.8 .8 .8], 'linestyle', 'none')
xlabel('$\max \sigma_x$\,[MPa]')
ylabel('count\,[-]')
svgprint(get(gca, 'parent'), 'pics/isospace_msig_fig')
pspaceiso_eqstabs(X(gidx, :), Y, '\max \sigma_x', 'isospace_msig');
% svgprint(get(gca, 'parent'), 'pics/isospace_msig_fig')
% pspaceiso_eqstabs(X(gidx, :), Y, '\max \sigma_x', 'isospace_msig');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -130,7 +130,7 @@ figure
plot(sigma, no, 'linewidth', 2)
xlabel('$\sigma_x$\,[MPa]')
ylabel('\# observations\,[-]')
svgprint(get(gca, 'parent'),'pics/pspaceiso_n')
% svgprint(get(gca, 'parent'),'pics/pspaceiso_n')
figure
imagesc(range, -sigma, htd)
......@@ -142,7 +142,7 @@ text(1/(2*pi), 0, '$\frac{1}{2\piup}$', 'color', [1 0 0], 'verticalalignment', '
xlabel('$\frac{l}{L}$\,[-]')
ylabel('$\sigma_x$\,[MPa]')
colormap(mjet); caxis([0 max(htd(:))]); colorbar
svgprint(get(gca, 'parent'), 'pics/isospace_lL_fig')
% svgprint(get(gca, 'parent'), 'pics/isospace_lL_fig')
for v = 1:9
......@@ -155,12 +155,12 @@ for v = 1:9
'r', 'linewidth', 2)
xlabel('\raisebox{-0.5em}{$\sigma_x$\,[MPa]}')
ylabel(strcat('\raisebox{1em}{',lbs{v},'}'))
svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_lL_a', num2str(v-1)))
% svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_lL_a', num2str(v-1)))
end
%%% analysis for l/L: sigma_x = 0.025
Y = l(gidx, end)./l(gidx, 1);
pspaceiso_eqstabs(X(gidx, :), Y, '\frac{l}{L}(\sigma_x = 0.025\,\text{MPa})', 'isospace_lL');
% pspaceiso_eqstabs(X(gidx, :), Y, '\frac{l}{L}(\sigma_x = 0.025\,\text{MPa})', 'isospace_lL');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -192,7 +192,7 @@ imagesc(range, -sigma, htd)
xlabel('$\lambda_L$\,[-]')
ylabel('$\sigma_x$\,[MPa]')
colormap(mjet); caxis([0 max(htd(:))]); colorbar
svgprint(get(gca, 'parent'), 'pics/isospace_dL_fig')
% svgprint(get(gca, 'parent'), 'pics/isospace_dL_fig')
for v = 1:9
ss = [sigma(2:size(cfl, 2)), flipdim(sigma(2:size(cfh, 2)), 2)];
......@@ -204,12 +204,12 @@ for v = 1:9
'r', 'linewidth', 2)
xlabel('\raisebox{-0.5em}{$\sigma_x$\,[MPa]}')
ylabel(strcat('\raisebox{1em}{',lbs{v},'}'))
svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_dL_a', num2str(v-1)))
% svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_dL_a', num2str(v-1)))
end
%%% analysis for lambda_L: sigma_x = 0.025
Y = dL(gidx, end)./dL(gidx, 1);
pspaceiso_eqstabs(X(gidx, :), Y, '\lambda_L(\sigma_x = 0.025\,\text{MPa})', 'isospace_dL');
% pspaceiso_eqstabs(X(gidx, :), Y, '\lambda_L(\sigma_x = 0.025\,\text{MPa})', 'isospace_dL');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
......@@ -241,7 +241,7 @@ imagesc(range, -sigma, htd)
xlabel('$\kappa_\varepsilon$\,[-]')
ylabel('$\sigma_x$\,[MPa]')
colormap(mjet); caxis([0 max(htd(:))]); colorbar
svgprint(get(gca, 'parent'), 'pics/isospace_dk_fig')
% svgprint(get(gca, 'parent'), 'pics/isospace_dk_fig')
for v = 1:9
ss = [sigma(2:size(cfl, 2)), flipdim(sigma(2:size(cfh, 2)), 2)];
......@@ -253,15 +253,15 @@ for v = 1:9
'r', 'linewidth', 2)
xlabel('\raisebox{-0.5em}{$\sigma_x$\,[MPa]}')
ylabel(strcat('\raisebox{1em}{',lbs{v},'}'))
svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_dk_a', num2str(v-1)))
% svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_dk_a', num2str(v-1)))
end
%%% analysis for delta kappa: sigma_x = 0.01
Y = sk(gidx, end)./mk(gidx, end);
pspaceiso_eqstabs(X(gidx, :), Y, '\kappa_\varepsilon(\sigma_x = 0.025\,\text{MPa})', 'isospace_dk');
% pspaceiso_eqstabs(X(gidx, :), Y, '\kappa_\varepsilon(\sigma_x = 0.025\,\text{MPa})', 'isospace_dk');
close all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% analysis for R * mean(kappa)
range = linspace(0.85, 1.25, 25);
......@@ -285,13 +285,29 @@ for y = 2:size(l, 2)
end
% histogram counts for overview
htd(y, :) = hist(Y, range);
% ny = Y(~isnan(Y)); ny = 10*(ny-0.8);
% rparam = fib_estdist('phi', ny, 'fibtype', 'rayleigh');
% eparam = fib_estdist('phi', ny, 'fibtype', 'extremev');
% figure
% % plot (nomalised) simulation angle histogram (convert to degrees)
% [n, bp] = fib_hist(ny);
% h = bar(bp, n/sum(n));
% set(h, 'facecolor', [.8 .8 .8], 'linestyle', 'none')
% hold on
% % plot (normalised) envelope of input distribution
% plot(bp, fib_gendist(rparam, 'rayleigh'), 'b', 'linewidth', 2)
% plot(bp, fib_gendist(eparam, 'extremev'), 'r', 'linewidth', 2)
%
% Rparam(y, 1:3) = rparam;
% Eparam(y, 1:3) = eparam;
end
figure
imagesc(range, -sigma, htd)
xlabel('$R_\varepsilon$\,[-]')
ylabel('$\sigma_x$\,[MPa]')
colormap(mjet); caxis([0 max(htd(:))]); colorbar
svgprint(get(gca, 'parent'), 'pics/isospace_dR_fig')
% svgprint(get(gca, 'parent'), 'pics/isospace_dR_fig')
for v = 1:9
ss = [sigma(2:size(cfl, 2)), flipdim(sigma(2:size(cfh, 2)), 2)];
......@@ -303,9 +319,9 @@ for v = 1:9
'r', 'linewidth', 2)
xlabel('\raisebox{-0.5em}{$\sigma_x$\,[MPa]}')
ylabel(strcat('\raisebox{1em}{',lbs{v},'}'))
svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_dR_a', num2str(v-1)))
% svgprint(get(gca, 'parent'), strcat('pics/pspaceiso_dR_a', num2str(v-1)))
end
% analysis for R * mean(kappa) @ sigma_x = 0.025
Y = R(gidx, end).*mk(gidx, end);
pspaceiso_eqstabs(X(gidx, :), Y, 'R_\varepsilon(\sigma_x = 0.025\,\text{MPa})', 'isospace_dR');
% pspaceiso_eqstabs(X(gidx, :), Y, 'R_\varepsilon(\sigma_x = 0.025\,\text{MPa})', 'isospace_dR');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment