From: peter lindsay on
forgive the simplicity of this:

D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0


BCs={u[0, y] == 0, u[x, 0] == 0, u[1, y] == 0, u[x, 1] ===
Sin[=F0 x]}


DSolve etc, etc, etc...


A solution is Sin[Pi x] Sinh[Pi y]


How can I get mathematica to come up with this gem ?


thanks, and sorry again for any stupidity on my part


Peter Lindsay
From: peter on
sorry, typo - should have read

BCs=={u[0, y] ==== 0, u[x, 0] ==== 0, u[1, y] ==== 0, u[x, 1] ====Sin[Pi x]}

On 2 June 2010 07:05, peter lindsay <plindsay2(a)googlemail.com> wrote:
> forgive the simplicity of this:
>
> D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] ==== 0
>
>
> BCs=={u[0, y] ==== 0, u[x, 0] ==== 0, u[1, y] ==== 0, u[x, 1] ======
> Sin[==F0 x]}
>
>
> DSolve etc, etc, etc...
>
>
> A solution is Sin[Pi x] Sinh[Pi y]
>
>
> How can I get mathematica to come up with this gem ?
>
>
> thanks, and sorry again for any stupidity on my part
>
>
> Peter Lindsay
>

From: Murray Eisenberg on
You have a superfluous third = at the end of the first line of the
definition of BCs. And something got garbled in the message; is "=F0" a
version of some ASCII code?

I presume you meant there that u[x,1]==Sin[x].

If so, then obviously the alleged solution does not satisfy that last
boundary condition:

Sin[Pi x] Sinh[Pi y] /. y -> 1 // InputForm
Sin[Pi*x]*Sinh[Pi]


On 6/2/2010 2:05 AM, peter lindsay wrote:
> forgive the simplicity of this:
>
> D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0
>
>
> BCs={u[0, y] == 0, u[x, 0] == 0, u[1, y] == 0, u[x, 1] ===
> Sin[=F0 x]}
>
>
> DSolve etc, etc, etc...
>
>
> A solution is Sin[Pi x] Sinh[Pi y]
>
>
> How can I get mathematica to come up with this gem ?
>
>
> thanks, and sorry again for any stupidity on my part
>
>
> Peter Lindsay
>

--
Murray Eisenberg murrayeisenberg(a)gmail.com
80 Fearing Street phone 413 549-1020 (H)
Amherst, MA 01002-1912

From: stejaes on
On Jun 2, 8:05=C2 am, peter lindsay <plinds...(a)googlemail.com> wrote:
> forgive the simplicity of this:
>
> D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0
>
> BCs={u[0, y] == 0, u[x, 0] == 0, u[1, y] == 0, u[x, 1] ==
==
> =C2 Sin[=F0 x]}
>
> DSolve etc, etc, etc...
>
> A solution is Sin[Pi x] Sinh[Pi y]
>
> How can I get mathematica to come up with this gem ?
>
> thanks, and sorry again for any stupidity on my part
>
> Peter Lindsay

This is an 2D elliptic problem. A good solution in Mathematica is
given in den Mathematica Navigator
from Heike Ruskeep=C3=A4=C3=A4, Chap. 24.2.5.

\!\(TraditionalForm\`u(x, y) = =E2=88=91\+\(n = 1\)\%=E2=88=9E\( A\_n\)\(sin(\(v\_n\)
x)\) \
\(sinh(\(v\_n\)(b - y))\), \ \ \
v\_n = \(n\ =CF=80\)\/a, \ \ \ A\_n = \(2\/\(a\ \(sinh(\(v\_n\)
b)\)\)\) \(=E2=88=AB\_0\%a\( f(
x)\) \(sin(\(v\_n\) x)\) \(\(\[DifferentialD]x\)\(.\)\)\)
\)

In your case f(x)=Sin[F0 x]. 0 and a switch their role for x and y
remains unchanged.

vn=n Pi;
An = Simplify[2/( Sinh[vn]) Integrate[f Sin[vn x], {x, 0,1}], n =E2=88=88
Integers]
term = An Sin[vn x] Sinh[vn (1 - y)].

Prefer your own check for signs. Evaluating, approximating and
plotting are usual then.

From: schochet123 on
Depending on the generality you are trying to achieve, this problem is
very far from simple.

If all one wanted was to obtain the solution Sin[Pi x] Sinh[Pi y]/
Sinh[Pi] for the specific problem
{D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0 , u[0, y] == 0, u[x, 0]
== 0, u[1, y] == 0, u[x, 1] =Sin[x]}
then one could define

myDSolve[D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0 , u[0, y] == 0,
u[x, 0] == 0, u[1, y] == 0, u[x, 1] ==Sin[Pi x]},u,{x,y}]={{u=
-
>Function[{x,y}, Sin[Pi x]Sinh[Pi y]/Sinh[Pi] ]}}

Why can't the built-in DSolve find that answer? I am not from Wolfram,
but it seems to me that DSolve doesn't attempt to find check whether
specific functions are solutions, because there are infinitely many
equations that have explicit solutions and looking for all of them
would take too long. As a simple example, consider a homogeneous
linear variable-coefficient single ODE in the variable x. Whenever the
sum of all the coefficients equals zero then E^x is a solution. You
can easily add an appropriate set of boundary conditions that make E^x
be the unique solution. However, if the ODE is complicated enough then
Mathematica will not find that solution. If it were to look for such
solutions, then why not look for the solutions E^(2 x) or E^(k x) for
arbitrary k or arbitrary polynomial solutions, or ...

The upshot is that DSolve uses a set of algorithms that solve entire
classes of problems.
What class of problems does the above problem belong to?

1) If you want to solve the 2-D Laplace equation on any rectangle with
Dirichlet boundary conditions (u= something) on all sides, with three
conditions of the form u==0 and the fourth of the form u==f, where =
f
is c Sin[k( x-x0)]] or c Sin[k (y-y0)] and vanishes at the endpoints
of the boundary interval, then you need to check that the boundary
conditions are given for two values of each variable, that three of
the four conditions say that u equals zero, and that the fourth is of
the above form. You can then write a function myDSolve that will give
the solution u[x_,y_]=f[x] Sinh[k (y-y0)]/Sinh[k (y1-y0)] where the
boundary value f is taken on at y==y1, and the value zero at y==y0,
except that you may need to switch the roles of x and y.

2) If you want to solve the Laplace equation in arbitrary dimensions
then there are analogous but more complicated formulas.

3) If you have nonzero boundary values on all sides then in dimension
d the solution will be a sum of 2^d terms of the above form.

So it should be possible to write a Mathematica program that will find
solve problems of generality 1-3. However:

4) If you want to allow the boundary data f to be an arbitrary smooth
function that vanishes at the endpoints of the boundary interval then
you need to calculate its Fourier Sine coefficients and form an
infinite series of solutions of the above form. In general Mathematica
will not be able to calculate Integrate[f[x] Sin[k x],{x,0,Pi}] to
obtain those coefficients.

Moreover, even when Mathematica does calculate the above integral,
substituting specific values for k may yield 0/0 and hence give the
answer Indeterminate. For example try calculating the general formula
for the Fourier Sine coefficients on the interval [0,Pi] of the
function f[x_]= x Sin[3 x]. For this particular function it is easy to
see that this problem occurs only for k==3, but in general it is
probably not possible to determine what the bad values of k are.

5) If you want to allow more general boundary conditions and more
general PDEs you will find that in general you cannot calculate
explicitly the appropriate eigenfunctions to use in the series
expansion, at which point you are stuck.

So (Disclaimer once again: I am not from Wolfram so this is just a
guess) the reason DSolve does not find your solution is apparently
that generality levels 1-3 seem too specific to bother implementing,
while levels 4-5 are too difficult.

Steve


On Jun 2, 9:05 am, peter lindsay <plinds...(a)googlemail.com> wrote:
> forgive the simplicity of this:
>
> D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0
>
> BCs={u[0, y] == 0, u[x, 0] == 0, u[1, y] == 0, u[x, 1] ==
==
> Sin[=F0 x]}
>
> DSolve etc, etc, etc...
>
> A solution is Sin[Pi x] Sinh[Pi y]
>
> How can I get mathematica to come up with this gem ?
>
> thanks, and sorry again for any stupidity on my part
>
> Peter Lindsay