How can I solve my differential equation with Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter Hertz
  • Start date Start date
  • Tags Tags
    Mathematica
Click For Summary
SUMMARY

The discussion focuses on solving a differential equation using Mathematica, specifically the equation D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0. The user encounters an error related to boundary value specifications while using NDSolve. The solution provided involves using DSolve to derive a generic solution, which includes complex functions C[1] and C[2]. Understanding the behavior of these complex functions is essential for satisfying the boundary conditions imposed by the problem.

PREREQUISITES
  • Familiarity with Mathematica 12.0 syntax and functions
  • Understanding of partial differential equations (PDEs)
  • Knowledge of boundary value problems
  • Basic concepts of complex functions
NEXT STEPS
  • Study the use of DSolve in Mathematica for solving differential equations
  • Learn about boundary value problems and their implications in PDEs
  • Explore complex function theory to understand C[1] and C[2]
  • Review Mathematica's documentation on NDSolve and its boundary condition requirements
USEFUL FOR

Mathematics students, researchers in applied mathematics, and anyone working with differential equations in Mathematica will benefit from this discussion.

Hertz
Messages
180
Reaction score
8
Hi, I can't quite figure out what I'm doing wrong here. I tried restarting mathematica as well which is what fixed my previous problem

Code:
Clear[eqn, soln, u, x, y]
eqn = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0;
soln = NDSolve[{eqn, u[x, 0] == Sin[x], u[0, y] == 0, u[1, y] == 0}, 
  u[x, y], {x, 0, 1}, {y, 0, 1}]

and I'm getting the error:
Code:
NDSolve::ivone: Boundary values may only be specified for one independent variable. Initial values may only be specified at one value of the other independent variable. >>
 
Physics news on Phys.org
There are rules about how you can and can't specify conditions when trying to solve differential equations and the wording of the error message appears to fairly clearly state that you have violated that rule. There is an entire text published on only how to solve differential equations with Mathematica, and it is barely an introduction to the subject.

This will get you part way to a solution

In[1]:= Clear[eqn, soln, u, x, y];
eqn = D[u[x, y], {x, 2}] + D[u[x, y], {y, 2}] == 0;
DSolve[{eqn}, u[x, y], {x, y}]

Out[1]= {{u[x, y] -> C[1][I x + y] + C[2][-I x + y]}}

So that says the generic solution to your problem consists of unknown functions C[1] and C[2] each of which accept a complex argument. Your u[x,0]==Sin[x] puts pretty tight requirements on what C[1] and C[2] are. Do you know just enough about complex functions to guess what C[1] and C[2] are? With that you might be able to fiddle a little and guess how to then modify those to satisfy your two remaining conditions.
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
Replies
1
Views
2K