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
fce1407c
Commit
fce1407c
authored
4 years ago
by
Lars Hubatsch
Browse files
Options
Downloads
Patches
Plain Diff
Change signature of int_prob. SS jump lengths work in both directions.
parent
6e3ece96
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prob_laplace.m
+13
-10
13 additions, 10 deletions
prob_laplace.m
with
13 additions
and
10 deletions
prob_laplace.m
+
13
−
10
View file @
fce1407c
...
@@ -189,10 +189,11 @@ end
...
@@ -189,10 +189,11 @@ end
%% %%%%%%%%%%%%%%%%% STEADY STATE JUMP LENGTH DISTRIBUTION %%%%%%%%%%%%%%%%
%% %%%%%%%%%%%%%%%%% STEADY STATE JUMP LENGTH DISTRIBUTION %%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
params
=
{
-
5
,
b
(
7.7
/
3
,
10
^-
6
),
0.5
,
e
(
7.7
/
3
),
0
,
1
,
10
,
7
,
0
,
'Constituent'
};
params
=
{
-
5
,
b
(
7.7
/
3
,
10
^-
6
),
0.5
,
e
(
7.7
/
3
),
0
,
1
,
10
,
7
,
0
,
...
'Constituent'
,
0
};
t
=
[
0
,
0.05
,
0.1
,
1
];
t
=
[
0
,
0.05
,
0.1
,
1
];
direc
=
-
1
;
direc
=
1
;
x0
=
sort
(
5
-
direc
*
(
0
:
0.00
2
:
3.01
));
x0
=
sort
(
5
-
direc
*
(
0
:
0.00
1
:
3.01
));
%% Run simulations for 'delta' IC across outside
%% Run simulations for 'delta' IC across outside
T
=
{};
T
=
{};
parfor
i
=
1
:
length
(
x0
)
parfor
i
=
1
:
length
(
x0
)
...
@@ -204,15 +205,17 @@ parfor i = 1:length(x0)
...
@@ -204,15 +205,17 @@ parfor i = 1:length(x0)
end
end
% save prob_laplace_X_7_7_short_2
% save prob_laplace_X_7_7_short_2
%% Calculate probabilities for each jump length in ls.
%% Calculate probabilities for each jump length in ls.
ls
=
0.000
5
:
0.00
5
:
3
;
ls
=
-
direc
*
(
0.000
:
0.00
1
:
3
)
;
p
=
nan
(
1
,
length
(
ls
));
p
=
nan
(
1
,
length
(
ls
));
tic
tic
parfor
i
=
1
:
length
(
ls
)
parfor
i
=
1
:
length
(
ls
)
p
(
i
)
=
int_prob
(
ls
(
i
),
T
,
x0
,
direc
,
4
,
5
);
tic
p
(
i
)
=
int_prob
(
ls
(
i
),
T
,
x0
,
direc
,
3
,
5
,
0
);
toc
end
end
toc
toc
%% Normalization factor
%% Normalization factor
N
=
normalization
(
T
,
x0
,
0
,
4
);
N
=
normalization
(
T
,
x0
,
0
,
3
);
%% Do we need to look at the left side as well?
%% Do we need to look at the left side as well?
figure
;
hold
on
;
figure
;
hold
on
;
plot
(
ls
,
p
/
N
);
plot
(
ls
,
p
/
N
);
...
@@ -293,7 +296,7 @@ for j = 1:n_T
...
@@ -293,7 +296,7 @@ for j = 1:n_T
F1
=
F
(:,
j
);
F1
=
F
(:,
j
);
bp
=
bound
(
j
);
bp
=
bound
(
j
);
for
i
=
1
:
length
(
ls
)
for
i
=
1
:
length
(
ls
)
p
(
i
,
j
)
=
int_prob
(
ls
(
i
),
F1
,
x0
(
j
,
:),
direc
,
j
,
bp
,
T_mov
,
10
);
p
(
i
,
j
)
=
int_prob
(
ls
(
i
),
F1
,
x0
(
j
,
:),
direc
,
j
,
bp
,
10
,
T_mov
);
end
end
toc
toc
end
end
...
@@ -377,7 +380,7 @@ p = nan(length(ls), n_T);
...
@@ -377,7 +380,7 @@ p = nan(length(ls), n_T);
for
j
=
1
:
n_T
for
j
=
1
:
n_T
tic
tic
parfor
i
=
1
:
length
(
ls
)
parfor
i
=
1
:
length
(
ls
)
p
(
i
,
j
)
=
int_prob
(
ls
(
i
),
F
,
x0
,
direc
,
j
,
bp
,
T_mov
,
5
);
p
(
i
,
j
)
=
int_prob
(
ls
(
i
),
F
,
x0
,
direc
,
j
,
bp
,
5
,
T_mov
);
end
end
toc
toc
end
end
...
@@ -388,7 +391,7 @@ csvwrite('prob_in_out.csv', p);
...
@@ -388,7 +391,7 @@ csvwrite('prob_in_out.csv', p);
%% %%%%%%%%%%%%%%%%%%% INTEGRATION FUNCTION DEFINITIONS %%%%%%%%%%%%%%%%%%%
%% %%%%%%%%%%%%%%%%%%% INTEGRATION FUNCTION DEFINITIONS %%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function
p
=
int_prob
(
l
,
T
,
x0
,
direc
,
ind_t
,
bp
,
T_mov
,
ind_delta
)
function
p
=
int_prob
(
l
,
T
,
x0
,
direc
,
ind_t
,
bp
,
ind_delta
,
T_mov
)
% direc ... change direction of jumps, 1: left->right, -1: right->left
% direc ... change direction of jumps, 1: left->right, -1: right->left
% ind_t ... time index at which propagators are evaluated
% ind_t ... time index at which propagators are evaluated
% bp ... boundary position at t==ind_t
% bp ... boundary position at t==ind_t
...
@@ -400,7 +403,7 @@ for i = 1:length(delta_x0)
...
@@ -400,7 +403,7 @@ for i = 1:length(delta_x0)
corr_starting_point
=
direc
*
x
<
direc
*
bp
;
corr_starting_point
=
direc
*
x
<
direc
*
bp
;
corr_end_point
=
direc
*
(
x
-
l
)
>
direc
*
(
bp
-
T
{
i
}
.
v
*
T
{
1
}
.
t
(
ind_delta
+
1
));
corr_end_point
=
direc
*
(
x
-
l
)
>
direc
*
(
bp
-
T
{
i
}
.
v
*
T
{
1
}
.
t
(
ind_delta
+
1
));
if
corr_starting_point
&&
corr_end_point
if
corr_starting_point
&&
corr_end_point
if
nargin
==
6
if
nargin
==
7
p_i
=
@
(
j
)
interp1
(
T
{
j
}
.
x
,
T
{
j
}
.
sol
(
ind_t
,
:),
x
-
l
);
p_i
=
@
(
j
)
interp1
(
T
{
j
}
.
x
,
T
{
j
}
.
sol
(
ind_t
,
:),
x
-
l
);
p2
=
(
p_i
(
i
)
+
p_i
(
i
+
1
))/
2
;
p2
=
(
p_i
(
i
)
+
p_i
(
i
+
1
))/
2
;
% @ SS distribution for x0 can be taken from phi_tot
% @ SS distribution for x0 can be taken from phi_tot
...
...
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