comparison +scheme/Schrodinger1dCurve.m @ 707:0de70ec8bf60 feature/quantumTriangles

merge with feature/optim
author Ylva Rydin <ylva.rydin@telia.com>
date Fri, 10 Nov 2017 14:22:56 +0100
parents 40299ae5fabe
children
comparison
equal deleted inserted replaced
696:7c16b5af8d98 707:0de70ec8bf60
120 % Dirichlet boundary condition 120 % Dirichlet boundary condition
121 case {'D','d','dirichlet'} 121 case {'D','d','dirichlet'}
122 tau1 = @(t) s * 1i*obj.Ji(p,p)*d; 122 tau1 = @(t) s * 1i*obj.Ji(p,p)*d;
123 tau2 = @(t) (1*s*obj.a(p,p))/2*e; 123 tau2 = @(t) (1*s*obj.a(p,p))/2*e;
124 closure = @(t)obj.Hi*sqrt(obj.Ji)*(tau1(t)*e' + tau2(obj.a)*e')*sqrt(obj.Ji); 124 closure = @(t)obj.Hi*sqrt(obj.Ji)*(tau1(t)*e' + tau2(obj.a)*e')*sqrt(obj.Ji);
125 125 penalty = @(t) -obj.Hi*sqrt(obj.Ji)*(tau1(t)*e' + tau2(obj.a)*e')*sqrt(obj.Ji);
126 switch class(data)
127 case 'double'
128 penalty = @(t) -obj.Hi*sqrt(obj.Ji)*(tau1*data+tau2(obj.a)*data)*sqrt(obj.Ji);
129
130 otherwise
131 error('Weird data argument!')
132 end
133 % Unknown, boundary condition 126 % Unknown, boundary condition
134 otherwise 127 otherwise
135 error('No such boundary condition: type = %s',type); 128 error('No such boundary condition: type = %s',type);
136 end 129 end
137 end 130 end