필터 지우기
필터 지우기

Problem Calculating Nonlinear Indefinite Integral

조회 수: 1 (최근 30일)
Dimitrios Kampitsis
Dimitrios Kampitsis 2019년 11월 30일
댓글: Dimitrios Kampitsis 2019년 12월 4일
Hello,
I am trying to calculate a nonlinear integral t^5.2 *exp((-x^6.2-x*(0.2*4.5^6.2))/4.5^6.2) in order to solve an equation, where the unknown is the lower limit of integrations.Although i use "int" in order to calculate the integral, Matlab returns the equation.Is my equation too complicated or there is another way to get a solution ?I am quite new in Matlab, so any help would be appreciated.
I would like to thank you in advance for the time dealing with my query.
  댓글 수: 3
Dimitrios Kampitsis
Dimitrios Kampitsis 2019년 12월 1일
My goal is to solve the following equation where the unknown is the limit of integration (k), where a and b are constants
1.jpg
I tried only with int in order to solve the integral and afterwards, if i get a solution from my integration, i am planning to try and solve the equation. However i am not sure if this is the right way to do it.
syms x
g = x^5 *exp((-x^5-x*(4^6))/4^6) ;
int(g,x,k,k+2)
I havent tried yet trapz. Moreover i didnt try integral because i am looking for a symbolic solution.
Thanks again.
darova
darova 2019년 12월 1일
You should use fsolve and integral

댓글을 달려면 로그인하십시오.

채택된 답변

David Wilson
David Wilson 2019년 12월 2일
Since you neglected to tell us values for a and b, I'll just set them to a=2 and b=1. You have also two definitions for g(x), so I've used the one in your code. Like the previous poster suggested, I'll embed integral inside fsolve:
g = @(x) x.^5.*exp((-x.^5-x*(4^6))/4^6) ;
Q = @(k) integral(g,k,k+2);
a = 2; b = 1; % Set these to whatever
k0 = 1; % Need a start guess here.
k = fsolve(@(k) Q(k) - a/b, k0)
  댓글 수: 1
Dimitrios Kampitsis
Dimitrios Kampitsis 2019년 12월 4일
Thank you for your help, it works and i get a solution. I have tried it also with a more complex equation and it works fine. I really appreciate your help.
However for a specific value of my constants fsolve returns a value (Equation solved) that it is not a root of my equation. I confirmed that using another software "Mathcad".
Could this be a problem of function tolerance ?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Numerical Integration and Differentiation에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by