Creating a Discontinuous 3D Function for Quantum Dots

  • Context: Undergrad 
  • Thread starter Thread starter Ben Wilson
  • Start date Start date
  • Tags Tags
    3d Function
Ben Wilson
Messages
90
Reaction score
16
I have, say, an ellipse in the x-y plane: (x^2/a^2) + (y^2/b^2) = 1

I want a 3d (e.g. z) function where inside the ellipse z=+1, outside z=0; the function is not continuous.

so in effect what I'm left with is a large plane where z= 0, and a small ellipse cut out raised to z=1.

How do I write what I want in terms that i can implement it in computations.

%this problem comes from describing quantum dots in 2 and 3 dimensions.
 
Mathematics news on Phys.org
Ben Wilson said:
I have, say, an ellipse in the x-y plane: (x^2/a^2) + (y^2/b^2) = 1

I want a 3d (e.g. z) function where inside the ellipse z=+1, outside z=0; the function is not continuous.

so in effect what I'm left with is a large plane where z= 0, and a small ellipse cut out raised to z=1.

How do I write what I want in terms that i can implement it in computations.

%this problem comes from describing quantum dots in 2 and 3 dimensions.
How about this?
$$f(x, y) = \begin{cases} 1, & \frac{x^2}{a^2} + \frac{y^2}{b^2} \le 1 \\
0, & \frac{x^2}{a^2} + \frac{y^2}{b^2} > 1\end{cases}$$
 
Mark44 said:
How about this?
$$f(x, y) = \begin{cases} 1, & \frac{x^2}{a^2} + \frac{y^2}{b^2} \le 1 \\
0, & \frac{x^2}{a^2} + \frac{y^2}{b^2} > 1\end{cases}$$

that looks perfect tbh. Do you have any idea how i could implement that into a program?
for instance if i have two vectors representing my x and y space, how would i go about describing this function in MATLAB or fortran or something?
 
Ben Wilson said:
that looks perfect tbh. Do you have any idea how i could implement that into a program?
for instance if i have two vectors representing my x and y space, how would i go about describing this function in MATLAB or fortran or something?
Your vectors are really points in the x-y plane. For a given point (x, y), calculate ##b^2x^2 + a^2y^2##. If this is greater than ##a^2b^2##, your function should return 0. Otherwise, it should return 0.
 
thanks you have been an amazing help
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K