MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

### Discover what MATLAB® can do for your career.

Asked by Tarang on 24 May 2013

I have a function in 3 variables in "B y t" which I want to integrate wrt 'y' only. I used int function but it is showing Explicit integral cannot be found. I tried numerical integration also giving limits from (0 to b/2) but same error is there. The code is mentioned below

```syms B y t;
C_d=0.1;  w=2;  density=1.225; U=3.2;
a=0.005;  b=0.05;  R=10;
c=2*a*((1-(y/b)^2)^0.5);
C1= 0.5*R/(2.32+R);
C2=0.181+(0.722/R);
A0=0.0348;
theta=-B*y*sin(w*t);
thetarate=-B*y*w*cos(w*t);
thetarate2=-B*y*(w^2)*sin(w*t);
thetabar=sin(w*t)*B*b/4;
h=-0.0785*cos(w*t);
h_dash=0.0785*w*sin(w*t);
A=0.049*(sin(2*t))*cos(B*y*sin(2*t))+0.00234*((1-400*(y^2))^0.5)*B*y*cos(2*t)-B*(y*sin(2*t)-0.0125*sin(2*t));
C=(117*B*cos(2*t)*(1 - 400*y^2)^(1/2))/50000 - (49*B*sin(2*t)^2*sin(B*y*sin(2*t)))/1000 - B*sin(2*t) - (117*B*y^2*cos(2*t))/(125*(1 - 400*y^2)^(1/2));
k=(c*w)/(2*U);
F=1-((C1*(k^2))/((k^2)+(C2^2)));
G=-(C1*C2*k)/((k^2)+(C2^2));
w0=U*2*(A0+thetabar)/(2+R);
v_dash=(U*C)-(0.25*c*thetarate2);
N_a=0.25*pi*c^2*density*v_dash;
N_c=0.5*density*U*V*Cn*c;
N=N_a+N_c;
V_x=U*cos(theta)-(h_dash)*sin(theta);
L=C_d*density*(V_x)^2*c/2;
M=J-K-L;
O=N*cos(theta)+M*sin(theta);  %final function to integrate
P=M*cos(theta)-N*sin(theta);  %final function to integrate
X=int(O);
Y=int(P);
```

Walter Roberson on 24 May 2013

Please show the content of "O" and "P" . It could well be that they just do not have an explicit integral.

Please show your attempt to do numeric integration. Is the message exactly the same?

Tarang on 25 May 2013

O and P are very big function in y t and B. When I gave the command... int (O, y, 0, b/2) after 3hrs it said explicit integration can't be found.. and wrote.......... int (O, y=0..0.025).

I think the function is non integrable. But then it should have given the numerical integral. Can I just know how can I integrate above using simpson rule? Should I use linspace and loops or is there any other function for this? Thanks