Skip to content

Commit

Permalink
- fixed movie creation in eval_methods.m
Browse files Browse the repository at this point in the history
- added gif animation
  • Loading branch information
mschiffn committed May 8, 2020
1 parent 4e431e0 commit b727752
Show file tree
Hide file tree
Showing 4 changed files with 282 additions and 124 deletions.
25 changes: 19 additions & 6 deletions +fractional_steps/step.m
Original file line number Diff line number Diff line change
@@ -1,39 +1,52 @@
function [pressure_output, N_steps] = step( pressure_input, f_s, delta_z, a, b, order )
function [ pressure_output, N_steps ] = step( pressure_input, f_s, delta_z, a, b, order )
% Strang-Marchuk splitting step
%
% author: Martin Schiffner
% date: 2009-03-30
% modified: 2020-05-06
% modified: 2020-05-07

%--------------------------------------------------------------------------
% 1.) check arguments
%--------------------------------------------------------------------------

%--------------------------------------------------------------------------
% 2.) compute splitting step
%--------------------------------------------------------------------------
%
N_samples = numel(pressure_input);
ksi = 0.5; %factor used in finite difference scheme (0.5 = Crank-Nicolson method)
method_interp = 'linear'; %method which is used for interpolation in solution to nonlinear problem

%
switch order

case 0
% solve linear diffusion equation for delta_z / 2 (adjustable finite difference scheme)
pressure_input = fractional_steps.diffusion( pressure_input, f_s, N_samples, delta_z / 2, a, ksi );

% solve nonlinear equation for delta_z
[pressure_input, N_steps] = fractional_steps.nonlinear( pressure_input, f_s, N_samples, delta_z, b, method_interp );
[ pressure_input, N_steps ] = fractional_steps.nonlinear( pressure_input, f_s, N_samples, delta_z, b, method_interp );

% solve linear diffusion equation for delta_z / 2 (adjustable finite difference scheme)
pressure_output = fractional_steps.diffusion( pressure_input, f_s, N_samples, delta_z / 2, a, ksi );

case 1
% solve nonlinear equation for delta_z / 2
[pressure_input, N_steps_1] = fractional_steps.nonlinear( pressure_input, f_s, N_samples, delta_z / 2, b, method_interp );
[ pressure_input, N_steps_1 ] = fractional_steps.nonlinear( pressure_input, f_s, N_samples, delta_z / 2, b, method_interp );

% solve linear diffusion equation for delta_z (adjustable finite difference scheme)
pressure_input = fractional_steps.diffusion( pressure_input, f_s, N_samples, delta_z, a, ksi );

% solve nonlinear equation for delta_z / 2
[pressure_output, N_steps_2] = fractional_steps.nonlinear( pressure_input, f_s, N_samples, delta_z / 2, b, method_interp );
[ pressure_output, N_steps_2 ] = fractional_steps.nonlinear( pressure_input, f_s, N_samples, delta_z / 2, b, method_interp );

N_steps = [N_steps_1, N_steps_2];

otherwise

% display error message
error('burgers_frac_steps: invalid argument order in fractional steps scheme');
error('burgers_frac_steps: invalid argument order in fractional steps scheme');

end

end % function [pressure_output, N_steps] = step( pressure_input, f_s, delta_z, a, b, order )
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,47 @@ the nonlinear propagation of
plane ultrasonic waves in
homogeneous viscous fluids.

The model is potentially interesting for
fast tissue harmonic imaging (THI) or
Its incorporation into
fast tissue harmonic imaging or
the detection of
ultrasound contrast agents.
ultrasound contrast agents potentially improves
these imaging modes.
Moreover,
the decompositions of
arbitrary types of
waves into
steered plane waves permit
the application of
this model
the Burgers equation to
other types of waves.

## Content

The script "eval_methods.m" compares
both methods by evaluating
various error metrics.
It additionally creates
a movie illustrating
the deformation of
the wave and
the accompanying generation of
harmonics.

The package +volterra contains
the functions for
the proposed Volterra polynomial, whereas
the package +fractional_steps contains
the functions for
the fractional steps reference method.

## Results

The following animation depicts
the result of
the 10th-degree Volterra polynomial.

![Animation](./burgers_propagation_hp.gif)

## References :notebook:

Expand Down
Binary file added burgers_propagation_hp.gif
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b727752

Please sign in to comment.