Message Boards Message Boards

0
|
6034 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

How can I remove Internal precision error and get the better result?

Posted 4 years ago

I am getting an error related to precision when I run my code. I don't know how to remove this and get my output. Any help would be appreciated.

t = 1/10; Da = 10^-4; \[Epsilon] = 9/10; k = 10; Bi = 1/10; Br = 10;
A0 = Sqrt[\[Epsilon]]/Sqrt[Da];
A1 = Da + t^2/2 - Da Sech[(-1 + t)*A0] - (Sqrt[Da] t Tanh[(-1 + t)*A0])/\[Epsilon]^(3/2);
A2 = (Sqrt[Da] Sech[(-1 + t)*A0] (-t Cosh[A0] + Sqrt[Da] \[Epsilon]^(3/2) Sinh[t A0]))/\[Epsilon]^(3/2);
A3 = -((Sqrt[Da] Sech[(-1 + t)*A0] (Sqrt[Da] \[Epsilon]^(3/2) Cosh[t A0] - t Sinh[A0]))/\[Epsilon]^(3/2));
A6 = (Bi*(1 + k))/k;
Uc = -(Y^2/2) + A1;
Upm = A2*Sinh[Y*A0] + A3*Cosh[Y*A0] + Da;
Um = FullSimplify[Integrate[Uc, {Y, 0, t}] + Integrate[Upm, {Y, t, 1}]];
B1 = 1/(12 A0 Um^2 \[Epsilon]) (-6 A0^3 (A2 - A3) (A2 + A3) Br Da (-1 + t) + 2 A0 (3 A2^2 Br (-1 + t) - 3 A3^2 Br (-1 + t) + 2 Br Da (3 Da - 3 Da t + t^3) + 6 Um^2) \[Epsilon] + 3 Br (-8 A2 Da \[Epsilon] Cosh[A0 t] - 2 A2 A3 (A0^2 Da + \[Epsilon]) Cosh[2 A0 t] + 2 (A2 Cosh[A0] + A3 Sinh[A0]) (4 Da \[Epsilon] + (A0^2 Da + \[Epsilon]) (A3 Cosh[A0] + A2 Sinh[A0])) - 8 A3 Da [Epsilon] Sinh[A0 t] - (A2^2 + A3^2) (A0^2 Da + \[Epsilon]) Sinh[2 A0 t]));
B2 = -((2 Br Da t^3 + B1 t (-6 A1 + t^2) Um)/(6 Um^2));
B3 = -((A0^2 Br Da (A2 Cosh[A0] + A3 Sinh[A0])^2)/(k Um^2 \[Epsilon]));
B4 = (B1 Um (Da + A3 Cosh[A0 t] + A2 Sinh[A0 t]) - Br (Da + A3 Cosh[A0 t] + A2 Sinh[A0 t])^2 - (A0^2 Br Da (A2 Cosh[A0 t] + A3 Sinh[A0 t])^2)/\[Epsilon])/(k Um^2);
C1 = (A2 (A0^2 - Bi) (2 Br Da - B1 Um) )/(k Um^2);
C2 = (A2 A3 (4 A0^2 - Bi) Br (A0^2 Da + \[Epsilon]) )/(k Um^2 \[Epsilon]);
C3 = (A3 (A0^2 - Bi) (2 Br Da - B1 Um))/(k Um^2);
C4 = ((A2^2 + A3^2) (4 A0^2 - Bi) Br (A0^2 Da + \[Epsilon]) )/(2 k Um^2 \[Epsilon]);
C5 = (Bi (A0^2 (-A2^2 + A3^2) Br Da + (A2^2 Br - A3^2 Br - 2 Br Da^2 + 2 B1 Da Um) \[Epsilon]))/(2 k Um^2 \[Epsilon]);
C6 = (A2 Bi (-2 Br Da + B1 Um) )/(k Um^2);
C7 = -((A2 A3 Bi Br (A0^2 Da + \[Epsilon]) )/(k Um^2 \[Epsilon]));
C8 = (A3 Bi (-2 Br Da + B1 Um) )/(k Um^2);
C9 = -(((A2^2 + A3^2) Bi Br (A0^2 Da + \[Epsilon]) )/(2 k Um^2 \[Epsilon]));
eqn1 = X''''[Y] - A6*X''[Y] + C1 Sinh[A0 Y] + C2 Sinh[2 A0 Y] + C3 Cosh[A0 Y] + C4 Cosh[2 A0 Y] + C5 == 0;
eqn2 = Z''''[Y] - A6*Z''[Y] + C6 Sinh[A0 Y] + C7 Sinh[2 A0 Y] + C8 Cosh[A0 Y] + C9 Cosh[2 A0 Y] + C5 == 0;
system = {eqn1, eqn2, X''[1] == B3, Z''[1] == 0, k*X'[1] + Z'[1] == 1,X[1] == Z[1], X[t] == 0, Z[t] == 0, X''[t] == B4, Z''[t] == 0 };
{solX, solZ} = DSolveValue[system, {X[Y], Z[Y]}, Y]; // Simplify

f = Table[N[solX[Y], 16], {Y, t, 1, 1/100}

I am getting this error.

Internal precision limit $MaxExtraPrecision = 50.` reached
5 Replies

The boundary conditions are expressed in the same way as in DSolve:

NDSolveValue[system, {X, Z}, {Y, t, 1}]
POSTED BY: Gianluca Gorni

The problem has a symbolic solution, but it is problematic, because it is very complicated and it involves extremely large numbers. Have you tried NDSolve?

POSTED BY: Gianluca Gorni

I haven't tried NDSolve because I don't know how to describe the boundary condition in NDSolve.

You should write this way the solution

{solX, solZ} = DSolveValue[system, {X, Z}, Y] // Simplify;

otherwise Simplify does nothing and solX[Y] means nothing. As for the numerical calculation, you may try setting the $MaxExtraPrecision to a higher value. Or maybe you can make a symbolic simplification before applying N, if it doesn't take too long:

f = N[Simplify[Table[solX[Y], {Y, t, 1, 1/100}]], 16]
POSTED BY: Gianluca Gorni
Posted 4 years ago

Yes, you are right I have to use Simplify and solX[Y] in the correct way. For the numerical calculation, I used $MaxExtraPrecision to increase the precision but it does not work. can you check how can I get the output?

f = Block[{$MaxExtraPrecision = 1000}, N[Table[solX[Y], {Y, t, 1, 1/100}], 16]]

I also tried to do the symbolic simplification but it is taking a long time and still no result.

POSTED BY: Updating Name
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