How to solve this equation which contains the complementary error function?
13 views (last 30 days)
Show older comments
% clear all;clc
format long;
syms G d t h a N positive;
G=((1-2*d*t/h^2)*exp(d*t/h^2)*erfc(sqrt(d*t/h^2))+2*sqrt(t*d/(pi*h^2)))/(1+4*d*t/a^2);
Gd=diff(G,d,1);
Gdtao=diff(Gd,t,1);
tGdtao=solve(Gdtao,t);
The code is showed above and its run result is "Warning: Explicit solution could not be found. > In solve at 169" The vesion of Matlab is R2012b.
The following is the equation:
(4*(erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2)*((2*d*t)/h^2 - 1) - (2*d^(1/2)*t^(1/2))/(pi^(1/2)*h)))/(a^2*((4*d*t)/a^2 + 1)^2) - ((2*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2))/h^2 + (erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2)*((2*d*t)/h^2 - 1))/h^2 - 1/(2*pi^(1/2)*d^(1/2)*h*t^(1/2)) - (4*d^(1/2)*t^(1/2))/(pi^(1/2)*h^3) + (4*d*t*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2))/h^4 - ((2*d*t)/h^2 - 1)/(2*pi^(1/2)*d^(1/2)*h*t^(1/2)) - (d^(1/2)*t^(1/2)*((2*d*t)/h^2 - 1))/(pi^(1/2)*h^3) + (d*t*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2)*((2*d*t)/h^2 - 1))/h^4)/((4*d*t)/a^2 + 1) + (4*t*((2*d*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2))/h^2 - d^(1/2)/(pi^(1/2)*h*t^(1/2)) + (d*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2)*((2*d*t)/h^2 - 1))/h^2 - (d^(1/2)*((2*d*t)/h^2 - 1))/(pi^(1/2)*h*t^(1/2))))/(a^2*((4*d*t)/a^2 + 1)^2) + (4*d*((2*t*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2))/h^2 - t^(1/2)/(pi^(1/2)*d^(1/2)*h) + (t*erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2)*((2*d*t)/h^2 - 1))/h^2 - (t^(1/2)*((2*d*t)/h^2 - 1))/(pi^(1/2)*d^(1/2)*h)))/(a^2*((4*d*t)/a^2 + 1)^2) - (32*d*t*(erfc((d^(1/2)*t^(1/2))/h)*exp((d*t)/h^2)*((2*d*t)/h^2 - 1) - (2*d^(1/2)*t^(1/2))/(pi^(1/2)*h)))/(a^4*((4*d*t)/a^2 + 1)^3)=0
I also tried to solve it by Maple 16 and failed, too. Looking forward to any kind help. Thanks!
0 Comments
Accepted Answer
Roger Stafford
on 19 Aug 2013
As Walter has pointed out, it is surely not possible for 'solve' to find an explicit solution for t in terms of the other variables, since your expression involves the 'erfc' function. The best you can hope for is a numerical solution. To accomplish this I would suggest you make the following substitutions in G to simplify matters. Let x = sqrt(d*t)/h and k = 4*h^2/a^2 so that
G = g(x) = ((1-2*x^2)*exp(x^2)*erfc(x)+2*x/sqrt(pi))/(1+k*x^2)
Then
dG/dd = dg/dx*dx/dd = g'(x)*sqrt(t/d)/(2*h)
and
d(dG/dd)/dt = g"(x)*dx/dt*sqrt(t/d)/(2*h)+g'(x)/sqrt(d*t)/(4*h)
= g"(x)*(sqrt(d/t)/(2*h))*sqrt(t/d)/(2*h)+g'(x)/sqrt(d*t)/(4*h)
= g"(x)/(4*h^2)+g'(x)/(4*h^2)/x
= (g"(x)*x+g'(x))/(4*h^2*x)
Hence the equation you want to solve is
g"(x)*x+g'(x) = 0
For this purpose you can use matlab's 'fzero'. For any given value of k=4*h^2/a^2 you can find the x root or roots of this equation. Having found it or them, you can immediately use the solution(s) to solve for t as
t = h^2*x^2/d
You can use your symbolic toolbox to evaluate and simplify g'(x) and g"(x) in setting up the expression g"(x)*x+g'(x) for 'fzero' to solve.
More Answers (1)
Walter Roberson
on 18 Aug 2013
I don't think there is any analytic closed-form solution.
When I experiment with some [a, d, h] values, I get quite different curve shapes depending on what I choose.
even just solving p = erfc(q) for q does not appear to have a closed form solution.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!