-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fixed movie creation in eval_methods.m
- added gif animation
- Loading branch information
Showing
4 changed files
with
282 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.