# Solve a single PDE?

**URL:** <https://community.wolfram.com/t/solve-a-single-pde/10065>\
**Category:** Questions\
**Tags:** calculus, equation-solving, numerical-computation\
**Created:** [February 24, 2017, 9:38am UTC](https://community.wolfram.com/t/solve-a-single-pde/10065 "2017-02-24T09:38:10Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![xxxgebshxxx](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/xxxgebshxxx/32/33621_2.png) [@xxxgebshxxx](https://community.wolfram.com/u/xxxgebshxxx)\
**Post date:** [February 24, 2017, 9:38am UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/1 "2017-02-24T09:38:10Z")

</div>

Hi there, i’ve been doing some quantum mechanics and I wanted to solve the time dependent Schrodinger equation in 1 spacial dimension with a periodic potential in time, yet whenever I use Mathematica’s DSolve tool, I get the same argument that I input as an output..  
my argument goes as follows:

```
A=-6.104263*10^-39 ; B= i*6.625*10^-34 ;
s=DSolve[{A*D[\[?][x,t],x,x]+Sin[2\[Pi]*t]*\[?][x,t]+B*D[\[?][x,t],t]==0 ,\[?][0,t]==0, \[?][0.005,t]==0},\[CapitalPsi],{x,t}]

```

I’ve even set a boundary condition, I just don’t know what I’m doing incorrectly

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [February 24, 2017, 12:47pm UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/2 "2017-02-24T12:47:39Z")

</div>

I guess you need **NDSolve** since you are having numerical constants in your equations

---

<div class="post-metadata">

**Author:** ![xxxgebshxxx](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/xxxgebshxxx/32/33621_2.png) [@xxxgebshxxx](https://community.wolfram.com/u/xxxgebshxxx)\
**Post date:** [February 24, 2017, 9:22pm UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/3 "2017-02-24T21:22:11Z")

</div>

using the exact same code?

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [February 24, 2017, 9:40pm UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/4 "2017-02-24T21:40:19Z")

</div>

Something like:

```
A=-6.104263*10^-39;B=I*6.625*10^-34;
s=NDSolve[{A*D[\[CapitalPsi][x,t],x,x]+Sin[2\[Pi]*t]*\[CapitalPsi][x,t]+B*D[\[CapitalPsi][x,t],t]==0,\[CapitalPsi][0,t]==0,\[CapitalPsi][0.005,t]==0},\[CapitalPsi][x,t],{x,0,0.005},{t,0,1}]

```

note also that imaginary i is capital I in Wolfram Language

---

<div class="post-metadata">

**Author:** ![xxxgebshxxx](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/xxxgebshxxx/32/33621_2.png) [@xxxgebshxxx](https://community.wolfram.com/u/xxxgebshxxx)\
**Post date:** [February 24, 2017, 10:02pm UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/5 "2017-02-24T22:02:40Z")

</div>

holy molly it actually worked 😃 how do i plot it now?

---

<div class="post-metadata">

**Author:** ![sghuisman](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/sghuisman/32/27850_2.png) [@sghuisman](https://community.wolfram.com/u/sghuisman)\
**Post date:** [February 24, 2017, 10:12pm UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/6 "2017-02-24T22:12:00Z")

</div>

A=-6.104263_10^-39;B=I_6.625_10^-34;  
out=NDSolve[{A_D[[CapitalPsi][x,t],x,x]+Sin[2[Pi]_t]_[CapitalPsi][x,t]+B\*D[[CapitalPsi][x,t],t]==0,[CapitalPsi][0,t]==0,[CapitalPsi][0.005,t]==0},[CapitalPsi],{x,0,0.005},{t,0,1}]

```
sol=\[CapitalPsi]/.First[out]
Plot3D[Im[sol[x,t]],{x,0,0.005},{t,0,1},WorkingPrecision->100]

```

As you can see the solution is kinda boring; it is zero everywhere. That’s because your boundary conditions are 0…

---

<div class="post-metadata">

**Author:** ![xxxgebshxxx](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/xxxgebshxxx/32/33621_2.png) [@xxxgebshxxx](https://community.wolfram.com/u/xxxgebshxxx)\
**Post date:** [February 24, 2017, 10:41pm UTC](https://community.wolfram.com/t/solve-a-single-pde/10065/7 "2017-02-24T22:41:35Z")

</div>

hahahaha but wait, thats because it has to be… the wave function has to equal zero at the boundries…
