0
$\begingroup$

Here is the code I was written. I want to have a surface plot. But when I write this it shows "The arguments should be ordered consistently "

a = 0.7;    
    b = 0.7;    
    d = 1.0;    
    phi = 0.01;    
    M = 3.0;    
    h1 = 1 + a*Cos[2.0*3.14*x];    
    h2 = -d - b*Cos[2.0*3.14*x + phi];          
    sol1 = NDSolve[{D[D[D[D[s[x, y], y], y], y], y] == 
        M^2*D[D[s[x, y], y], y], s[x, h1] == q/2, 
       s[x, h2] == -q/2, (D[s[x, y], y] /. y -> h1) == 
        0, (D[s[x, y], y] /. y -> h2) == 0}, s, {x, -1, 1}, {y, h2, h1}]
$\endgroup$
8
  • $\begingroup$ The error comes from terms like this: s[x, 1 + 0.7 Cos[6.28 x]] (i.e., s[x, h1]. I think the only way to have boundary conditions along a curve like this is to use FEM. Then you can set up your domain as an ImplicitRegion. $\endgroup$
    – Michael E2
    Jun 10 '17 at 20:28
  • $\begingroup$ Thanks. But I have seen such kinds of problems in many research paper tackled using NDSOLVE. $\endgroup$ Jun 10 '17 at 20:39
  • $\begingroup$ If you follow the link to the FEM documentation, you'll find I was recommending NDSolve. FEM is one of its methods. $\endgroup$
    – Michael E2
    Jun 10 '17 at 20:42
  • $\begingroup$ Okay. Actually I am new in Mathematica. Trying to learn it. $\endgroup$ Jun 10 '17 at 20:44
  • $\begingroup$ Actually, it's not a good recommendation. FEM doesn't seem to handle order 4 PDEs, at least at this point. $\endgroup$
    – Michael E2
    Jun 10 '17 at 20:49
2
$\begingroup$

The issue is with the way you defined your dependent variable s[x,y]. Infact s depends on y directly and on x indirectly through the boundary conditions, which can be treated as a parameter. So you are suppose to solve an ode for s[y] not a pde.

a = 0.7; b = 0.7; d = 1.0; phi = 0.01; M = 3.0; q = 0.5; x = 1;

h1 = 1 + a*Cos[2.0*3.14*x];

h2 = -d - b*Cos[2.0*3.14*x + phi];

sol = NDSolve[{D[D[D[D[s[y], y], y], y], y] == M^2*D[D[s[y], y], y], 
      s[h1] == q/2, s[h2] == -q/2, (D[s[y], y] /. y -> h1) == 0, 
     (D[s[y], y] /. y -> h2) == 0}, s, {y, h2, h1}]

Plot[s[y] /. sol, {y, h2, h1}]

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you. But I need a conturplot of s. Not for a particular value of x what you have done. $\endgroup$ Jun 11 '17 at 2:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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