How do I solve this integral in matlab?

3 ビュー (過去 30 日間)
Aditya Zade
Aditya Zade 2025 年 3 月 6 日
コメント済み: Sam Chak 2025 年 3 月 6 日
  1 件のコメント
Sam Chak
Sam Chak 2025 年 3 月 6 日
Hi @Aditya Zade, if you wish to call a specific user for help, you can use this special character "@".
You can also type out the integrand function in MATLAB by clicking the indentation icon .
For example
% declare symbols
syms t
% assign a value
w_g = 120*pi;
% create a function
func = - sin(w_g*t - pi/6)
func = 

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

採用された回答

Walter Roberson
Walter Roberson 2025 年 3 月 6 日
% declare symbols
syms t
Pi = sym(pi);
% assign a value
w_g = 2*Pi*60;
% create a function
func = - sin(w_g*t - Pi/6) .* sin(w_g*t) / sin(w_g * t - 2*Pi/3)
func = 
Integration = simplify(3*w_g/Pi * int(func, t, 0, 3*w_g, hold=true))
Integration = 
F = matlabFunction(Integration);
format long g
INT = F()
Warning: Reached the limit on the maximum number of intervals in use. Approximate bound on error is 1.9e+04. The integral may not exist, or it may be difficult to approximate numerically to the requested accuracy.
INT =
-21492.6584717154
  7 件のコメント
Aditya Zade
Aditya Zade 2025 年 3 月 6 日
This is what I am getting: 1/4 - (3*3^(1/2))/(8*pi)
Sam Chak
Sam Chak 2025 年 3 月 6 日
If you attempt to solve a mathematical equation or an integral problem using functions from the Symbolic Math Toolbox, the answers will be returned as symbolic expressions.
format long
Integration = 1/4 - (3*3^(1/2))/(8*pi)
Integration =
0.043251664216828

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCalculus についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by