Mercurial > repos > public > sbplib
comparison +scheme/Schrodinger1dCurve.m @ 702:40299ae5fabe feature/optim
changed penalty
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Fri, 20 Oct 2017 09:43:07 +0200 |
parents | dd3e9a0f5032 |
children |
comparison
equal
deleted
inserted
replaced
701:e89715fe6a6e | 702:40299ae5fabe |
---|---|
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 |