How to find integral of this function.

7 ビュー (過去 30 日間)
Akshay Pratap Singh
Akshay Pratap Singh 2019 年 11 月 2 日
回答済み: Akshay Pratap Singh 2019 年 11 月 4 日
clc
clear all
syms y1
k213 =(6858012277439187/(288230376151711744*cos(30*(3/2 - (3*y1)/2)^(1/2) - 10)*((-(8899397708189757*sin(30*(3/2 - (3*y1)/2)^(1/2) + 20))/(9007199254740992*cos(30*(3/2 - (3*y1)/2)^(1/2) - 10)))^(1/2) - 1)^2) - 1)*((3*(3/2 - (3*y1)/2)^(1/2))/2 - 1/2) + 1
k=int(k213, 0.5, 1)
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 11 月 2 日
A closed form solution seems unlikely. Perhaps you should use vpaintegral()
Akshay Pratap Singh
Akshay Pratap Singh 2019 年 11 月 2 日
編集済み: Akshay Pratap Singh 2019 年 11 月 2 日
By incorporating vpaintegral, i am not getting solution. what i get is this:
Undefined function 'vpaintegral' for input arguments of type 'sym'.
Error in falt (line 11)
k=vpaintegral(k213, 0.5, 1)

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

採用された回答

John D'Errico
John D'Errico 2019 年 11 月 2 日
編集済み: John D'Errico 2019 年 11 月 2 日
No, that is not going to have any closed form solution.
One suggestion in the comments was to try vpaintegral. If it does not exist for you, then you either need to upgrade your version of MATLAB, or convert this to a double precision problem instead, then use integral. But integral will fail to yield anything useful, I predict. Even if it returns a number, that number will surely be random numerical garbage.
Anyway, even vpaintegral has issues with that kernel.
vpaintegral(k213,.5,1)
Error using sym/vpaintegral (line 202)
Failed precision goal. Try using 'MaxFunctionCalls'.
So lets look at what you have.
fun = matlabFunction(k213);
fplot(fun,[.5,1])
When I finally stop laughing at the idea of using a numerical integration to integrate that, I'll just wish you good luck. Perhaps you have a friend, Don Quixote, who may have more success at the effort. He always was good at tilting at windmills.
The point is, all of those singularities are going to drive any numerical integration insane. And since a symbolic integral will surely not exist, perhaps you shoild consider if you really need to solve the problem at all. Not all problems you can pose have solutions.
If you really need to solve this, you might consider trying to identify the singularities. I see only 5 of them in the interval of interest. Isolate tham, then work on each one individually.
  1 件のコメント
Steven Lord
Steven Lord 2019 年 11 月 2 日
Another possibility, if you know that the integral of this function exists (if the integral has some sort of physical meaning) is to check that you've accurately implemented the function. pretty print the symbolic function and compare it to the mathematical function that you think you've implemented. Make sure you haven't divided when you should have multiplied or something similar.
pretty(vpa(k213, 6))
Or write that code in the Live Editor and display k213.

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

その他の回答 (1 件)

Akshay Pratap Singh
Akshay Pratap Singh 2019 年 11 月 4 日
Thanks @Walter Roberson, @ John D'Errico, @Steven Lord, for your contribution in the given problem. I will check my problem, where I am lacking.
Thank you all.

カテゴリ

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