How do I solve for the upper bound of a definite integral when I know what the integral is equal to?
11 views (last 30 days)
Show older comments
Hers is what I am trying to solve:
The integral dx/(a1*sin(wx)+a2*sin(3wx) from xo to xt = C.
I know the values of everything except xt and I need to figure out how to get matlab to solve for it numerically.
1 Comment
Answers (1)
Torsten
on 10 Mar 2015
Edited: Torsten
on 1 Apr 2019
a1=...;
a2=...;
w=...;
xo=...;
value_integral=...;
sol = fzero(@(C)((integral(@(x)1./(a1*sin(w*x)+a2*sin(3*w*x)))-value_integral,xo,C)),1);
where value_integral is the known value of the integral.
Best wishes
Torsten.
4 Comments
TUAN NGUYEN
on 30 Mar 2019
Hello Torsten, does your code work on MATLAB 2018b version? there was error when I try to test the code.
See Also
Categories
Find more on Debugging and Analysis 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!