Course meeting times
Syllabus
Target Audience
Course description
C language will be extensively used in the implementation of various numerical algorithms discussed during the course.
To compile the file in gcc use: g++ gauss.cpp To run the file use: ./a.out You should use your favorite C++ text editor to modify the file. For more information you can also check the following word file: info.doc. Please check with me if you have trouble or want to use any other operating system. Sample project to simulate a MOSFET device
Poisson number generator
Here is an example of how to generate Poisson numbers using the Poisson(double) function. The code was compiled with the g++ compiler. Note that all generated numbers are around the average value (30). How to save and plot the electrostatic potential matrix
FILE *fp = fopen("a.dat","w"); (2) To plot the electrostatic potential in Matlab, use the following command: mesh(reshape(load('a.dat'),21,21)); Please note that, at step (1), we saved the electrostatic potential in file "a.dat". At step (2) we should load the same file in Matlab and plot it. When you do that make sure that the current directory in Matlab is the directory where you saved your "a.dat" file. To do that you can use the following command: "cd c:\YourDirrectory". Also, at step (2), "21,21" denote your (Nx+1) and (Ny+1) values. You might want to change them according to your Nx and Ny values. For instance, if Nx=Ny=30, you should use mesh(reshape(load('a.dat'),31,31));. |