Presentation is loading. Please wait.

Presentation is loading. Please wait.

2015. 10. 8 Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U. Introduction to Electromagnetism.

Similar presentations


Presentation on theme: "2015. 10. 8 Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U. Introduction to Electromagnetism."— Presentation transcript:

1 2015. 10. 8 Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U. Introduction to Electromagnetism with Practice Introduction for Using MATLAB

2 Photonic Systems Lab School of EECS, S.N.U. Schedule for Experiments 1st phase 3rd week (9/15~9/21) 09 / 17 Orientation 4th week (9/22~9/28) 09 / 24No experiment 5th week (9/29~10/05) 10 / 01No experiment 6th week (10/06~10/12) 10 / 08 Ex.1 Introduction for using Matlab 2nd phase 7th week (10/13~10/19) 10 / 15No experiment (Midterm Exam #1) 8th week (10/20~10/26) 10 / 22 Ex.2 Finite difference method (1D differential eq.) 9th week (10/27~11/02) 10 / 29Ex.3 Finite difference method (2D Laplace eq.) 3rd phase 10th week (11/03~11/09) 11 / 05Ex 4 Solving Laplace eq. with the method of separation of variable 11th week (11/10~11/16) 11 / 12No experiment (Midterm Exam #2) 12th week (11/17~11/23) 11 / 19Ex.5 Solving Laplace eq. in 2D polar coordinate 13th week (11/24~11/30) 11 / 26Ex 6 Introduction about finite element method (FEM) with FEMM software 14th week (12/01~12/07) 12 / 03 Ex.7 Experiments for measurement of electromagnetic force (Room #308) 15th week (12/08~12/104 12 / 10 No experiment (Final Exam)

3 Photonic Systems Lab School of EECS, S.N.U. Overview  Matlab Interface  Vectors and Matrices  Repetitive statement  Graphics  Numerical differentiate

4 Photonic Systems Lab School of EECS, S.N.U. MATLAB Interface  Matrix Laboratory  Numerical analysis / Signal processing / Graphics  Implementation of algorithm  Based on C Grammar / Matrix calculation ① : current folder ② : command window ③ : workspace ④ : command history ①② ③ ④

5 Photonic Systems Lab School of EECS, S.N.U. Vector and Matrix (1)

6 Photonic Systems Lab School of EECS, S.N.U. Vector and Matrix (2)  Scalar multiplication (division)  Vector calculations  Dimensions  Multiplication  >>A*B (A^2):matrix multiplication  >>A.*B (A.^2):element multiplication  >>cross(A, B)  Division  >>A/B == A*inv(B)=A*B^-1  >>A\B == inv(A)*B  >>A./B:element division

7 Photonic Systems Lab School of EECS, S.N.U. Repetitive Statement  For loop  While loop  If-else loop faster form >>n=1:1:10; >>x=sin(pi/10*n);

8 Photonic Systems Lab School of EECS, S.N.U. Graphics (1)  plot()  >>plot(x1, y1, s1, x2, y2, s2 …)  bar(x, y) : bar graph  plotyy(x1, y1, x2, y2) : graphs with y tick labels on the left and right  semilogx() (semilogy(), loglog()) : same as plot(), except a logarithmic scale is used  polar(theta, rho) : polar coordinate plot, the angle theta in radian  plot3(x, y, z) : 3D plot

9 Photonic Systems Lab School of EECS, S.N.U. Graphics (2)  mesh()  >>mesh(X, Y, Z)  contour(X, Y, Z) : contour plot  surf(X, Y, Z) : 3D colored surface  pcolor(X, Y, C) : pseudocolor or checkerboard plot  Imagesc(x, y, C) : vector specifies the locations of the pixel

10 Photonic Systems Lab School of EECS, S.N.U. Numerical Differentiation (1)

11 Photonic Systems Lab School of EECS, S.N.U. Numerical Differentiation (2) % Numerical Differentiation clear all; close all; xmin=0; xmax=2*pi; dx1=0.01*pi; dx2=0.1*pi; x1=xmin:dx1:xmax; x2=xmin:dx2:xmax; y1=sin(x1); y2=sin(x2); nn1=length(x1); nn2=length(x2); diff_y_1=(y1(3:nn1)-y1(1:nn1-2))/2/dx1; diff_y_2=(y2(3:nn2)-y2(1:nn2-2))/2/dx2; figure(1); hold on; pp1=plot(x1(2:nn1-1),diff_y_1); pp2=plot(x2(2:nn2-1),diff_y_2); set(pp1,'Color','r','LineWidth',2,'LineStyle','--'); set(pp2,'Color','b','LineWidth',2,'LineStyle','none','Marker','o'); set(gcf,'Color',[1,1,1]); set(gca,'LineWidth',1,'FontSize',15,'XLim',[0 2*pi],'YLim',[-1,1]); legend('\Deltax=0.01\pi','\Deltax=0.1\pi') HW : Modify the red box to use “for loop”

12 Photonic Systems Lab School of EECS, S.N.U. Homework (DUE 10/11)

13 Photonic Systems Lab School of EECS, S.N.U. Exercise  Visualize the electric potential of two charges +10pC at (0, 0.1) and -10pC at (0, -0.1)  >> pcolor(X, Y, C)  >> caxis([cmin cmax])  >> shading flat

14 Photonic Systems Lab School of EECS, S.N.U. Thank You !


Download ppt "2015. 10. 8 Photonic Systems Laboratory School of EE, Seoul National University Photonic Systems Lab School of EECS, S.N.U. Introduction to Electromagnetism."

Similar presentations


Ads by Google