Mercurial > repos > public > sbplib
comparison +scheme/Schrodinger1dCurve.m @ 430:25053554524b feature/quantumTriangles
Removed some comments
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Wed, 08 Feb 2017 09:07:07 +0100 |
parents | dde5760863de |
children | 6b8297f66c91 |
comparison
equal
deleted
inserted
replaced
429:dde5760863de | 430:25053554524b |
---|---|
51 V_vec = V(obj.x); | 51 V_vec = V(obj.x); |
52 else | 52 else |
53 V_vec = obj.xi*0 + V; | 53 V_vec = obj.xi*0 + V; |
54 end | 54 end |
55 | 55 |
56 obj.V_mat = spdiags(V_vec,0,m,m); | 56 obj.V_mat = spdiags(V_vec,0,m,m); |
57 | 57 obj.D = @(a,a_xi,Ji) obj.d_fun(a, a_xi, Ji, constJi); |
58 obj.D = @(a,a_xi,Ji) obj.d_fun(a, a_xi, Ji, constJi); | |
59 | |
60 obj.m = m; | 58 obj.m = m; |
61 obj.order = order; | 59 obj.order = order; |
62 end | 60 end |
63 | 61 |
64 | 62 |
71 % neighbour_boundary is a string specifying which boundary to interface to. | 69 % neighbour_boundary is a string specifying which boundary to interface to. |
72 | 70 |
73 function [D] = d_fun(obj,a, a_xi , Ji , constJi) | 71 function [D] = d_fun(obj,a, a_xi , Ji , constJi) |
74 if constJi | 72 if constJi |
75 D= -0.5*(obj.D1*a - a_xi + a*obj.D1) + 1i*Ji*obj.D2 + 1i*obj.V_mat; | 73 D= -0.5*(obj.D1*a - a_xi + a*obj.D1) + 1i*Ji*obj.D2 + 1i*obj.V_mat; |
76 % D= -a*obj.D1 + 1i*Ji*obj.D2 + 1i*obj.V_mat; | |
77 else | 74 else |
78 D= -0.5*(obj.D1*a - a_xi + a*obj.D1) + 1i*obj.D2(diag(Ji)) + 1i*obj.V_mat; | 75 D= -0.5*(obj.D1*a - a_xi + a*obj.D1) + 1i*obj.D2(diag(Ji)) + 1i*obj.V_mat; |
79 % D= - a*obj.D1 + 1i*obj.D2(diag(Ji)) + 1i*obj.V_mat; | |
80 % D=-obj.D1*a - a_xi + 1i*obj.D2(diag(Ji)) + 1i*obj.V_mat; | |
81 end | 76 end |
82 end | 77 end |
83 | 78 |
84 function [closure, penalty] = boundary_condition(obj,boundary,type,data) | 79 function [closure, penalty] = boundary_condition(obj,boundary,type,data) |
85 default_arg('type','dirichlet'); | 80 default_arg('type','dirichlet'); |