Problem with coefficient c in function form in solving 2D-PDE (PDE toolbox)
显示 更早的评论
I'm trying to solve a 2D-PDE with a c coefficent in function form, but i'm having some trouble in using location struct.
here is my function for c coefficient:
______________________________________________
function cmatrix = ccoeffunction(location,~)
n1 = 4;
nr = numel(location.x);
Ds=1.4e-10;
jv=2e-5;
cmatrix = zeros(n1,nr);
cmatrix(1,:) = Ds*ones(1,nr);
cmatrix(2,:) = jv*(location.y)+jv*((location.y).^3)/3;
cmatrix(3,:) = -jv*(location.x)+Ds*((location.x)./(location.y));
cmatrix(4,:) = Ds*ones(1,nr);
end
_______________________________________________
However the location struct passed to the function contains in fields x and y just one zero, so my function doesen't work correctly.
______________________________________________
location =
struct with fields:
x: 0
y: 0
z: 0
subdomain: 1
_______________________________________________
How can i pass to my function the correct location struct???
Thanks
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Eigenvalue Problems 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

