difficulty in solving integration of a function
1 view (last 30 days)
Show older comments
Indu Choudhary
on 2 Mar 2020
Answered: Bjorn Gustavsson
on 2 Mar 2020
how could I calculate the integeral of a function
F = log(1 + p/[(x(t))^2 + (y(t))^2)]) where t varies from 0 to 7
here
x(t) = 100-(50*cos(theta)*t)
y(t) = H+50*sin(theta)*t-4.9*t^2
theta could be any between 0 to 75 degree
1 Comment
Jintao Wu
on 2 Mar 2020
I can't undrstand the means of ' how could I calculate the intergrral of a function '
Accepted Answer
Bjorn Gustavsson
on 2 Mar 2020
Implement the functions x(t,theta), y(t,theta,H) and F(t,H,p,theta) step-by step. Something like this:
y = @(t,theta,H) H+50*sin(theta)*t-4.9*t.^2; % Note the change to elementwise operation in the last term
...etc
Then Check that your function F is wellbehaved in the intervall of interest:
t = linspace(0,7,701);
plot(t,F(t,1,2,pi/5))
If that looks reasonably OK integrate:
H = 12;
p = 0.012;
theta = pi/7;
Q = integral(@(t) F(t,H,p,theta),0,1);
HTH
0 Comments
More Answers (0)
See Also
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!