how to get an analytical solution
古いコメントを表示
syms tp t
NN=((exp(-1.45*10^(-4)*tp^1.274))^1.5)/2
z=4/3*pi*NN*(t-tp)^3
Z=int(z,tp,0,t)
output is
Z =
int((2*pi*exp(-(2674777890687885*tp^(637/500))/18446744073709551616)^(3/2)*(t - tp)^3)/3, tp, 0, t)
that is not an analytical solution, then how can I get the analytical solution?
If t=10 ,how to get the numerical solution?
Thanks for reading.
1 件のコメント
Walter Roberson
2018 年 6 月 26 日
You cannot expect analytic solutions when you use exponents that are floating point numbers, as calculus does not define integrals with floating point exponents.
You should not be asking for an analytic integral for any expression that involves any floating point constants at all. If you want to express uncertainty in value (floating point values need to be considered as uncertain) then replace the floating point numbers with rationals plus a symbolic uncertainty.
採用された回答
その他の回答 (2 件)
KSSV
2018 年 6 月 26 日
syms tp t
NN=((exp(-1.45*10^(-4)*tp^1.274))^1.5)/2 ;
z=4/3*pi*NN*(t-tp)^3 ;
Z=int(z,0,t)
subs(Z,'t',10)
4 件のコメント
Walter Roberson
2018 年 6 月 26 日
No, this is not the same. This integrates with respect to the default variable, which is t rather than tp.
KSSV
2018 年 6 月 26 日
I am considering tp as a constant. I think it is a constant.
Walter Roberson
2018 年 6 月 26 日
No, the syntax
Z=int(z,tp,0,t)
means integrate z(tp) over tp = 0 to tp = t . tp is not a constant in the integral.
t might be a constant, but tp is not.
Darcy Chou
2018 年 6 月 26 日
編集済み: Darcy Chou
2018 年 6 月 26 日
Walter Roberson
2018 年 6 月 26 日
You have
NN=((exp(-1.45*10^(-4)*tp^1.274))^1.5)/2
Remember that exp(A*x)^B is the same as exp(A*B*x), so you can bring the 1.5 inside, forming
NN=exp(-1.5*1.45*10^(-4)*tp^1.274)/2
Now introduce a symbolic variable A and rewrite this as
syms tp nonnegative
syms A positive
NN = exp(-A*tp^sym(1.274)) / 2
for A = 1.5*1.45*10^(-4) but leave A as symbolic at the moment.
Then look at
z=4/3*pi*NN*(t-tp)^3
and see that this can be rewritten as
z = B * exp(-A*tp^sym(1.274)) * (t-tp)^3
for B = 4/3*pi/2
Now you want int(z, tp, 0, t)
which is int(B * exp(-A*tp^sym(1.274)) * (t-tp)^3, tp, 0, t)
which is B * int(exp(-A*tp^sym(1.274)) * (t-tp)^3, tp, 0, t)
And it turns out that MATLAB can calculate
temp = int(exp(-A*tp^sym(1.274)) * (t-tp)^3, tp, 0, t)
fairly quickly.
So the overall result is 4/3*pi/2 * subs(temp, A, 1.5*1.45*10^(-4))
3 件のコメント
Darcy Chou
2018 年 6 月 26 日
編集済み: Darcy Chou
2018 年 6 月 26 日
Walter Roberson
2018 年 6 月 26 日
Oooo... I just discovered that I had a bracket in the wrong place when I was doing the int(). MATLAB cannot calculate temp easily after all :(
Ameer Hamza
2018 年 6 月 26 日
int(exp(A*tp^1.274)*(t-tp)^3, tp)
in term of gamma function. Although gamma function is itself defined in term of an integral for most cases.
I cannot find the required definite integral because its calculation requires a pro license. But I guess maple or Mathematica might be able to give a solution for the definite integral. Although I am not sure whether such a solution will be useful for any practical purpose.
Also from @Darcy comment, it appears that the result will later be used in a numerical optimization problem. Since you are eventually using a numerical optimization algorithm, it might be better to also use numerical integration techniques instead of searching for a closed form solution.
カテゴリ
ヘルプ センター および File Exchange で Calculus についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!