calculate integral of this function

Hi guys, could you please help me with this simple integral!! Thanks in advance.
p1= 2e-03 ;
p2= 6e-03 ;
p0=p1+p2;
Pi= p0/2;
theta= deg2rad(60) ;
H0= tan(theta)*p1 ;
syms H V M0 Fi x
Fi = H0-x*tan(theta);
M=H*Fi+V*x-M0;
dM_dH=diff(M,H);
F1= integral(@(x) (dM_dH).^2/cos(theta),0,Pi)

 Accepted Answer

F1 = double(int(dM_dH^2/cos(theta),x,0,Pi))
instead of
F1= integral(@(x) (dM_dH).^2/cos(theta),0,Pi)

1 Comment

I also recommend converting your constants to symbolic
format long g
p1= 2e-03 ;
p2= 6e-03 ;
p0=p1+p2;
Pi= p0/2;
theta= deg2rad(60) ;
H0= tan(theta)*p1 ;
syms H V M0 Fi x
Fi = H0-x*tan(theta);
M=H*Fi+V*x-M0;
dM_dH=diff(M,H);
F1s = int(dM_dH^2/cos(theta),x,0,Pi)
F1s = 
F1 = double(F1s)
F1 =
3.2e-08
Q = @(v) sym(v);
p1= Q(2)*sym(10)^(-03) ;
p2= Q(6)*sym(10)^(-03) ;
p0=p1+p2;
Pi= p0/2;
theta= deg2rad(Q(60)) ;
H0= tan(theta)*p1 ;
syms H V M0 Fi x
Fi = H0-x*tan(theta);
M=H*Fi+V*x-M0;
dM_dH=diff(M,H);
F1s = int(dM_dH^2/cos(theta),x,0,Pi)
F1s = 
F1 = double(F1s)
F1 =
3.2e-08

Sign in to comment.

More Answers (0)

Tags

Asked:

on 14 Apr 2023

Commented:

on 14 Apr 2023

Community Treasure Hunt

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

Start Hunting!