0
$\begingroup$

How can I solve this equation? I have to find y[x,z];

K + a*Sin[y[x, z]]*Sin[y[x, z]])*D[y[x, z], {z, 2}] - D[y[x, z], x] + 
0.5*a*Sin[2*y[x, z]]*D[y[x, z], z]*D[y[x, z], z] + 
c*P*(2*z - 1)*(b*Sin[y[x, z]]*Sin[y[x, z]] - 1) == 0

I need to solve this when the boundary conditions are y[x,0]=0 and y[x,1]=0

I'm a beginner, I don't know Mathematica well. I try to solve this with DSolve, but it doesn't give me answer.

$\endgroup$
  • $\begingroup$ Something's wrong with the syntax: after Sin[y[x, z]] you have an unmatched right parenthesis. Also, use k not K (built-in entities begin with upper-case letters; user-defined entities should begin with lower-case letters. And please lose all those totally superfluous * signs that just clutter up the expression; spaces between factors in a product suffice. $\endgroup$ – murray Dec 23 '16 at 15:24
  • $\begingroup$ No boundary conditions on x ? $\endgroup$ – Valacar Dec 23 '16 at 15:31
  • $\begingroup$ k = 1; a = 1; b = 1; c = 1; P = 1; eq = (k + a*Sin[y[x, z]]*Sin[y[x, z]])*D[y[x, z], {z, 2}] - D[y[x, z], x] + 0.5*a*Sin[2*y[x, z]]*D[y[x, z], z]*D[y[x, z], z] + c*P*(2*z - 1)*(b*Sin[y[x, z]]*Sin[y[x, z]] - 1) == 0; sol = NDSolve[{eq, y[x, 0] == 0, y[x, 1] == 0, y[0, z] == 0}, y, {x, 0, 1}, {z, 0, 1}, Method -> {"MethodOfLines", "SpatialDiscretization" -> {"TensorProductGrid", "MinPoints" -> 20}}]; Plot3D[{y[x, z] /. sol}, {x, 0, 1}, {z, 0, 1}] Works fine. $\endgroup$ – Mariusz Iwaniuk Dec 23 '16 at 15:37
  • 1
    $\begingroup$ why are you doing Sin[y[x, z]]*Sin[y[x, z]] instead of Sin[y[x, z]]^2 ? $\endgroup$ – george2079 Dec 23 '16 at 15:45
1
$\begingroup$

Your PDE is highly nonlinear because of the terms Sin[y[x, z]], so I will directly go for a numerical solution utilizing NDSolve. But there are quite a few unknowns in your PDE for a numerical solution to be found. So I assigned random values to the different parameters and choose a random boundary condition. Also keeping in mind the suggested correction in the comments.

a = 1; K1 = 1; c = 1; b = 1; P = 1;
Eq1 = K1 + a  Sin[y[x, z]] Sin[y[x, z]] D[y[x, z], {z, 2}] - 
    D[y[x, z], x] + 
    0.5  a  Sin[2*y[x, z]]  D[y[x, z], z]  D[y[x, z], z] + 
    c  P  (2  z - 1)  (b  Sin[y[x, z]]  Sin[y[x, z]] - 1) == 0;
ibcs = {y[x, 0] == 0, y[x, 1] == 0, y[0, z] == 0};
sol = NDSolve[Join[{Eq1}, ibcs], y[x, z], {x, 0, 1}, {z, 0, 1}]
    Plot3D[y[x, z] /. sol, {x, 0, 1}, {z, 0, 10}]

enter image description here

Edit You can download the worksheet from here.

$\endgroup$
  • $\begingroup$ I tried to plot a graph in a mentioned way: Plot3D[y[x, z] /. sol, {x, 0, 1}, {z, 0, 10}], but it doesn't plot. Is there another way to plot it? $\endgroup$ – Ani Dec 23 '16 at 17:16
  • $\begingroup$ @Ani It is generating the plot. I do not know what is going on your end. For your convenience, I have uploaded the MMA worksheet to Dropbox. Download it from the link given in the answer. $\endgroup$ – zhk Dec 23 '16 at 17:32

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.