Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Frap Theory
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hubatsch
Frap Theory
Commits
5ed22c24
Commit
5ed22c24
authored
4 years ago
by
Lars Hubatsch
Browse files
Options
Downloads
Patches
Plain Diff
Cosmetic changes.
parent
24868c99
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
int_prob.m
+26
-11
26 additions, 11 deletions
int_prob.m
prob_laplace.m
+14
-11
14 additions, 11 deletions
prob_laplace.m
with
40 additions
and
22 deletions
int_prob.m
+
26
−
11
View file @
5ed22c24
...
...
@@ -3,8 +3,12 @@ function p = int_prob(l, T, x0, direc, ind_t, bp, ind_delta, lb, T_mov)
% 2: left->left, -2: right->right
% ind_t ... time index at which propagators are evaluated
% bp ... boundary position at t==ind_t
<<<<<<<
Updated
upstream
% lb ... distance from boundary not to take into account
=======
ss
=
T
{
1
}
.
system_size
;
>>>>>>>
Stashed
changes
delta_x0
=
diff
(
x0
);
p
=
0
;
for
i
=
1
:
length
(
delta_x0
)
...
...
@@ -12,6 +16,7 @@ for i = 1:length(delta_x0)
% 1. cond.: corr. starting point? 2. cond: jumped outside of domain?
corr_starting_point
=
direc
*
x
<
direc
*
bp
-
lb
;
if
abs
(
direc
)
==
1
% jump across the boundary?
<<<<<<<
Updated
upstream
corr_end_point
=
direc
*
(
x
-
l
)
>
direc
*
(
bp
-
T
{
i
}
.
v
*
T
{
1
}
.
t
(
ind_delta
+
1
))
+
lb
;
elseif
abs
(
direc
)
==
2
% jump within the same phase?
if
lb
~=
0
...
...
@@ -25,8 +30,22 @@ for i = 1:length(delta_x0)
else
if
(
x
+
l
<
T
{
1
}
.
system_size
);
right
=
1
;
else
;
right
=
0
;
end
if
(
x
-
l
>
bp
);
left
=
1
;
else
;
left
=
0
;
end
=======
corr_end_point
=
direc
*
(
x
-
l
)
>
direc
*
(
bp
-
T
{
i
}
.
v
*
T
{
1
}
.
t
(
ind_delta
+
1
));
elseif
direc
==
2
% jump left -> left
if
l
<
0
&&
x
-
l
<
bp
;
corr_end_point
=
1
;
else
;
corr_end_point
=
0
;
end
if
l
>
0
% jump to left
corr_end_point
=
1
;
if
x
-
l
<
0
;
x
=
l
-
x
;
end
% reflecting boundary if jump out left
end
elseif
direc
==
-
2
% jump right -> right
if
l
>
0
&&
x
-
l
>
bp
;
corr_end_point
=
1
;
else
;
corr_end_point
=
0
;
end
if
l
<
0
% jump to right
corr_end_point
=
1
;
% Reflecting boundary if jumping out on right side of system
if
x
-
l
>
ss
;
x
=
2
*
ss
+
l
-
x
;
end
>>>>>>>
Stashed
changes
end
corr_end_point
=
left
||
right
;
% consider, if left or right works
end
if
corr_starting_point
&&
corr_end_point
if
nargin
==
8
...
...
@@ -40,17 +59,13 @@ for i = 1:length(delta_x0)
T
{
1
}
.
phi_tot
(
x
,
T
{
1
}
.
a
,
T
{
1
}
.
b
,
T
{
1
}
.
e
,
T
{
1
}
.
u0
,
0
)
*
p2
;
elseif
nargin
==
9
if
abs
(
direc
)
==
1
p_i
=
@
(
j
)
interp1
(
T
{
j
}
.
x
,
T
{
j
}
.
sol
(
ind_delta
+
1
,
:),
x
-
l
);
elseif
abs
(
direc
)
==
2
x_l
=
x
-
l
;
% left position
x_r
=
x
+
l
;
% right position
if
x
-
l
<
0
;
x_temp
=
l
-
x
;
end
% -> jump reflected if necess.
if
x
+
l
>
T
{
1
}
.
system_size
;
x_temp
=
2
*
T
{
1
}
.
system_size
-
x
-
l
;
end
p_i
=
@
(
j
)
interp1
(
T
{
j
}
.
x
,
T
{
j
}
.
sol
(
ind_delta
+
1
,
:),
...
x_l
)
*
left
+
...
interp1
(
T
{
j
}
.
x
,
T
{
j
}
.
sol
(
ind_delta
+
1
,
:),
...
x_r
)
*
right
;
x_ev
=
x
-
l
;
elseif
direc
==
2
% left -> left
if
l
>
0
&&
x
-
l
<
0
;
x_ev
=
l
-
x
;
else
;
x_ev
=
x
-
l
;
end
elseif
direc
==
-
2
% right -> right
if
l
<
0
&&
x
+
l
>
ss
;
x_ev
=
2
*
ss
+
l
-
x
;
else
;
x_ev
=
x
-
l
;
end
end
p_i
=
@
(
j
)
interp1
(
T
{
j
}
.
x
,
T
{
j
}
.
sol
(
ind_delta
+
1
,
:),
x_ev
);
p2
=
(
p_i
(
i
)
+
p_i
(
i
+
1
))/
2
;
p_sol
=
@
(
j
)
interp1
(
T_mov
.
x
,
T_mov
.
sol
(
ind_t
,
:),
x
);
% p_sol2 = T{1}.phi_tot(x, T{1}.a, T{1}.b, T{1}.e, T{1}.u0, 0);
...
...
This diff is collapsed.
Click to expand it.
prob_laplace.m
+
14
−
11
View file @
5ed22c24
...
...
@@ -6,6 +6,9 @@ e = @(chi) sqrt(3/8*(chi-2));
t
=
linspace
(
0.0
,
0.001
,
11
);
% t=0.01;
% t = logspace(-4, -2, 20);
% Folders
next
=
'/home/hubatsch/Nextcloud/'
;
mac_next
=
'/Users/hubatsch/Nextcloud/'
;
%% Comparison with Python
T1
=
Ternary_model
(
0
,
'FRAP'
,
{
-
0.1
,
b
(
7
/
3
,
10
^-
12
),
0.5
,
0.4
,
...
0
,
1
,
300
,
7
,
0
,
'Constituent'
,
0
},
...
...
...
@@ -65,8 +68,8 @@ for i = 1:length(fac)
e
,
e_g
,
u_g
,
300
,
7
,
0
,
'Constituent'
},
...
t
,
2
);
% T_prec(i) = Ternary_model(2, 'FRAP', {-1, b(7.7/3, 10^-5), u0, ...
% e(7.7/3), e_g, u_g, 300, 7, 0,
'Constituent'},
...
% t, 0.2);
% e(7.7/3), e_g, u_g, 300, 7, 0,...
%
'Constituent'},
t, 0.2);
T_prec
(
i
)
.
solve_tern_frap
()
end
...
...
@@ -86,9 +89,9 @@ Gi = 1;%(1-Tpt1.phi_t(1))/(1-Tpt1.phi_t(1));
Go
=
Tpt1
.
phi_t
(
end
)/
Tpt1
.
phi_t
(
1
)
*
2
;
%%
for
i
=
1
:
1
%length(prec)
Tga1
(
i
)
=
Ternary_model
(
2
,
'FRAP'
,
{
-
1
,
b
(
7
/
3
,
10
^-
12
),
Tpt1
(
i
)
.
phi_t
(
1
),
...
0
,
-
0.83
,
Gi
,
300
,
7
,
0
,
...
'Constituent'
},
...
Tga1
(
i
)
=
Ternary_model
(
2
,
'FRAP'
,
{
-
1
,
b
(
7
/
3
,
10
^-
12
),
...
Tpt1
(
i
)
.
phi_t
(
1
),
0
,
-
0.83
,
Gi
,
...
300
,
7
,
0
,
'Constituent'
},
...
t
,
prec
(
i
));
Tga1
(
i
)
.
x
=
Tpt1
(
i
)
.
x
;
Tga1
(
i
)
.
solve_tern_frap
();
...
...
@@ -230,7 +233,7 @@ sum((T{1}.sol(1, 1:end-1)+T{1}.sol(1, 2:end))/2.*diff(T{1}.x))
% figure; hold on;
plot
(
ls
,
p
/
N
);
%% Write to file
cd
/
Users
/
hubatsch
/
Nextcloud
/
Langevin_vs_MeanField
/
Data_Figs_FokkPla
/
jump_length
/
cd
([
next_mac
,
'
Langevin_vs_MeanField/Data_Figs_FokkPla/jump_length/
'
]);
csvwrite
(
'jump_length_7_7_lb01.csv'
,
ls
)
csvwrite
(
'prob_7_7_lb01.csv'
,
p
);
...
...
@@ -422,9 +425,9 @@ for j = 1:n_T
end
toc
end
% csvwrite(
'/home/hubatsch/Nextcloud/
jump_length_mov_bound_in_out.csv', [-ls', sum(p, 2)])
% csvwrite(
'/home/hubatsch/Nextcloud/
jump_length_mov_bound_out_in.csv', [ls', sum(p, 2)])
next
=
'/home/hubatsch/Nextcloud/'
;
% csvwrite(
[next, '
jump_length_mov_bound_in_out.csv'
]
, [-ls', sum(p, 2)])
% csvwrite(
[next, '
jump_length_mov_bound_out_in.csv', [ls', sum(p, 2)])
%% %%%%%%%%%%%%%%%%%%%%%% FRAP TIME COURSE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t
=
linspace
(
0
,
5
,
300
);
...
...
@@ -592,6 +595,6 @@ dudx = diff(Temp.sol(t_ind, :))./diff(Temp.x);
x
=
(
Temp
.
x
(
1
:
end
-
1
)
+
Temp
.
x
(
2
:
end
))/
2
;
sol
=
(
Temp
.
sol
(
t_ind
,
1
:
end
-
1
)
+
Temp
.
sol
(
t_ind
,
2
:
end
))/
2
;
[
~
,
flux
,
~
,
g0
,
pt
]
=
flory_hugg_pde
(
x
,
0
,
sol
,
dudx
,
Temp
.
a
,
Temp
.
b
,
Temp
.
e
,
...
Temp
.
u0
,
Temp
.
e_g0
,
Temp
.
u_g0
,
Temp
.
v
,
Temp
.
mode
);
[
~
,
flux
,
~
,
g0
,
pt
]
=
flory_hugg_pde
(
x
,
0
,
sol
,
dudx
,
Temp
.
a
,
Temp
.
b
,
...
Temp
.
e
,
Temp
.
u0
,
Temp
.
e_g0
,
Temp
.
u_g0
,
Temp
.
v
,
Temp
.
mode
);
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment