diff --git a/HelmholtzEquation.m b/HelmholtzEquation.m
index f6fd7540..28e5602f 100755
--- a/HelmholtzEquation.m
+++ b/HelmholtzEquation.m
@@ -12,7 +12,7 @@
% If RHS is given as input, c and d are not used.
%
% The in-homogeneous Helmholtz equation with variable coefficents in two spatial
-% dimentions is
+% dimensions is
%
% $$ a(x,y) f(x,y) - \nabla \cdot (b(x,y) \nabla f(x,y)) = c(x,y) - \nabla \cdot \nabla d(x,y) $$
%
diff --git a/PlotResultsFromThicknessInversion.m b/PlotResultsFromThicknessInversion.m
index 2e502fdd..8e0530d7 100755
--- a/PlotResultsFromThicknessInversion.m
+++ b/PlotResultsFromThicknessInversion.m
@@ -10,25 +10,25 @@ function PlotResultsFromThicknessInversion(CtrlVar,MUA,F,BCs,Priors,Meas,hest,ht
-UaPlots(CtrlVar,MUA,F,hest,FigureTitle="hest") ;
+UaPlots(CtrlVar,MUA,F,hest,FigureTitle="hest",CreateNewFigure=true) ;
title("h estimated")
hold on ; PlotGroundingLines();
if ~isempty(Priors.h)
- UaPlots(CtrlVar,MUA,F,Priors.h,FigureTitle="hprior") ; title("h prior")
+ UaPlots(CtrlVar,MUA,F,Priors.h,FigureTitle="hprior",CreateNewFigure=true) ; title("h prior")
hold on ; PlotGroundingLines();
end
if ~isempty(Meas.h)
- UaPlots(CtrlVar,MUA,F,Meas.h,FigureTitle="hmeas") ;
+ UaPlots(CtrlVar,MUA,F,Meas.h,FigureTitle="hmeas",CreateNewFigure=true) ;
title("$h$ measured",Interpreter="latex")
hold on ; PlotGroundingLines();
- UaPlots(CtrlVar,MUA,F,hest-Meas.h,FigureTitle="hest-hmeas") ;
+ UaPlots(CtrlVar,MUA,F,hest-Meas.h,FigureTitle="hest-hmeas",CreateNewFigure=true) ;
title("$h$: estimated - measured ice thickness",Interpreter="latex")
hold on ; PlotGroundingLines();
@@ -46,7 +46,7 @@ function PlotResultsFromThicknessInversion(CtrlVar,MUA,F,BCs,Priors,Meas,hest,ht
UaPlots(CtrlVar,MUA,F,htrue,FigureTitle="h true") ; title("$h$ true",Interpreter="latex")
axis tight
- FindOrCreateFigure("compare")
+ FigCompare=FindOrCreateFigure("compare") ; clf(FigCompare)
yyaxis left
plot(htrue,hest,'.')
hold on
@@ -61,7 +61,8 @@ function PlotResultsFromThicknessInversion(CtrlVar,MUA,F,BCs,Priors,Meas,hest,ht
title(sprintf("R2=%f",lm.Rsquared.Ordinary));
xlabel("h true") ;
- UaPlots(CtrlVar,MUA,F,hest-htrue,FigureTitle="hest-htrue") ; title("hest-htrue")
+ UaPlots(CtrlVar,MUA,F,hest-htrue,FigureTitle="hest-htrue",CreateNewFigure=true) ;
+ title("hest-htrue")
end
diff --git a/html/HelmholtzEquation.html b/html/HelmholtzEquation.html
index fd4c4fcd..1146d66b 100755
--- a/html/HelmholtzEquation.html
+++ b/html/HelmholtzEquation.html
@@ -1,103 +1,143 @@
-
-
-
-
- HelmholtzEquationfunction [UserVar,f,lambda,HEmatrix,HErhs]=HelmholtzEquation(UserVar,CtrlVar,MUA,a,b,c,d,RHS)
-
Solves the in-homogeneous Helmholtz equation with variable coefficients in two dimentions:
Also possible to specify the right-hand-side directly through
RHS
-
If RHS is given as input, c and d are not used.
The in-homogeneous Helmholtz equation with variable coefficents in two spatial dimentions is
which we can also write as
where and , and is a given function
Examples:
Smooth a given field over a FE mesh:
load('PIG-TWG-RestartFile.mat') ; CtrlVar=CtrlVarInRestartFile;
- L=1e3 ; % Smoothing length scale
- [UserVar,SmoothedField]=HelmholtzEquation([],CtrlVar,MUA,1,L^2,F.B,0);
figure(1) ; PlotMeshScalarVariable(CtrlVarInRestartFile,MUA,SmoothedField) ; title(' Smoothed field') ; xlabel('x (km)') ; ylabel('y (km)')
- figure(2) ; PlotMeshScalarVariable(CtrlVarInRestartFile,MUA,F.B) ; title(' Original field') ; xlabel('x (km)') ; ylabel('y (km)')
- figure(3) ; PlotMeshScalarVariable(CtrlVarInRestartFile,MUA,SmoothedField-F.B) ; title(' Smoothed-Original') ; xlabel('x (km)') ; ylabel('y (km)')
narginchk(7,8)
-
-
-[UserVar,HEmatrix,HErhs]=HelmholtzEquationAssembly(UserVar,CtrlVar,MUA,a,b,c,d);
-L=[] ; Lrhs=[] ; lambda=[]; f=[] ;
-
-if nargin==8 && ~isempty(RHS)
- HErhs=RHS;
-end
-
-[f,lambda]=solveKApe(HEmatrix,L,HErhs,Lrhs,f,lambda,CtrlVar);
-f=full(f);
-
-
-
-
-
-
-
end
-
+HelmholtzEquation
+
+
+
+
+
+
+
+
+
+function [UserVar,f,lambda,HEmatrix,HErhs]=HelmholtzEquation(UserVar,CtrlVar,MUA,a,b,c,d,RHS)
+
+
Solves the in-homogeneous Helmholtz equation with variable coefficients in two dimensions:
+
+
+
Also possible to specify the right-hand-side directly through
+
RHS
+
+
If RHS is given as input, c and d are not used.
+
The in-homogeneous Helmholtz equation with variable coefficents in two spatial dimensions is
+
+
+
which we can also write as
+
+
+
where and , and is a given function
+
Examples:
+
Smooth a given field over a FE mesh:
+
load('PIG-TWG-RestartFile.mat') ; CtrlVar=CtrlVarInRestartFile;
+ L=1e3 ; % Smoothing length scale
+ [UserVar,SmoothedField]=HelmholtzEquation([],CtrlVar,MUA,1,L^2,F.B,0);
+
figure(1) ; PlotMeshScalarVariable(CtrlVarInRestartFile,MUA,SmoothedField) ; title(' Smoothed field') ; xlabel('x (km)') ; ylabel('y (km)')
+ figure(2) ; PlotMeshScalarVariable(CtrlVarInRestartFile,MUA,F.B) ; title(' Original field') ; xlabel('x (km)') ; ylabel('y (km)')
+ figure(3) ; PlotMeshScalarVariable(CtrlVarInRestartFile,MUA,SmoothedField-F.B) ; title(' Smoothed-Original') ; xlabel('x (km)') ; ylabel('y (km)')
+
narginchk(7,8)
+
+
+[UserVar,HEmatrix,HErhs]=HelmholtzEquationAssembly(UserVar,CtrlVar,MUA,a,b,c,d);
+L=[] ; Lrhs=[] ; lambda=[]; f=[] ;
+
+if nargin==8 && ~isempty(RHS)
+ HErhs=RHS;
+end
+
+[f,lambda]=solveKApe(HEmatrix,L,HErhs,Lrhs,f,lambda,CtrlVar);
+f=full(f);
+
+
+
+
+
+
+
+
Error using HelmholtzEquation
+Not enough input arguments.
+
+
+end
+
+
+
+
\ No newline at end of file
+-->
+