# Solving differential equations

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.

• 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. – murray Dec 23 '16 at 15:24
• No boundary conditions on x ? – Valacar Dec 23 '16 at 15:31
• 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. – Mariusz Iwaniuk Dec 23 '16 at 15:37
• why are you doing Sin[y[x, z]]*Sin[y[x, z]] instead of Sin[y[x, z]]^2 ? – george2079 Dec 23 '16 at 15:45

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}] • @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. – zhk Dec 23 '16 at 17:32