-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjon_justification.m
More file actions
83 lines (69 loc) · 1.73 KB
/
jon_justification.m
File metadata and controls
83 lines (69 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
clear;close all;clc;
addpath('../IMRv2/src/forward_solver')
expDataPrep
radial = 2;
stress = 1; % 1: models 1,2,3; 2: models 4,6; 3: models 5,7
bubtherm = 1;
medtherm = 0;
masstrans = 1;
vapor = 1;
Nt = 100;
Mt = 100;
tvector = linspace(0,tvector(end),500);
[t, R, U, p,~,~,~,S] = f_imr_fd('radial', radial, 'stress', stress, ...
'bubtherm', bubtherm, 'medtherm', medtherm, ...
'masstrans', masstrans, 'vapor', vapor, 'tvector', tvector, ...
'r0', R0, 'req', Req, 'mu', 1e-1, 'g', 1e4, 'lambda1', 0, ...
'lambda2', 0, 'alphax', 0, 'collapse', 0, 'nt', Nt, 'mt', Mt);
strainRate = -2*U./R;
strain = log(R./(Req/R0));
stress = S;
%%
figure;
% Left y-axis
yyaxis left
plot(S, -2*U./R, 'b', 'LineWidth', 1.5);
ylabel('strain rate');
xlabel('stress');
grid on;
% Right y-axis
yyaxis right
plot(S, log(R./(Req/R0)), 'r', 'LineWidth', 1.5);
ylabel('strain');
% Title and legend
legend({'strain rate', 'strain'}, 'Location', 'best');
%%
figure; hold on;
plot(t,stress./max(abs(stress)));
plot(t,strain./max(abs(strain)));
plot(t,strainRate./max(abs(strainRate)));
legend('stress','strain','strainRate')
%%
figure; hold on;
% plot(t,stress);
% plot(t,strain);
plot(strain,strainRate,'k','LineWidth',1)
% plot(t,strainRate);
% legend('stress','strain','strainRate')
%%
close all;
G = 1e4;
mu = 1e-1;
S_G = (-G/2).*(5-((Req/R0)./R).^4-4*((Req/R0)./R));
S_mu = -4*mu.*U./R;
threshold = 1e5;
Stotal = S_G + S_mu;
filter = nan(size(Stotal));
for i = 1:length(Stotal)
if (abs(strainRate(i))/mean(tc)>threshold)
filter(i) = 1;
end
if (abs(strain(i)) > 0.1*2.5)
filter(i) = 1;
end
end
Stotal_filter = Stotal.*filter;
figure; hold on;
plot(t,Stotal,'k')
plot(t,Stotal_filter,'rs')
legend('total','filter')