solve equation by numerical method

8 ビュー (過去 30 日間)
JI Yong Song
JI Yong Song 2018 年 6 月 2 日
コメント済み: dpb 2018 年 6 月 2 日
i need to solve this hideous equation.
2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*erf((2^(1/2)*x3)/2))+(2^(1/2)*exp(-x3^2/2))/(pi^(1/2)*(erf((2^(1/2)*x3)/2) - 1))=0
my_function = @(x3) 2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*erf((2^(1/2)*x3)/2))+(2^(1/2)*exp(-x3^2/2))/(pi^(1/2)*(erf((2^(1/2)*x3)/2) - 1))==0;
z = solve(my_function)
when i compile this, it says "Empty sym: 0-by-1" i don't think the answer can be found. I tried the fpsolve, fzero functions too but none were effective. How do i find the root for that equation? Thank you

採用された回答

dpb
dpb 2018 年 6 月 2 日
Always try to plot() something to see what you have...
>> fnf = @(x3) 2*x3+(2^(1/2)*exp(-x3^2/2) + 2^(1/2))/(pi^(1/2)*erf((2^(1/2)*x3)/2))+(2^(1/2)*exp(-x3^2/2))/(pi^(1/2)*(erf((2^(1/2)*x3)/2) - 1));
>> ezplot(fnf)
Warning: Function failed to evaluate on array inputs; vectorizing the function may speed up its evaluation and avoid
the need to loop over array elements.
> In ezplot>ezplot1 (line 498)
In ezplot (line 154)
>> ylim([-8 8])
>>
yields
which clearly shows there is no intersection of the zero line
  2 件のコメント
Walter Roberson
Walter Roberson 2018 年 6 月 2 日
... shows there is no real-valued solution.
dpb
dpb 2018 年 6 月 2 日
Yes...

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2018 年 6 月 2 日
That equation has no real-valued solutions. It goes to negative infinity as x3 approaches 0 from below, and to positive infinity as x3 approaches 0 from above.
You might find it easier to rewrite it as a system of two equations, one involving the real part and the other involving the imaginary part, after having rewritten x3 to x3r+1i*x3i where x3r and x3i are both real-valued.
  1 件のコメント
Walter Roberson
Walter Roberson 2018 年 6 月 2 日
My experimentation suggests there are two complex-valued roots, at approximately .3382099048573570581422493 +/- 1.359657273974301366628947*1i

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

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by