Software for use by VLF group Nikolai G
Software for use by VLF group Nikolai G. Lehtinen VLF Group Meeting
SVN server http: //nlpc. stanford. edu
Miscellaneous MATLAB scripts Waves in magnetized plasma -- CMA diagram Analytical solution of polynomial equations Difference equations in 2 D and 3 D Emulation of named arguments to MATLAB functions Other
Waves in magnetized plasma: CMA diagram >> plotcma(m/M, {’log’|’linear’}, [Xmin Xmax], [Ymin Ymax], {0|1}) % Arguments are optional, last “ 1” is to display the legend
Example: whistler waves
Example 2: whistler waves below LH resonance
Example 3: MHD waves
Analytical solution of polynomial equations >> [x, err]=solve_cubic(a, b, c, d) - Solves ax 3+bx 2+cx+d=0 >> [x, err]=solve_quartic(a, b, c, d, e) - Solves ax 4+bx 3+cx 2+dx+e=0 Particular useful cases: >> [t, err]=solve_depressed_cubic(p, q) - Solves t 3+3 pt+2 q=0 >> [u, err]= solve_depressed_quartic(alpha, beta, gamma) - Solves u 4+ u 2+ u+ =0
Difference equations in 2 D and 3 D =solve 2 d(A, ) - Solve a system of difference equations on a 2 D rectangular grid. The unknown is a 2 d array (nx, ny). The matrix A(nx, ny, 3, 3) determines the coefficients: dix, diy A(ix, iy, 2+dix, 2+diy) (ix+dix, iy+diy)= (ix, iy) S = solve 2 d(A, []) - Returns a sparse matrix such that S* (: )= (: ) =solve 3 d(A, ) - 3 D rectangular grid.
Emulation of named arguments % Definition of myfunction result=myfunction(varargs) allowedkeys={'key 1', 'key 2'}; nmin=2; % min. required arguments [arg 1, arg 2, arg 3, options]=parsearguments(varargs, nmin, allowedkeys) value 1=getvaluefromdict(options, 'key 1', defaultvalue 1); ------------------------% Usage of myfunction >> res=myfunction(arg 1, arg 2, 'key 2', value 2); % arg 3 <- [] % options <- {'key 2', value 2} % value 1 <- defaultvalue 1
Specialized scripts solve_booker_3 d, appletonhartree dispersion equation in magnetized plasma fwm_radiation - full-wave solution in stratified medium. See also fwm_antenna ionochem_6 spec - evolution of ionization in D region with external source modefinder - find modes in the Earthionosphere waveguide loadconstants, get. Ne, get. Nm, … - load various parameters
- Slides: 11