Suggestion for MATLAB coding - obtaining an integral

Status
Not open for further replies.

sudan

Member level 5
Joined
Feb 7, 2010
Messages
93
Helped
8
Reputation
16
Reaction score
5
Trophy points
1,288
Location
chennai
Activity points
1,786
Suggestion for MATLAB

Hai Everybody,

I am having problem for solving the following equation in MATLAB. The code is given bellow. If I am giving some value for α it is working . But my aim is to find the value of α . If I am taking α as it is upto inline function it is working perfectly. The integration is giving problem. If you know please help me.

code :
m=0.063;
syms r z a

w= cos((pi*z)/L)*exp(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');
xmin=1;
xmax=L;
ymin=-L/2;
ymax=L/2;
out1(L) = dblquad(f1,xmin,xmax,ymin,ymax);
out2(L) = dblquad(f2,xmin,xmax,ymin,ymax,[],@quad);
out3(L) = dblquad(f3,xmin,xmax,ymin,ymax,[],@quad);

out = out1 + out2 + out3;


Thank you

Swamy
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…