How do I solve for the upper bound of a definite integral when I know what the integral is equal to?

11 ビュー (過去 30 日間)
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 件)

Torsten
Torsten 2015 年 3 月 10 日
編集済み: Torsten 2019 年 4 月 1 日
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 件のコメント
TUAN NGUYEN
TUAN NGUYEN 2019 年 3 月 30 日
Hello Torsten, does your code work on MATLAB 2018b version? there was error when I try to test the code.
Torsten
Torsten 2019 年 4 月 1 日
I modified the last line of the pseudocode. Does it work now ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDebugging and Analysis についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by