matlab and latex examples - Department of Mathematics, University ...
Recommend Documents
26 Jul 2010 ... Figure Annotation. M-File Publishing. Matrices. LATEX in Matlab. Aaron Biddings.
Electrical and Computer Engineering. Auburn University.
The Third Edition of the MATLAB Primer is based on version 4.0/4.1 of ...
MATLAB Primer are always available via anonymous ftp from: ...... natural
logarithm.
Bruce Hughes, Laurence R Taylor, Shmuel Weinberger and Bruce Williams
introduced by Browder and Quinn [7], and is quite similar to the Whitney theory,
but.
given in the Department of Mathematics at Oregon State University. The goals of
the course are to give an introduction to some standard mathematical software ...
9. nn05_narnet - Prediction of chaotic time series with NAR neural network. 10.
nn06_rbfn_func .... For example, classify an input vector of [0.7; 1.2] p = [0.7; 1.2].
Tutorial: Krylov Subspace Methods. Per Christian Hansen. Technical University
of Denmark ... 1947: The Simplex Method for Linear Programming. 1950: Krylov ...
Office Hours: Course Examiner: Dr. D. Sen, E-mail: [email protected] ...
a) The weighted average of two class tests (30%) and of the final examination ...
illustration shown below). If you are building a matrix horizontally, then each component matrix must have the same number of rows. When building vertically ...
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a .... General Solution . ..... 8-61.
Interpolating Scattered Data Using the scatteredInterpolant. Class . ... Creating an
Example File . ...
How to Contact MathWorks www.mathworks.com. Web comp.soft-sys.matlab.
Newsgroup www.mathworks.com/contact_TS.html Technical Support.
Oct 9, 2003 ... This document originated in ∼/fessler/l/tex/tr/tips. ... In this example, we had to
add the extra backslash after \lam, since otherwise the space ...
Oct 27, 2016 - The Skogestad's method assumes you apply a step on the input ( ) and then observe the response and .... strictly in the left half plane (has strictly negative real part). .... âGolden rulesâ of Stability Margins for a Control Syst
Fuzzy Logic Examples using Matlab. Consider a very simple example: We need
to control the speed of a motor by changing the input voltage. When a set point.
PROBLEM DESCRIPTION: Design a neural network for the recursive prediction of chaotic Mackay-Glass ... [Xs,Xi,Ai,Ts,EWs,shift] = preparets(net,Xnf,Tnf,Tf,EW).
MATLAB notation Mathematical notation Meaning of the operation ... Use
MATLAB to plot 2 vectors, a blue vector connecting the points P = (1,−3,5) and Q
=.
Note that there's an alternative way of producing maths in LATEX - A. MS-L.
ATEX. See the ...... 14http://www-h.eng.cam.ac.uk/help/tpl/programs/matlab.html.
10 ...
Sep 4, 2006 ... Is this course the same as high school Precalculus? ... a course which focuses on
mathematical problem solving or multi-step problem solving ...
H.W. Lenstra, Jr. These notes contain material on probability for Math 55,
Discrete mathematics. They were written to supplement sections 3.6 and 3.7 of
C. L. Liu ...
Department of Applied Mathematics. Faculty of EEMCS t. University of Twente. The Netherlands. P.O. Box 217. 7500 AE Enschede. The Netherlands.
Mar 27, 2002 - Barbara C. Cahill, MD. Lung Transplantation Program. Division ..... Mirvish SS, Williamson J, Babcock D, Chen S-C. Mutagenicity of iso-butyl ni-.
Title: Galois Theory for Beginners A Historical Perspective. Author: Jörg
Bewersdorff. ISBN: 978–0–8218–3817–4 (paperback). Title: Galois Theory.
both cases of optimal order and proportional to O(ât2+hp+1), without the need for ... or a finite difference reconstruction of the free surface has been applied [22],.
8 Stochastic differential equations for diffusion processes. 53 ..... A continuous time stochastic process is a random f
matlab and latex examples - Department of Mathematics, University ...
Our goal is to present some examples that may facilitate the use of LATEX and
MATLAB. ... We also present several pieces of MATLAB code that illustrate how
to.
MATLAB AND LATEX EXAMPLES ERNIE AND RYAN UNIVERSITY OF WASHINGTON Abstract. This seems as good a place as any for an abstract. Our goal is to present some examples that may facilitate the use of LATEX and MATLAB. This document itself is the LATEX example. The .tex file this document was created from is in fact included in the appendix (non-recursively of course). A few tricky LATEX points are also emphasized. We also present several pieces of MATLAB code that illustrate how to write scripts, functions and even use the symbolic toolbox to tackle an example inverse problem.
Date: June 2002. 1
2
Contents 1. Introduction 2. Example 1: Computing the Response Matrix 2.1. MATLAB Code for Computing Λ 3. Example 2: A Prime Number Generator in MATLAB 4. Example 3: A MATLAB script 5. Example 4: MATLAB’s symbolic manipulator 5.1. Producing Kirchhoff and response matrices 5.2. Recovering conductances via MATLAB 6. Some LATEX stuff Appendix A. The Tex file for this document (almost) References
3 3 4 4 5 5 6 6 7 9 18
MATLAB AND LATEX EXAMPLES
3
t2
¡ t1
¡
q4 ¡@
@
@t3
Figure 1. Y network 1. Introduction We present four main examples: (1) Our first example will be to write a simple MATLAB function that computes the Dirichlet to Neumann map given the Kirchhoff matrix and the number of boundary nodes. We will also present some background information on this topic to show how it can be written up in LATEX. (2) We present code for another MATLAB function that generates prime numbers. This is a good illustration of how flow control works in MATLAB. (3) There is also a MATLAB script that generates the Kirchhoff matrix for an example network (pictured in the script itself). (4) We will also take advantage of MATLAB’s symbolic manipulator to solve the inverse problem for a simple Y network as shown in figure 1. Finally we will briefly illustrate how this document was produced in LATEXand give some useful LATEX tricks, such as how to include graphics. 2. Example 1: Computing the Response Matrix 1
For a network with n nodes, the Kirchhoff matrix K is an n × n symmetric matrix formed by taking for i 6= j ½ ¾ −γ(i, j) if there is an edge from i to j K(i, j) = 0 if no such edge exists Then the diagonal entries are chosen such that each row sums to zero. K operates on the vector of potentials u to give a vector of currents φ coming out of each node. (Ku = φ) Naturally the current out of interior nodes is set to zero to agree with Kirchhoff’s Law. It’s useful to write the Kirchhoff matrix in the following block form: ¸ · A B K= BT C If all interior nodes are numbered such that they appear in the C block and all boundary nodes are in the A block, then the response matrix is just the Schur Compliment of K in C. (1)
Λ = A − BC −1 B T
1Background information is from [1].
4
ERNIE AND RYAN UNIVERSITY OF WASHINGTON
It is shown in [1] that C is invertible because K is positive semi-definite. Λ acts on the vector of boundary potentials to give the vector of boundary currents. This is therefore the Dirichlet to Neumann map. 2.1. MATLAB Code for Computing Λ. The following assumptions are necessary: • The Kirchoff matrix K is given • K has the block form as above • We know there are n boundary nodes The following is a function written for MATLAB that will compute Λ. Note that functions and scripts are saved with a .m extension and can be run from the prompt in MATLAB. %function L = getL(K,n) function L = getL(K,n) A = K(1:n,1:n); C = K((n+1):end,(n+1):end); B = K(1:n,(n+1):end); L = A - B*inv(C)*B’; 3. Example 2: A Prime Number Generator in MATLAB This program does what the name suggests and also illustrates the syntax for for loops and if statements in MATLAB. %function p=prime(n) function p=prime(n) % First prime number. p = 2; j = 1; while length(p) < n % Next number to consider. j = j+2; divisible = 0; for i = 1:length(p) if p(i) > sqrt(j) break; end if mod(j,p(i)) == 0 divisible = 1; break; end end if divisible == 0 p(length(p)+1) = j;
MATLAB AND LATEX EXAMPLES
5
end end 4. Example 3: A MATLAB script An advantage (or disadvantage) of a script over a function is that the variables are global. Any previously defined variable can be accessed by the script. Likewise, variables created or altered by the script can be accessed at the prompt. The following code created a Kirchhoff matrix for a stick-figure shaped electrical network. It also computes the response matrix for this network by calling the function getL, which was presented in example 1. % Create Kirchhoff matrix and response matrix for stick figure matrix. % % 5 1 2 % \ | / % 10--6--7 1 ~ 5 Boundary nodes % | | 6 ~ 10 Interior nodes % 9-----8 % / \ % 4 3 % p = prime(10); K = zeros(10,10); for i = 1:10 if i