0
$\begingroup$

I want a table to show the values of p1 at different values of x, where x varies from 0 to 1 with increment 0.01. Thank you in advance.

x = 0.9; a = 0.7; b = 0.5; d = 1; ϕ = Pi/3; F = 0; m = 1.0;
γ1 = 5; γ = 0.7; Sc = 0.6; Sr = 1;
Pr = 0.5; Du = 1; Br = 0.1; β = 0.2; Bh = 4; Bm = 2; Rex = 0.5;
α = Pi/3; Fr = 1; n = 1; Da = 0.5;
theta = 0;
h1 = 1 + a*Cos[2*n*Pi*x];
h2 = -d - b*Cos[(2*n*Pi*x) + ϕ];
eqs1 = ψ''''[y] - (1/γ1^2)*ψ''''''[y] - (m^2*Cos[theta]*Cos[theta] + 1/Da)*ψ''[y] == 0;
eqs2 = θ''[y] + β + Du*Pr*σ''[y] == 0;
eqs3 = σ''[y] + Sr*Sc*θ''[y] - Sc*γ*σ[y] == 0;
(*sol=NDSolve[{eqs1,eqs2,eqs3,ψ[h1]-F/2 == 0,ψ'[h1] + 1 == 0,
ψ'''[h1] == 0,ψ[h2]+F/2 == 0,ψ'[h2]+ 1 == 0,
ψ'''[h2] == 0,θ[h1] == 0,θ[h2]- 1 == 0,
σ[h1] == 0,σ[h2]-1 == 0},{ψ,θ,σ},{y,-1.5,1.6}];*)
sol = NDSolve[{eqs1, eqs2, 
    eqs3, ψ[h1] - F/2 == 0, ψ'[h1] + 1 == 
     0, ψ'''[h1] == 0, ψ[h2] + F/2 == 0, ψ'[h2] + 1 == 
     0, ψ'''[h2] == 0, θ'[h1] - θ[h1]*Bh == 
     0, θ'[h2] - (1 - θ[h2])*Bh == 
     0, σ'[h1] - σ[h1]*Bm == 
     0, σ'[h2] - (1 - σ[h2])*Bm == 
     0}, {ψ, θ, σ}, {y, -1.5, 1.5}];
p1 = Evaluate[{ψ'''[1.5] - (1/γ1^2)*ψ'''''[1.5] -
              (m^2*Cos[theta]*Cos[theta] + 1/Da)*(ψ'[1.5] + 1.0) +
              (Rex/Fr)*Sin[α]} /. sol]
$\endgroup$
2
  • $\begingroup$ Is there a more minimal problem that you can use as an example? $\endgroup$
    – C. E.
    Commented Mar 31, 2019 at 18:33
  • $\begingroup$ I'm trying to post a new question with minimal one. $\endgroup$ Commented Mar 31, 2019 at 19:25

1 Answer 1

1
$\begingroup$

Try with this; it's fine.

h1 = (1 + a*Cos[2*n*Pi*Table[x, {x, 0, 1, 0.01}]]) // Flatten;
h2 = (-d - b*Cos[(2*n*Pi*Table[x, {x, 0, 1, 0.01}]) + ϕ]) //Flatten;

t1 = Table[ψ[h1[[i]]] == 0, {i, 1, 101}];
t2 = Table[ψ'[h1[[i]]] + 1 == 0, {i, 1, 101}];
t3 = Table[ψ'''[h1[[i]]] == 0, {i, 1, 101}];
t4 = Table[ψ[h2[[i]]] == 0, {i, 1, 101}];
t5 = Table[ψ'[h2[[i]]] + 1 == 0, {i, 1, 101}];
t6 = Table[ψ'''[h2[[i]]] == 0, {i, 1, 101}];
t7 = Table[θ'[h1[[i]]] - θ[h1[[i]]]*Bh == 0, {i, 1, 101}];
t8 = Table[θ'[h2[[i]]] - (1 - θ[h2[[i]]])*Bh == 0, {i, 1, 101}];
t9 = Table[σ'[h1[[i]]] - σ[h1[[i]]]*Bm == 0, {i, 1, 101}];
t10 = Table[σ'[h2[[i]]] - (1 - σ[h2[[i]]])*Bm == 0, {i, 1, 101}];

eqns = Join[t1, t2, t3, t4, t5, t6, t7, t8, t9, t10]

I have Error down here somewhere, i recommend you try test every step you make to make sure it's all right!

eqs1 = 
  Table[
    ψ''''[y[[i]]] - (1/γ1^2)*ψ''''''[y[[i]]] -
      (m^2*Cos[theta]*Cos[theta] + 1/Da)*ψ''[y[[i]]] == 0, 
    {i, 1, 101}];

eqs2 = Table[θ''[y[[i]]] + β + Du*Pr*σ''[y[[i]]] == 0, {i, 1, 101}]

eqs3 = Table[σ''[y[[i]]] + Sr*Sc*θ''[y[[i]]] - Sc*γ*σ[y[[i]]] == 0, {i, 1, 101}];

sol = NDSolve[{eqs1, eqs2, eqs3}, {eqns}, {ψ[y], θ[y], σ[y]}, {y, -1.5, 1.5}];
$\endgroup$
2
  • $\begingroup$ i used 101 length because in h1 and h2 give list of length 101 $\endgroup$
    – nufaie
    Commented Mar 31, 2019 at 21:30
  • $\begingroup$ @Biswajit Mallick did you solved it !? $\endgroup$
    – nufaie
    Commented Apr 1, 2019 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.