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
c1ea8c32
Commit
c1ea8c32
authored
4 years ago
by
Lars Hubatsch
Browse files
Options
Downloads
Patches
Plain Diff
Unifying sweep for distance from coverslip. New default for phi_tot_out.
parent
166f23fc
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
@Ternary_model/plot_sim.m
+1
-1
1 addition, 1 deletion
@Ternary_model/plot_sim.m
Half_Frap_Phi_u.ipynb
+18
-12
18 additions, 12 deletions
Half_Frap_Phi_u.ipynb
fem_sol.py
+1
-1
1 addition, 1 deletion
fem_sol.py
with
20 additions
and
14 deletions
@Ternary_model/plot_sim.m
+
1
−
1
View file @
c1ea8c32
...
...
@@ -30,7 +30,7 @@ elseif strcmp(mode, 'plot')
ax
=
gca
;
ax
.
FontSize
=
26
;
xlabel
(
'x [\mum]'
);
ylabel
(
'volume fraction'
);
plot
(
T
.
x
,
T
.
sol
(
1
:
nth
:
si
(
1
),
:),
'LineWidth'
,
1
,
'Color'
,
color
);
plot
(
T
.
x
,
T
.
sol
(
[
1
,
2
:
nth
:
si
(
1
)
]
,
:),
'LineWidth'
,
1
,
'Color'
,
color
);
% plot(T.x, T.sol(nth, :), 'LineWidth', 1, 'Color', color);
plot
(
T
.
x
,
Ternary_model
.
phi_tot
(
T
.
x
,
T
.
a
,
T
.
b
,
T
.
e
,
T
.
u0
),
...
'LineWidth'
,
1
,
'LineStyle'
,
'--'
,
'Color'
,
[
0.97
,
0.55
,
0.03
]);
...
...
This diff is collapsed.
Click to expand it.
Half_Frap_Phi_u.ipynb
+
18
−
12
View file @
c1ea8c32
...
...
@@ -64,7 +64,7 @@
"f_i = []\n",
"for j in range(len(m)):\n",
" f = frap_solver([4, 4, 0.5], m[j], name=str(j), point_list=point_lists[j],\n",
" T=
3
)\n",
" T=
50, phi_tot_int=0.99, phi_tot_ext=0.01
)\n",
" f.solve_frap()\n",
" f_i.append(f)"
]
...
...
@@ -94,15 +94,18 @@
"outputs": [],
"source": [
"f_0 = frap_solver([4, 4, 0.5], 'Meshes/single_drop_coverslip.xml',\n",
" name='FRAP_coverslip', T=300, phi_tot_ext=0.001)\n",
" name='FRAP_coverslip', T=50, phi_tot_int=0.99,\n",
" phi_tot_ext=0.01)\n",
"f_0.solve_frap()\n",
"\n",
"f_1 = frap_solver([4, 4, 1.5], 'Meshes/single_drop_1_5.xml',\n",
" name='FRAP_symmetric', T=300, phi_tot_ext=0.001)\n",
" name='FRAP_symmetric', T=50, phi_tot_int=0.99,\n",
" phi_tot_ext=0.01)\n",
"f_1.solve_frap()\n",
"\n",
"f_2 = frap_solver([4, 4, 4], 'Meshes/single_drop_symmetric.xml',\n",
" name='FRAP_symmetric', T=300, phi_tot_ext=0.001)\n",
" name='FRAP_symmetric', T=50, phi_tot_int=0.99,\n",
" phi_tot_ext=0.01)\n",
"f_2.solve_frap()"
]
},
...
...
@@ -113,15 +116,18 @@
"outputs": [],
"source": [
"f_3 = frap_solver([4, 4, 0.5], 'Meshes/single_drop_coverslip.xml',\n",
" name='FRAP_symmetric', T=100, phi_tot_ext=0.01)\n",
" name='FRAP_symmetric', T=50, G_in=0.1, G_out=0.99/0.9,\n",
" phi_tot_int=0.9, phi_tot_ext=0.1)\n",
"f_3.solve_frap()\n",
"\n",
"f_4 = frap_solver([4, 4, 1.5], 'Meshes/single_drop_1_5.xml',\n",
" name='FRAP_symmetric', T=100, phi_tot_ext=0.01)\n",
" name='FRAP_symmetric', T=50, G_in=0.1, G_out=0.99/0.9,\n",
" phi_tot_int=0.9, phi_tot_ext=0.1)\n",
"f_4.solve_frap()\n",
"\n",
"f_5 = frap_solver([4, 4, 4], 'Meshes/single_drop_symmetric.xml',\n",
" name='FRAP_symmetric', T=100, phi_tot_ext=0.01)\n",
" name='FRAP_symmetric', T=50, G_in=0.1, G_out=0.99/0.9,\n",
" phi_tot_int=0.9, phi_tot_ext=0.1)\n",
"f_5.solve_frap()"
]
},
...
...
@@ -134,12 +140,12 @@
"plt.plot([np.mean(x[1:49])/0.99 for x in f_0.cs], label='dist=0.5')\n",
"plt.plot([np.mean(x[1:49])/0.99 for x in f_1.cs], label='dist=1.5')\n",
"plt.plot([np.mean(x[1:49])/0.99 for x in f_2.cs], label='dist=4')\n",
"plt.plot([np.mean(x[1:49])/0.9
9
for x in f_3.cs], label='dist=0.5, G_out=10')\n",
"plt.plot([np.mean(x[1:49])/0.9
9
for x in f_4.cs], label='dist=1.5, G_out=10')\n",
"plt.plot([np.mean(x[1:49])/0.9
9
for x in f_5.cs], label='dist=4, G_out=10')\n",
"plt.plot(range(0,
30
0), np.ones(
30
0), linestyle='--', color='k')\n",
"plt.plot([np.mean(x[1:49])/0.9 for x in f_3.cs], label='dist=0.5, G_out=10')\n",
"plt.plot([np.mean(x[1:49])/0.9 for x in f_4.cs], label='dist=1.5, G_out=10')\n",
"plt.plot([np.mean(x[1:49])/0.9 for x in f_5.cs], label='dist=4, G_out=10')\n",
"plt.plot(range(0,
5
0), np.ones(
5
0), linestyle='--', color='k')\n",
"plt.ylim((0, 1.1))\n",
"plt.xlim((0,
30
0))\n",
"plt.xlim((0,
5
0))\n",
"make_graph_pretty('t (a.u.)', 'intensity (a.u)', loc=4)"
]
},
...
...
%% Cell type:markdown id: tags:
### FRAP geometries
%% Cell type:code id: tags:
```
python
from
fem_sol
import
frap_solver
import
matplotlib.pyplot
as
plt
import
numpy
as
np
```
%% Cell type:code id: tags:
```
python
font
=
{
'
family
'
:
'
normal
'
,
'
weight
'
:
'
normal
'
,
'
size
'
:
12
}
import
matplotlib
matplotlib
.
rc
(
'
font
'
,
**
font
)
def
make_graph_pretty
(
xlab
,
ylab
,
loc
=
0
,
markerfirst
=
True
,
handlelength
=
None
):
color1
=
'
black
'
#'darkorange'
color2
=
(
0
,
0
,
0
)
color2
=
(
1
,
1
,
1
)
ax
=
plt
.
gca
()
ax
.
tick_params
(
axis
=
'
x
'
,
colors
=
color1
,
which
=
'
both
'
)
ax
.
tick_params
(
axis
=
'
y
'
,
colors
=
color1
,
which
=
'
both
'
)
plt
.
xlabel
(
xlab
,
color
=
color1
)
plt
.
ylabel
(
ylab
,
color
=
color1
)
ax
.
spines
[
'
left
'
].
set_color
(
color1
)
ax
.
spines
[
'
bottom
'
].
set_color
(
color1
)
# Hide the right and top spines
ax
.
spines
[
'
right
'
].
set_visible
(
False
)
ax
.
spines
[
'
top
'
].
set_visible
(
False
)
ax
.
set_facecolor
(
color2
)
plt
.
gcf
().
subplots_adjust
(
bottom
=
0.17
,
left
=
0.15
)
plt
.
legend
(
frameon
=
False
,
loc
=
loc
,
labelspacing
=
0.1
,
markerfirst
=
markerfirst
,
handlelength
=
handlelength
)
```
%% Cell type:code id: tags:
```
python
m
=
[
'
Meshes/multi_drop_gauss.xml
'
,
'
Meshes/multi_drop_gauss_med.xml
'
,
'
Meshes/multi_drop_gauss_far.xml
'
]
point_lists
=
[[[
4
,
4.5
,
0.5
],
[
4
,
3.5
,
0.5
],
[
3.5
,
4
,
0.5
],
[
4.5
,
4
,
0.5
]],
[[
4
,
5
,
0.5
],
[
4
,
3
,
0.5
],
[
3
,
4
,
0.5
],
[
5
,
4
,
0.5
]],
[[
4
,
5.5
,
0.5
],
[
4
,
2.5
,
0.5
],
[
2.5
,
4
,
0.5
],
[
5.5
,
4
,
0.5
]]]
f_i
=
[]
for
j
in
range
(
len
(
m
)):
f
=
frap_solver
([
4
,
4
,
0.5
],
m
[
j
],
name
=
str
(
j
),
point_list
=
point_lists
[
j
],
T
=
3
)
T
=
50
,
phi_tot_int
=
0.99
,
phi_tot_ext
=
0.01
)
f
.
solve_frap
()
f_i
.
append
(
f
)
```
%% Cell type:code id: tags:
```
python
for
i
in
range
(
len
(
cs
[
0
])):
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.8
for
x
in
cs
[
0
][
0
:
i
]],
label
=
'
dist=0.5
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.8
for
x
in
cs
[
1
][
0
:
i
]],
label
=
'
dist=1
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.8
for
x
in
cs
[
2
][
0
:
i
]],
label
=
'
dist=1.5
'
)
plt
.
plot
(
range
(
0
,
100
),
np
.
ones
(
100
),
linestyle
=
'
--
'
,
color
=
'
k
'
)
plt
.
ylim
((
0
,
1.1
))
plt
.
xlim
((
0
,
100
))
make_graph_pretty
(
'
t (a.u.)
'
,
'
intensity (a.u)
'
,
loc
=
4
)
# plt.savefig('img_'+str(i)+'.png', dpi=300)
plt
.
show
()
```
%% Cell type:code id: tags:
```
python
f_0
=
frap_solver
([
4
,
4
,
0.5
],
'
Meshes/single_drop_coverslip.xml
'
,
name
=
'
FRAP_coverslip
'
,
T
=
300
,
phi_tot_ext
=
0.001
)
name
=
'
FRAP_coverslip
'
,
T
=
50
,
phi_tot_int
=
0.99
,
phi_tot_ext
=
0.01
)
f_0
.
solve_frap
()
f_1
=
frap_solver
([
4
,
4
,
1.5
],
'
Meshes/single_drop_1_5.xml
'
,
name
=
'
FRAP_symmetric
'
,
T
=
300
,
phi_tot_ext
=
0.001
)
name
=
'
FRAP_symmetric
'
,
T
=
50
,
phi_tot_int
=
0.99
,
phi_tot_ext
=
0.01
)
f_1
.
solve_frap
()
f_2
=
frap_solver
([
4
,
4
,
4
],
'
Meshes/single_drop_symmetric.xml
'
,
name
=
'
FRAP_symmetric
'
,
T
=
300
,
phi_tot_ext
=
0.001
)
name
=
'
FRAP_symmetric
'
,
T
=
50
,
phi_tot_int
=
0.99
,
phi_tot_ext
=
0.01
)
f_2
.
solve_frap
()
```
%% Cell type:code id: tags:
```
python
f_3
=
frap_solver
([
4
,
4
,
0.5
],
'
Meshes/single_drop_coverslip.xml
'
,
name
=
'
FRAP_symmetric
'
,
T
=
100
,
phi_tot_ext
=
0.01
)
name
=
'
FRAP_symmetric
'
,
T
=
50
,
G_in
=
0.1
,
G_out
=
0.99
/
0.9
,
phi_tot_int
=
0.9
,
phi_tot_ext
=
0.1
)
f_3
.
solve_frap
()
f_4
=
frap_solver
([
4
,
4
,
1.5
],
'
Meshes/single_drop_1_5.xml
'
,
name
=
'
FRAP_symmetric
'
,
T
=
100
,
phi_tot_ext
=
0.01
)
name
=
'
FRAP_symmetric
'
,
T
=
50
,
G_in
=
0.1
,
G_out
=
0.99
/
0.9
,
phi_tot_int
=
0.9
,
phi_tot_ext
=
0.1
)
f_4
.
solve_frap
()
f_5
=
frap_solver
([
4
,
4
,
4
],
'
Meshes/single_drop_symmetric.xml
'
,
name
=
'
FRAP_symmetric
'
,
T
=
100
,
phi_tot_ext
=
0.01
)
name
=
'
FRAP_symmetric
'
,
T
=
50
,
G_in
=
0.1
,
G_out
=
0.99
/
0.9
,
phi_tot_int
=
0.9
,
phi_tot_ext
=
0.1
)
f_5
.
solve_frap
()
```
%% Cell type:code id: tags:
```
python
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.99
for
x
in
f_0
.
cs
],
label
=
'
dist=0.5
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.99
for
x
in
f_1
.
cs
],
label
=
'
dist=1.5
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.99
for
x
in
f_2
.
cs
],
label
=
'
dist=4
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.9
9
for
x
in
f_3
.
cs
],
label
=
'
dist=0.5, G_out=10
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.9
9
for
x
in
f_4
.
cs
],
label
=
'
dist=1.5, G_out=10
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.9
9
for
x
in
f_5
.
cs
],
label
=
'
dist=4, G_out=10
'
)
plt
.
plot
(
range
(
0
,
30
0
),
np
.
ones
(
30
0
),
linestyle
=
'
--
'
,
color
=
'
k
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.9
for
x
in
f_3
.
cs
],
label
=
'
dist=0.5, G_out=10
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.9
for
x
in
f_4
.
cs
],
label
=
'
dist=1.5, G_out=10
'
)
plt
.
plot
([
np
.
mean
(
x
[
1
:
49
])
/
0.9
for
x
in
f_5
.
cs
],
label
=
'
dist=4, G_out=10
'
)
plt
.
plot
(
range
(
0
,
5
0
),
np
.
ones
(
5
0
),
linestyle
=
'
--
'
,
color
=
'
k
'
)
plt
.
ylim
((
0
,
1.1
))
plt
.
xlim
((
0
,
30
0
))
plt
.
xlim
((
0
,
5
0
))
make_graph_pretty
(
'
t (a.u.)
'
,
'
intensity (a.u)
'
,
loc
=
4
)
```
%% Cell type:code id: tags:
```
python
plt
.
plot
(
np
.
transpose
(
f_3
.
cs
))
```
%% Cell type:code id: tags:
```
python
```
...
...
This diff is collapsed.
Click to expand it.
fem_sol.py
+
1
−
1
View file @
c1ea8c32
...
...
@@ -28,7 +28,7 @@ def point_expr(p_c, p_list, phi_tot_int, phi_tot_ext, phi_init,
class
frap_solver
:
def
__init__
(
self
,
cent_poin
,
mesh
,
tol
=
1E-14
,
dt
=
0.1
,
G_in
=
1
,
G_out
=
1
,
name
=
'
FRAP
'
,
phi_tot_int
=
0.99
,
phi_tot_ext
=
0.
0
01
,
G_out
=
1
,
name
=
'
FRAP
'
,
phi_tot_int
=
0.99
,
phi_tot_ext
=
0.01
,
phi_tot_initial
=
0
,
point_list
=
[],
rad_drop
=
0.25
,
T
=
100
):
'''
Initialise solver
...
...
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