rbmatlab  1.16.09
 All Classes Namespaces Files Functions Variables Modules Pages
HMM_CFL_BL.m
1 function [DT,N_T,dx,dt,LAMBDA]=HMM_CFL_BL(DX,T,epsilon,M)
2 %
3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 %%% Bestimmung der Ortsschrittweiten %%%
5 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 %
7 % function [DT,N_T,dx,dt,LAMBDA]=HMM_CFL_BL(DX,T,epsilon,M)
8 %
9 % Input: DX makroskopische Ortsschrittweite
10 % T Endzeit (fuer Makrorechnung)
11 % epsilon Regularisierungsparameter
12 % Output: DT makroskopische Zeitschrittweite
13 % N_T Anzahl makroskopische Ortsschritte
14 % dx, dt mikroskopische Orts- bzw. Zeitschrittweite
15 % LAMBDA Abkuerzungen fuer Verhaeltnisse
16 
17 
18 % mikroskopische Ortsschrittweiten
19 dx = 1.5*epsilon;
20 s = (0:0.001:1);
21 h = -(2*s*M.*(s-1))./(s.^2+M-2*M*s+M*s.^2).^2;
22 w = max(h);
23 clear h s
24 dt = 0.95*min(dx^2/(2*epsilon),dx/w);
25 
26 DT=0.95*(DX/w); % makroskopische Zeitschrittweite mit CFL-Bedingung fuer grobes Gitter
27 N_T=round(T/DT);
28 
29 LAMBDA=DT/DX;