Numerical integration of a long symbolic expression with definite limits
3 ビュー (過去 30 日間)
古いコメントを表示
I want to numerically integrate a long symbolic expression with definite limits without using the symbolic integration function (int) because it is very slow. A sample example (for short expression) would be
syms t a b c
y=a*sin(t)+(b*cos(2*t)+c*sin(3*t))^2
I want to integrate y with respect to t from 0 to pi. The result should be a symbolic expression in a , b, c.
Again, I don't want to use int function
7 件のコメント
Walter Roberson
2020 年 4 月 9 日
編集済み: Walter Roberson
2020 年 4 月 9 日
?
The result of int(y) would not have any trignometric expressios left in it, just combinations of a, b, c, pi, and fractions. a appears up to a^10, b appears up to b^20, c appears up to c^20. You can extract the coefficients using coeff()
You can expand() y and work term by term, using children(), extract the symbolic coefficient multipliers, do numeric integration on the sin()^n*cos()^m part, multiply by the symbolic parts, record, and later sum() all the results. It is not clear this would be any more useful than using int(y) or int(vpa(expand(y)))
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!