comparison +scheme/Schrodinger2dCurve.m @ 708:acb58769610e feature/quantumTriangles

fixed error in diffOp
author Ylva Rydin <ylva.rydin@telia.com>
date Tue, 21 Nov 2017 16:51:51 +0100
parents e89715fe6a6e
children f004b9e9d17a
comparison
equal deleted inserted replaced
707:0de70ec8bf60 708:acb58769610e
209 % data is a function returning the data that should be applied at the boundary. 209 % data is a function returning the data that should be applied at the boundary.
210 % neighbour_scheme is an instance of Scheme that should be interfaced to. 210 % neighbour_scheme is an instance of Scheme that should be interfaced to.
211 % neighbour_boundary is a string specifying which boundary to interface to. 211 % neighbour_boundary is a string specifying which boundary to interface to.
212 function [closure, penalty,closureHamiltonian,penaltyHamiltonian] = boundary_condition(obj, boundary,~) 212 function [closure, penalty,closureHamiltonian,penaltyHamiltonian] = boundary_condition(obj, boundary,~)
213 [e, d_n, d_t, coeff_t, coeff_n s, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t,g] = obj.get_boundary_ops(boundary); 213 [e, d_n, d_t, coeff_t, coeff_n s, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t,g] = obj.get_boundary_ops(boundary);
214
215 a_t = @(t) spdiag(coeff_t(t)); 214 a_t = @(t) spdiag(coeff_t(t));
216 a_n = @(t) spdiag(coeff_n(t)); 215 a_n = @(t) spdiag(coeff_n(t));
217 216 boundary
218 217
219 F = @(t)(s * a_n(t)*d_n' + s * a_t(t) *d_t')'; 218 F = @(t)(s * a_n(t)*d_n' + s * a_t(t) *d_t')';
220 tau1 = 1; 219 tau1 = 1;
221 a = @(t)spdiag(g(t)); 220 a = @(t)spdiag(g(t));
222 tau2 = @(t) (1*s*a(t))/2; 221 tau2 = @(t) (1*s*a(t))/2;
256 penalty_parameter_1 = @(t) halfnorm_inv_u_n*(tau*halfnorm_inv_u_t*F_u(t)*e_u'*halfnorm_u_t*e_u); 255 penalty_parameter_1 = @(t) halfnorm_inv_u_n*(tau*halfnorm_inv_u_t*F_u(t)*e_u'*halfnorm_u_t*e_u);
257 penalty_parameter_2 = @(t) halfnorm_inv_u_n * e_u * (sig ); 256 penalty_parameter_2 = @(t) halfnorm_inv_u_n * e_u * (sig );
258 penalty_parameter_3 = @(t) halfnorm_inv_u_n * e_u * (gamm(t) ); 257 penalty_parameter_3 = @(t) halfnorm_inv_u_n * e_u * (gamm(t) );
259 258
260 259
261 closure =@(t) sqrt(Ji_u)*obj.c^2 * ( penalty_parameter_1(t)*e_u' + penalty_parameter_2(t)*F_u(t)' + penalty_parameter_3(t)*e_u')*sqrt(Ji_u); 260 closure =@(t) sqrt(Ji_u)*obj.c^2 * ( penalty_parameter_1(t)*e_u'...
262 penalty =@(t) sqrt(Ji_u)*obj.c^2 * ( -penalty_parameter_1(t)*e_v' - penalty_parameter_2(t)*F_v(t)' - penalty_parameter_3(t)*e_v')*sqrt(Ji_v); 261 + penalty_parameter_2(t)*F_u(t)' + penalty_parameter_3(t)*e_u')*sqrt(Ji_u);
262 penalty =@(t) sqrt(Ji_u)*obj.c^2 * ( -penalty_parameter_1(t)*e_v'...
263 - penalty_parameter_2(t)*F_v(t)' - penalty_parameter_3(t)*e_v')*sqrt(Ji_v);
263 end 264 end
264 265
265 266
266 function [e, d_n, d_t, coeff_t,coeff_n, s, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t,g,Ji] = get_boundary_ops(obj, boundary) 267 function [e, d_n, d_t, coeff_t,coeff_n, s, halfnorm_inv_n, halfnorm_inv_t, halfnorm_t,g,Ji] = get_boundary_ops(obj, boundary)
267 268