arthics
Newbie level 4

Hi Experts,
Anyone can correct the following code please.........
My aim is to calculate the value of 'a'. For that we have to first find the value of 'out' (see in the program) then differentiate that with respect to 'a' and equate to '0'. The function dblquad is giving error ........
The equation is given below...
CODING
; I am taking alpha = a , in the program
syms r z
m=0.063;
ep=13.13;
xmin=1;
xmax=L;
ymin=-L/2;
ymax=L/2;
w= cos((pi*z)/L)*exp(-a*sqrt(r.^2+z.^2));
w1 = r*(cos((pi*z)/L)*exp(-a*sqrt(r.^2+z.^2)))^2;
normal = inline(vectorize(w1),'r','z');
potential = w^2*(r/(sqrt(r.^2+z.^2)));
y1= vectorize(r*diff(diff(w,r)));
y2= vectorize(diff(w,r));
y3= vectorize((r)*diff(diff(w,z)));
f1 = inline(y1,'r','z');
f2 = inline(y2,'r','z');
f3 = inline(y3,'r','z');
poten = inline(vectorize(potential),'r','z');
poten
normalize(L) = dblquad(normal ,xmin,xmax,ymin,ymax,[],@quad);
out1 = dblquad(f1,xmin,xmax,ymin,ymax);
out2= dblquad(f2,xmin,xmax,ymin,ymax,[],@quad);
out3 = dblquad(f3,xmin,xmax,ymin,ymax,[],@quad);
out = out1+out2+out3;
Arthi
Anyone can correct the following code please.........
My aim is to calculate the value of 'a'. For that we have to first find the value of 'out' (see in the program) then differentiate that with respect to 'a' and equate to '0'. The function dblquad is giving error ........
The equation is given below...
CODING
; I am taking alpha = a , in the program
syms r z
m=0.063;
ep=13.13;
xmin=1;
xmax=L;
ymin=-L/2;
ymax=L/2;
w= cos((pi*z)/L)*exp(-a*sqrt(r.^2+z.^2));
w1 = r*(cos((pi*z)/L)*exp(-a*sqrt(r.^2+z.^2)))^2;
normal = inline(vectorize(w1),'r','z');
potential = w^2*(r/(sqrt(r.^2+z.^2)));
y1= vectorize(r*diff(diff(w,r)));
y2= vectorize(diff(w,r));
y3= vectorize((r)*diff(diff(w,z)));
f1 = inline(y1,'r','z');
f2 = inline(y2,'r','z');
f3 = inline(y3,'r','z');
poten = inline(vectorize(potential),'r','z');
poten
normalize(L) = dblquad(normal ,xmin,xmax,ymin,ymax,[],@quad);
out1 = dblquad(f1,xmin,xmax,ymin,ymax);
out2= dblquad(f2,xmin,xmax,ymin,ymax,[],@quad);
out3 = dblquad(f3,xmin,xmax,ymin,ymax,[],@quad);
out = out1+out2+out3;
Arthi