error while using solve function with integral

조회 수: 3 (최근 30일)
modem sudhakar
modem sudhakar 2016년 4월 2일
댓글: Walter Roberson 2016년 4월 11일
Please suggest the solution for the encoutering problem below:
syms x V; Pr=solve( int(x.^2.* exp(-x-1./(x+V)),x,1,inf )-0.5 ==0,V);

답변 (1개)

Walter Roberson
Walter Roberson 2016년 4월 2일
That equation has no real-valued solution. Are you expecting a complex-valued solution?
  댓글 수: 5
modem sudhakar
modem sudhakar 2016년 4월 11일
편집: modem sudhakar 2016년 4월 11일
Dear walter, I plotted the function by varying V as:
for V=0:1:10 plot(V,integral(@(x) x.^2.* exp(-x-1./(x+V)),1,inf )); hold on end
From this I can see that it is giving positive values. So, if I want get value of V for given integral value as:
solve(integral(@(x) x.^2.* exp(-x-1./(x+V)),1,inf ))==1.4,V)
From above 'for' loop the value should come as V=1. But it is giving the error as:
Undefined function or variable 'V'.
Error in @(x)x.^2.*exp(-x-1./(x+V))
Error in integralCalc/iterateScalarValued (line 314) fx = FUN(t);
Error in integralCalc/vadapt (line 133) [q,errbnd] = iterateScalarValued(u,tinterval,pathlen);
Walter Roberson
Walter Roberson 2016년 4월 11일
You need to make the integral symbolic. Then vpasolve for V

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

카테고리

Help CenterFile Exchange에서 Utilities for the Solver에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by