Skip to content
Snippets Groups Projects
Commit 3a5d8f3a authored by Lars Hubatsch's avatar Lars Hubatsch
Browse files

Cut off boundary from intregration via lb works. No norm yet.

parent 982035ee
No related branches found
No related tags found
No related merge requests found
......@@ -10,3 +10,4 @@
*.msh
*.txt
*.mat
*.csv
......@@ -3,7 +3,7 @@ function create_mesh(T)
% Mesh density larger for steeper gradients.
% Start with left side of mesh, at r=0/x=0, with a given step size
x = [0, 0.01/T.precision];
x = [0, 0.01/T.precision];%/10
while x<-2*T.a
x_temp = x(end)-x(end-1);
......
......@@ -19,7 +19,7 @@ if strcmp(mode, 'mov')
plot(T.x, T.sol(i, :), 'LineWidth', 2);
text(abs(-T.a+2), 0.7, num2str(T.t(i)));
shg
pause();
% pause();
% print([num2str(i),'.png'],'-dpng')
end
elseif strcmp(mode, 'plot')
......
......@@ -116,7 +116,7 @@ save prob_laplace_X_7_7_short_2
ls = 0.0005:0.005:2;
p = nan(1, length(ls));
parfor i = 1:length(ls)
p(i) = int_prob(ls(i), T, x0);
p(i) = int_prob(ls(i), T, x0, 0.1);
end
%% Do we need to look at the left side as well?
figure; hold on;
......@@ -124,7 +124,7 @@ plot(ls, p/N);
% plot(lx, xt);
% plot(ls, q/50000);
%%
int_prob(0.01, T, x0+a)
int_prob(0.3, T, x0, 0.1)
%%
int_prob_simple(0.01, T, x0)
%%
......@@ -139,16 +139,18 @@ toc
csvwrite('jump_length_7_7_3.csv', ls)
csvwrite('prob_7_7_3.csv', p/N);
%% distribution for x0 can be taken from phi_tot (steady state)
function p = int_prob(l, T, x0)
function p = int_prob(l, T, x0, lb)
delta_x0 = diff(x0);
p = 0;
for i = 1:length(delta_x0)
x = (x0(i)+x0(i+1))/2;
if x-l > 5; break; end
p_i = @(j) interp1(T{j}.x, T{j}.sol(3, :), x-l);
p2 = (p_i(i)+p_i(i+1))/2;
p = p + delta_x0(i)*...
T{1}.phi_tot(x, T{1}.a, T{1}.b, T{1}.e, T{1}.u0)*p2;
if x-5>lb
if x-l > 5-lb; break; end
p_i = @(j) interp1(T{j}.x, T{j}.sol(3, :), x-l);
p2 = (p_i(i)+p_i(i+1))/2;
p = p + delta_x0(i)*...
T{1}.phi_tot(x, T{1}.a, T{1}.b, T{1}.e, T{1}.u0)*p2;
end
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment