Mercurial > repos > public > sbplib
changeset 700:de7f665e1d00 feature/optim
add hamiltonian closures
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Mon, 16 Oct 2017 16:51:22 +0200 |
parents | 8f1eae1450b2 |
children | e89715fe6a6e |
files | +scheme/Schrodinger2dCurve.m |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/+scheme/Schrodinger2dCurve.m Mon Oct 16 14:52:15 2017 +0200 +++ b/+scheme/Schrodinger2dCurve.m Mon Oct 16 16:51:22 2017 +0200 @@ -209,7 +209,7 @@ % data is a function returning the data that should be applied at the boundary. % neighbour_scheme is an instance of Scheme that should be interfaced to. % neighbour_boundary is a string specifying which boundary to interface to. - function [closure, penalty] = boundary_condition(obj, boundary,~) + function [closure, penalty,closureHamiltonian,penaltyHamiltonian] = boundary_condition(obj, boundary,~) [e, d_n, d_t, coeff_t, coeff_n s, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t,g] = obj.get_boundary_ops(boundary); a_t = @(t) spdiag(coeff_t(t)); @@ -226,6 +226,9 @@ closure = @(t) sqrt(obj.Ji)*(obj.c^2 * penalty_parameter_1(t)*e' + penalty_parameter_2(t)*e')*sqrt(obj.Ji); penalty = @(t) -sqrt(obj.Ji)*(obj.c^2 * penalty_parameter_1(t)*e' + penalty_parameter_2(t)*e')*sqrt(obj.Ji); + + closureHamiltonian = @(t) sqrt(obj.Ji)*(obj.c^2 * penalty_parameter_1(t)*e')*sqrt(obj.Ji); + penaltyHamiltonian = @(t) -sqrt(obj.Ji)*(obj.c^2 * penalty_parameter_1(t)*e')*sqrt(obj.Ji); end