how to calculate the integral of function y=sqrt(c*exp(d*x)+g/x-1)?
古いコメントを表示
Here, c,d and g are constants. I've tried quad=(F,a,b),but there is something wrong with the answer. i wrote function correctly,but answer shown contains "i" number. What's wrong with this? help me
1 件のコメント
Matt Tearle
2011 年 2 月 19 日
Without seeing the code, it's hard to say what the issue is. Given there's a sqrt in the integrand, complex answers are possible.
回答 (1 件)
Matt Fig
2011 年 2 月 19 日
Taking the square root does that sometimes. If you want to check your answer, show us c,d,g,a and b. For some numbers we get a real answer:
c = 2; d = 3; g = 5;
y=@(x) sqrt(c*exp(d*x)+g./x-1)
quad(y,0,1)
カテゴリ
ヘルプ センター および File Exchange で Numerical Integration and Differentiation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!