I am working on a project from my university, and I need some ideas on how to approach this problem.
Basically it's a very rough model of a 2-D P-N diode (I shall not bore you with the details)
I'm coding in C and I must first say I'm not a very good programmer and I only know very basic C, but enough to complete this project.
The trick here is to calculate where the depletion layer edges are, and we do that by first assuming where the edges are.
Hence.. :
and using a certain formula, the program will calculate the individual potential points within the edges, then it will 'move' the edges based on certain rules and 'reshape' it if needed.
For example the actual depletion edges might look like this (But in reality it does not) :
For simpler models (for example a 1 dimension model) I've been using a 'for' loop to calculate the individual points in the array, with the edges acting as the initial and ending conditions of the 'for' loop.
This is easy as I can move the initial and ending conditions of the 'for' loop up or down but for the more complex model the edges can move in any direction. So my question is how do I change the initial and ending conditions of my 'for' loop based on where it is calculating ?
I know this might sound confusing but please do ask if any there's any part you do not understand.
p/s sorry for the ugly MSPaint pictures.. heh
edit : I just realized you might be wondering what the middle line is. It is actually the boundary between the p side and the n side, and is fixed. The upper boundary and lower boundary are the ones that move.
Basically it's a very rough model of a 2-D P-N diode (I shall not bore you with the details)
I'm coding in C and I must first say I'm not a very good programmer and I only know very basic C, but enough to complete this project.
The trick here is to calculate where the depletion layer edges are, and we do that by first assuming where the edges are.
Hence.. :
and using a certain formula, the program will calculate the individual potential points within the edges, then it will 'move' the edges based on certain rules and 'reshape' it if needed.
For example the actual depletion edges might look like this (But in reality it does not) :
For simpler models (for example a 1 dimension model) I've been using a 'for' loop to calculate the individual points in the array, with the edges acting as the initial and ending conditions of the 'for' loop.
This is easy as I can move the initial and ending conditions of the 'for' loop up or down but for the more complex model the edges can move in any direction. So my question is how do I change the initial and ending conditions of my 'for' loop based on where it is calculating ?
I know this might sound confusing but please do ask if any there's any part you do not understand.
p/s sorry for the ugly MSPaint pictures.. heh
edit : I just realized you might be wondering what the middle line is. It is actually the boundary between the p side and the n side, and is fixed. The upper boundary and lower boundary are the ones that move.