0

I've been trying to plot a double well potential graph with a piecewise potential function that has 3 regions, my code however is not properly plotting what I am looking for.

This is what I got so far:

enter image description here

As you can see the plot start in the middle of the barrier between the two potential wells. It should start before the barrier at vL but is not. Any help will do, thanks!

Floern
  • 33,559
  • 24
  • 104
  • 119
user665997
  • 313
  • 1
  • 4
  • 18

1 Answers1

1

Scrape-n-paste into an empty fresh notebook and evaluate

L = 1;
bWidth = L/5;
v0 = 50;
vL = 4;
vD = 6;
v[x_] := 1 /; x < 0;
v[x_] := 1 /; x > L;
v[x_] := v0 /; (L - bWidth)/2 < x < (L + bWidth)/2;
v[x_] := vL /; 0 < x < (L - bWidth)/2;
v[x_] := vD /; (L + bWidth)/2 < x < L;
Plot[v[x], {x, -.25, 1.25}, PlotRange -> All]

enter image description here

Bill
  • 3,664
  • 1
  • 12
  • 9