dharr

Dr. David Harrington

8205 Reputation

22 Badges

20 years, 338 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@Rouben Rostamian  If the point is that this is not useful as a numerical method, then I agree. But it does allow one to deduce the correct symbolic solution at x=0, which can then be verified and is well behaved. That presumably is a hint for the solution for general x.

In the post I wasn't enthusiastic about it as a numerical method, and the plot there shows divergence at relatively small x and t values for that example, though not as bad as here. Some of the literature I've seen only gives such comparisons for very short times, before the solution becomes poor.

restart;

Diff(u(x,t),t) = Diff(u(x,t)^3, x, x);
pde := value(%):

Diff(u(x, t), t) = Diff(u(x, t)^3, x, x)

ic := simplify(75^(1/4)*sqrt(sqrt(3)/15 - x^2*sqrt(75)/12));

(1/2)*(-25*x^2+4)^(1/2)

Known exact solution

exact := sqrt(sqrt(3)/15 - (5*x^2)/(4*sqrt(225*t + 3)))/(t + 1/75)^(1/4);

(1/30)*(60*3^(1/2)-1125*x^2/(225*t+3)^(1/2))^(1/2)/(t+1/75)^(1/4)

Calculate many terms

n := 30;
approx := LAD(pde, u(x,t), ic, t, n):

30

Case of x=0

approx0:=eval(approx, x = 0):
[seq(coeff(approx0, t, i), i = 0..n)]:
sol0:=gfun:-guessgf(%,t)[1];

1/(1+75*t)^(1/4)

Agrees with the exact solution at x = 0

simplify(eval(exact, x=0) - sol0);

0

plot(sol0, t = 0..1);

All terms calculated agree with the series solution up to the number of terms calculated.

series(sol0, t, n+1, oterm = false) - approx0;

0

At 30 terms, the approximate solution diverges from the exact at about t = 0.013

plot([approx0, sol0], t=0..0.02, 0..1, color = [red, blue]);

NULL

Download LAD_Barenblatt0.mw

 

@Rouben Rostamian  The discontinuity may pose problems. Apparently "a given initial condition is consistent only with a specific set of boundary conditions"[1]; not sure if that applies here. Anyway, the method gives the same answer as a series expansion of the exact solution in t, so the algorithm appears to work. The hard part is deducing a simple closed form from the series solution, and I didn't make much progress here (I tried not to cheat since I knew the answer.)

LAD_Barenblatt.mw

[1] A. Garcıa-Olivares, Kybernetes, 32 (2003) 548.

@janhardo 

Yes, it can definitely be extended to other types of PDEs. Nonlinear parts that are more complicated than polynomials, such as exp(U*U[x]), might work with the existing code just by removing the polynom check, but I haven't tested it so I'm being careful. Additional time-dependent derivative terms can probably be added to L, and mixed time/spatial terms can probably be dealt with; these just need more code to detect and deal with the initial conditions. ODEs can be dealt with just by treating the highest-order term similarly to the time-dependent term here.

One difficulty is finding reliable test cases in the literature; the literature in this area is full of typos and missing information, for example figures that give values for most but not all of the parameters.

@salim-barzani The value you set for infolevel[LAD] determines how much extra information is printed out durung the calculation. You do not have to set it at all, in which case there is no extra information printed out. Or you can set it to 1, 2, 3 or 4 to include the information described at the top of the worksheet. Setting to 0 gives no information and setting to > 4 is the same as setting to 4. Many Maple commands, e.g., solve, will print information if you set infolevel.
 

In the code I used the userinfo commend to actually print out the information.

@KIRAN SAJJAN You didn't provide a worksheet. Did you change Sb? But if there are remaining errors they probably arise from other errors in the paper, rather than the Maple.

@KIRAN SAJJAN When I look at the worksheet it looks like H = Sb*D(Phi)(0)/(Le*Pr) instead of H(0) = Sb*D(Phi)(0)/(Le*Pr), but it is more than that.

Actually I think the original boundary condition is correct but the sign of Sb is wong. If I set Sb = -1 instead of Sb = 1, then I get correct looking plots. Later in the paper there is a plot where H is either positive or negative at eta = 0 for different signs of Sb.

restart

Parameters as in figures provided.

params := {Cs = .5, Ha = .2, Le = 3, Mc = .2, Nb = .2, Nc = 5, Nr = .2, Nt = .2, Pr = 6, Sb = -1, Ts = .5}

{Cs = .5, Ha = .2, Le = 3, Mc = .2, Nb = .2, Nc = 5, Nr = .2, Nt = .2, Pr = 6, Sb = -1, Ts = .5}

OdeSys := diff(F(eta), eta, eta)-(diff(F(eta), eta))*H(eta)-F(eta)^2+G(eta)^2-Ha*F(eta)+Mc*(Theta(eta)+Nc*Theta(eta)^2-Nr*Phi(eta)), diff(H(eta), eta)+2*F(eta), diff(G(eta), eta, eta)-(diff(G(eta), eta))*H(eta)-2*F(eta)*G(eta)-Ha*G(eta), diff(Theta(eta), eta, eta)-Pr*(H(eta)*(diff(Theta(eta), eta))+F(eta)*Theta(eta))+Pr*Nb*(diff(Theta(eta), eta))*(diff(Phi(eta), eta))+Pr*Nt*(diff(Theta(eta), eta))^2, diff(Phi(eta), eta, eta)-Le*Pr*H(eta)*(diff(Phi(eta), eta))+F(eta)*Phi(eta)+Nt*(diff(Theta(eta), eta, eta))/Nb; Cond := F(0) = 0, G(0) = 1, H(0) = -Sb*(D(Phi))(0)/(Le*Pr), Theta(0) = 1+Ts*(D(Theta))(0), Phi(0) = 1+Cs*(D(Phi))(0), F(10) = 0, G(10) = 0, Theta(10) = 0, Phi(10) = 0

F(0) = 0, G(0) = 1, H(0) = -Sb*(D(Phi))(0)/(Le*Pr), Theta(0) = 1+Ts*(D(Theta))(0), Phi(0) = 1+Cs*(D(Phi))(0), F(10) = 0, G(10) = 0, Theta(10) = 0, Phi(10) = 0

indets(eval([OdeSys], params))

{eta, F(eta), G(eta), H(eta), Phi(eta), Theta(eta), diff(F(eta), eta), diff(G(eta), eta), diff(H(eta), eta), diff(Phi(eta), eta), diff(Theta(eta), eta), diff(diff(F(eta), eta), eta), diff(diff(G(eta), eta), eta), diff(diff(Phi(eta), eta), eta), diff(diff(Theta(eta), eta), eta)}

 

Let's make some approximate solutions that look like the figure. Three look exponential, one looks Gaussian and one looks like linear times exponential.

F__0 := .5*eta*exp(-eta); plot(F__0, eta = 0 .. 8)

.5*eta*exp(-eta)

H__0 := -.8+.75*exp(-.3*eta^2); plot(H__0, eta = 0 .. 8)

-.8+.75*exp(-.3*eta^2)

`Φ__0` := .7*exp(-2*eta); `Θ__0` := `Φ__0`; plot(`Φ__0`, eta = 0 .. 3)

.7*exp(-2*eta)

.7*exp(-2*eta)

G__0 := exp(-eta); plot(G__0, eta = 0 .. 3)

exp(-eta)

ans := dsolve(eval([OdeSys, Cond], params), {F(eta), G(eta), H(eta), Phi(eta), Theta(eta)}, numeric, approxsoln = [F(eta) = F__0, G(eta) = G__0, H(eta) = H__0, Phi(eta) = `Φ__0`, Theta(eta) = `Θ__0`], output = listprocedure)

plots:-odeplot(ans, [[eta, H(eta)], [eta, F(eta)], [eta, G(eta)], [eta, Phi(eta)], [eta, Theta(eta)]], eta = 0 .. 5)

 

Download dsolve2.mw

 

@KIRAN SAJJAN In the pdf, eq 13 is

and in your worksheet you have H(0) = -Sb*D(Phi)(0)/(Le*Pr). Now from the figures D(Phi)(0) is negative, and Sb, Le and Pr are positive, so H(0) will be positive, as it is in your worksheet. But according to the figure, H(0) must be negative. So the paper and your worksheet are wrong. I am suggesting you try removing the negative sign in this boundary condition and see if that works. Of course there may be other errors because of other errors in the paper or your worksheet related to the physics, but as far as I can see Maple is correctly doing what you asked it to do.

@KIRAN SAJJAN Your sahin_base_paper.mw won't run for me - in one of the boundary conditions (the one mentioned in my answer) you have "phis" instead of phi. The plots in that worksheet still have positive H at eta = 0 and you did not change the sign in the boundary condition. lt appears that you didn't read the comment at the end of my worksheet.

@mmcdara Thanks. I used to use approxsoln fairly frequently when I was solving these sorts of Navier-Stokes related systems, and it was always hit-and-miss. I think I was lucky here since the actual solution for H at eta=0 was only a small positive value not too different (relatively) from the negative value in the approxsoln. One can provide a digitized version if as in this case you know the solution, but usually that is not the case. Yes, ability to specify just one of the functions would be a nice feature.

@janhardo I agree that this is part of it. Large output should be suppressed because it takes time to decide it is too large to display.

@salim-barzani You omitted the eval(  , lambda=0) part, though when I added that it was still too slow.

@salim-barzani Here's how to do the plot. I don't know how to export the table; I usually generate data in Maple and write it out to a file for use in some other software. Hope someone else can help you.

 table-e2.mw

@janhardo Thanks for the exact solution and source. I'll work some more on comparisons.

@salim-barzani You have to recognize the general term manually. For simple cases guessgf can help (see here for an example).

Download Ex1.mw

@janhardo My procedure should work for cases with conjugates, which is what I think you mean by complex. My only problem is that I don't have any test cases with conjugates that have known exact solutions so I can check it.

1 2 3 4 5 6 7 Last Page 3 of 85