# Solve Nonlinear 2nd Order Partial Differential Equation Numerically?

**URL:** <https://community.wolfram.com/t/solve-nonlinear-2nd-order-partial-differential-equation-numerically/835>\
**Category:** Questions\
**Tags:** mathematica, calculus, equation-solving, numerical-computation\
**Created:** [November 6, 2013, 3:16pm UTC](https://community.wolfram.com/t/solve-nonlinear-2nd-order-partial-differential-equation-numerically/835 "2013-11-06T15:16:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![achirag14](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@achirag14](https://community.wolfram.com/u/achirag14)\
**Post date:** [November 6, 2013, 3:16pm UTC](https://community.wolfram.com/t/solve-nonlinear-2nd-order-partial-differential-equation-numerically/835/1 "2013-11-06T15:16:54Z")

</div>

Hey!

I am kind of new to mathematica so I don’t know a lot of stuff…

So trying to put the question in context… I want to know if there is a way in Mathematica 9 to solve **Nonlinear Second Order Parial Differential Equation?**  
I understand that I cannot use **DSolve** since its a Second Order PDE but even with **NDSolve** , I keep getting errors..

My **PDEs** are something like this:

```auto
fpde = (1 + (D[y[x, t], t])^2) (D[y[x, t], {x, 2}]) + (1 + (D[y[x, t], x])^2) (D[y[x, t], {t, 2}]) == 0;

```

i.e.  
(1 + ( **d** y / **d** t)^2 ) \* ( **d2** y / **d** x2)) + (1 + ( **d** y / **d** x)^2 ) \* ( **d2** y / \*\*d?\*\*t2)) = 0  
where y is a function of x and t.

I also give **two boundary conditions** and **one initial conditon** while using NDSolve  
I have tried the following:

```auto
mysol = NDSolve[{fpde, y[0, t] == 0, y[2 Pi, t] == 0, y[x, Pi/4] == 0}, y, {x, 0, 2 Pi}, {t, 0, 2 Pi}]

```

> Error : The number of constraints (1) (initial conditions) is not equal to the total differential order of the system plus the number of discrete variables (2).

```auto
mysol = NDSolve[{fpde, y[0, t] == 0, y[2 Pi, t] == 0, Derivative[1, 0][y][x, 2 Pi] == Tan[x]}, y, {x, 0, 2 Pi}, {t, 0, 2 Pi}]

```

> Error: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable.

I can’t figure out if my application of the command is incorrect or if a different approach is required to solve such PDEs. **My objective is to get the numerical solution to such an equation.**

Thanks a lot!

---

<div class="post-metadata">

**Author:** ![jasong](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/jasong/32/39399_2.png) [@jasong](https://community.wolfram.com/u/jasong)\
**Post date:** [November 7, 2013, 10:03pm UTC](https://community.wolfram.com/t/solve-nonlinear-2nd-order-partial-differential-equation-numerically/835/2 "2013-11-07T22:03:42Z")

</div>

Hi,

Your system is second order in time and space. Generally, this means you need two spatial boundary conditions and two time conditions. This is the cause of the first error.

Your boundary conditions in the second case are a bit confusing. y[0, t] == 0, y[2 Pi, t] == 0 is fine, however, Derivative[1, 0][x, 2 Pi] suggests that you are specifying the spatial derivative of y at the value t = 2 Pi. If you had conditions like y[x,0] ==… and Derivative[0,1][x,0] == …, you might find more success.

---

<div class="post-metadata">

**Author:** ![achirag14](https://avatars.discourse-cdn.com/v4/letter/a/9dc877/32.png) [@achirag14](https://community.wolfram.com/u/achirag14)\
**Post date:** [November 8, 2013, 8:02pm UTC](https://community.wolfram.com/t/solve-nonlinear-2nd-order-partial-differential-equation-numerically/835/3 "2013-11-08T20:02:14Z")

</div>

Wow! That worked!  
What I was actually trying to do there -- first take the derivative wrt to x and then put the value for t as 2Pi and not the other way around.  
Thanks a lot!!!
