Message Boards Message Boards

0
|
3158 Views
|
3 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Check if an expression is the solution of a PDE problem?

Posted 7 years ago

I have deduced a solution eq16 from the PDE problem eq13, eq14 and eq15. Now I want to examine if eq16 is the right solution. The examinations eq17, eq18 and eq19 show that eq16 can't satisfy eq13 and eq14. But I think eq16 should be right one. Please help me with checking the examination. Thanks.

eq12 = (cinf \[Theta]c \[Lambda])/(s + \[Theta]c) - (
   E^((lh - x) /Sqrt[Dc ] Sqrt[s + \[Theta]c]) F1 Sqrt[
    Dc ] \[Lambda])/
   Sqrt[ (s + \[Theta]c)] /. {Sqrt[Dc] F1 \[Lambda] -> A1, 
   cinf \[Theta]c \[Lambda] -> A2}

(*equation.*)

eq13 = s *q[x, s] - Dp*D[q[x, s], {x, 2}] - pinf + eq12 == 0

(*left boundary condition.*)

eq14 = \[Alpha]1*(q[x, s] /. x -> lh) - (D[q[x, s], x] /. x -> lh) == 0

(*right boundary condition.*)

eq15 = (D[q[x, s], x] /. x -> +\[Infinity]) == 0

(*a solution to be examined.*)

eq16 = (-A2 + pinf (s + \[Theta]c))/(s (s + \[Theta]c)) - (
  A1 Dc E^((lh - x) Sqrt[(s + \[Theta]c)/
    Dc]) (\[Alpha]1 Sqrt[Dp (s + \[Theta]c)] + Sqrt[
     s (s + \[Theta]c)]))/((Sqrt[s] + 
     Sqrt[Dp] \[Alpha]1) (s + \[Theta]c) (-Dc s + 
     Dp (s + \[Theta]c))) + (E^((s (lh - x))/Sqrt[
     Dp s]) (Sqrt[
        Dp] \[Alpha]1 (Dc s - Dp (s + \[Theta]c)) (-A2 + 
          pinf (s + \[Theta]c)) + 
       A1 s (Sqrt[Dc Dp] s + Sqrt[Dc Dp] \[Theta]c + 
          Dc \[Alpha]1 Sqrt[Dp (s + \[Theta]c)])))/(s (Sqrt[s] + 
       Sqrt[Dp] \[Alpha]1) (s + \[Theta]c) (-Dc s + 
       Dp (s + \[Theta]c)))

(*examine eq16.*)

q1[x_, s_] := eq16

eq17 = FullSimplify[
   eq14 /. {q -> (q1[#1, #2] &)}, (lh - x) < 0 && s > 0 && 
    s + \[Theta]c > 0 && Dp > 0 && Dc > 0 && \[Alpha]1 > 0] // Normal

eq18 = FullSimplify[
   eq15 /. {q -> (q1[#1, #2] &)}, (lh - x) < 0 && s > 0 && 
    s + \[Theta]c > 0 && Dp > 0 && Dc > 0 && \[Alpha]1 > 0] // Normal

eq19 = FullSimplify[
   eq15 /. {q -> (q1[#1, #2] &)}
POSTED BY: Jacques Ou
3 Replies
Posted 7 years ago

The immediate definition q1[x, s] = eq16.

POSTED BY: Jacques Ou
Posted 7 years ago

Ok, I get it. Thanks.

In[536]:= Clear[q1, q2, q3, q4, q5, q6];

In[537]:= expression = x^2;
q1[x_] := expression;
q2[y] /. q2 -> q1

Out[539]= x^2

In[540]:= q3[x_] = expression;
q4[y] /. q4 -> q3

Out[541]= y^2

In[542]:= q5[x_] := x^2;
q6[y] /. q6 -> q5

Out[543]= y^2
POSTED BY: Jacques Ou

The problem is the delayed definition q1[x_, s_] := eq16. If you give immediate definition q1[x_, s_] := eq16 you get what you expected. It is tricky. Here is a simple example:

expression = x^2;
q1[x_] := expression;
q[y] /. q -> q1

The output is x^2, not y^2, as you might expect. You avoid this kind of trap with a less convoluted code:

q1[x_] := x^2;
q[y] /. q -> q1
POSTED BY: Gianluca Gorni
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract