difficulty in solving integration of a function
조회 수: 1 (최근 30일)
이전 댓글 표시
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
Jintao Wu
2020년 3월 2일
I can't undrstand the means of ' how could I calculate the intergrral of a function '
채택된 답변
Bjorn Gustavsson
2020년 3월 2일
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!