Creating a Discontinuous 3D Function for Quantum Dots

  • Context: Undergrad 
  • Thread starter Thread starter Ben Wilson
  • Start date Start date
  • Tags Tags
    3d Function
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
4 replies · 2K views
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