How to Specify Coefficients for parabolic equation in Function Form

1 view (last 30 days)
Hi, I've been trying to calculate the 2-D voltage distribution using functional pdetool. (Two thin dielectrics with air gap between) I want to specify the epsilons for each material. air: ep=ep_0, dielectric: ep=ep_r.
Since the parabolic(u0,tlist,model,c,a,f,d) produces the solution to the FEM formulation of the scalar PDE problem d*u_t - (c*u_r)_r + a*u = f, the coefficient 'c' is key in this issue.
Here I attached my matlab code. In the code, I tried as follow:
c=@(p,t,phi,t0) cfunction(p,t,ep,ep_r,z_end,z_start); %c=1; %
a=0;
f=0;
d=1e-5;
tlist=0:period/100:period;
phi = parabolic(0, tlist, pdem, c, a, f, d);
function c=cfunction(p,t,ep,ep_r,z_end,z_start)%phi,time,
% ep= 8.854e-14; % Epsilon_0 changed in cm order
% ep_r = 8.0; % relative dielectric constant (Al2O3: 9.1, Quartz: 8, Acryl: 2.6, Teflon: 2)
% z_end=0.5; % gap distance in cm
it1=t(1,:);
it2=t(2,:);
it3=t(3,:);
ypts = (p(2,it1)+p(2,it2)+p(2,it3))/3;
n=length(ypts);
c=zeros(n,1);
for i=1:n
if ypts(i) <= z_end && ypts(i) >= z_start
c(:,i)=ep;
else
c(:,i)=ep*ep_r;
end
end
But it didn't work! What should I do?
  1 Comment
Alan Weiss
Alan Weiss on 9 Jul 2015
In what way didn't it work? What is the error or other result that you got?
Alan Weiss
MATLAB mathematical toolbox documentation

Sign in to comment.

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!