leg4 = {};
sym = {};
-rows = 13;
+rows = 14;
for i = 1:length(files)
['cond ' l0 l1{i}]...
}';
leg4 = {leg4{:}...
- ['Zeit ' l0 l1{i}]...
+ ['Zeit aufbauen ' l0 l1{i}]...
+ ['Zeit loesen ' l0 l1{i}]...
}';
sym = {sym{:} type2sym(data(1,[2+(i-1)*rows]))}';
end
%% Plotte Zeit
figure(8)
i=0;
-loglog(repmat(X(:,i+1),1,1),[...
- G_D(:,2+11+rows*i)...
- ],type2sym(i+1),'color', type2color(i+1,:));
+loglog(...
+ X(:,i+1),G_D(:,2+11+rows*i),type2sym(i*3+1),...
+ X(:,i+1),G_D(:,2+12+rows*i),type2sym(i*3+2),...
+ 'color', type2color(i+1,:));
hold on
for i = 1:step-1
-loglog(repmat(X(:,i+1),1,1),[...
- G_D(:,2+11+rows*i)...
- ],type2sym(i+1),'color', type2color(i+1,:));
+loglog(...
+ X(:,i+1),G_D(:,2+11+rows*i),type2sym(i*3+1),...
+ X(:,i+1),G_D(:,2+12+rows*i),type2sym(i*3+2),...
+ 'color', type2color(i+1,:));
end
% loglog(X(:,1),[7*X(:,1).^(-1/2),3*X(:,1).^(-1/4),2*X(:,1).^(-3/4)],'-.')
hold off
kap3 = 0;
+tic
+
%times mal verfeinern oder bis Elementanzahl fuer times > 40
for j = 1:times
%beende Schleife wenn Elementanzahl erreicht
if(~vcon)
%Loesung berechnen
x_fine = V_fine\b_fine;
- con = cond(V_fine);
+
else
%Vorkonditionierte Loesung!
- D = diag(diag(V_fine.^(-1/2)));
-
- A = D * V_fine * D;
- c = D*b_fine;
- y = A\c;
- x_fine = D*y;
- con = cond(A);
+ D = diag(V_fine).^(-1/2);
+ for k = 1:length(V_fine)
+ for l = 1:length(V_fine)
+ V_fine(k,l) = V_fine(k,l)*D(k)*D(l);
+ end
+ end
+ c = D.*b_fine;
+ y = V_fine\c;
+ x_fine = D.*y;
end
+ solve_time = toc;
+
+ %Konditionszahl aufstellen
+ con = cond(V_fine);
+
clear V_fine
% \tilde \mu ( \Rho h -h + L_2 )
if(~vcon)
x = V\b;
else
- D = diag(diag(V.^(-1/2)));
-
- A = D * V * D;
- c = D*b;
- y = A\c;
- x = D*y;
+ D = diag(V).^(-1/2);
+ for k = 1:length(V)
+ for l = 1:length(V)
+ V(k,l) = V(k,l)*D(k)*D(l);
+ end
+ end
+ c = D.*b;
+ y = V\c;
+ x = D.*y;
end
clear V
end_time = toc - start_time;
disp(['Relative Zeit ' num2str(100*(build_time - start_time)/end_time)...
'% absolute Zeit ' t2str(build_time - start_time)]);
- end_time = build_time - start_time;
+ time_build = build_time - start_time;
+ time_sovle = solve_time - build_time;
dataS = [dataS ...
typ(i) ... berechnet mit Typ
sqrt(sum(tmu2))... tilde mu 2
xe_fine... (kappa)
kap3 ... kappa 3
- end_time ... benoetigte Zeit (Aufbauen, Berechnen)
+ time_build ... benoetigte Zeit (Aufbauen)
+ time_solve ... benoetigte Zeit (Berechnen)
];
end