Preparing Figures in Matlab and L A TEX for Quality Publications



Similar documents
Pulse Width Modulated (PWM) Drives. AC Drives Using PWM Techniques

Electrical Resonance

Pulse Width Modulated (PWM)

KaleidaGraph Quick Start Guide

Intro to Excel spreadsheets

R Graphics Cookbook. Chang O'REILLY. Winston. Tokyo. Beijing Cambridge. Farnham Koln Sebastopol

EDUMECH Mechatronic Instructional Systems. Ball on Beam System

Adobe Illustrator CS5 Part 1: Introduction to Illustrator

Plotting: Customizing the Graph

EE 402 RECITATION #13 REPORT

MODELLING AND SIMULATION OF SVPWM INVERTER FED PERMANENT MAGNET BRUSHLESS DC MOTOR DRIVE

Signal Processing First Lab 01: Introduction to MATLAB. 3. Learn a little about advanced programming techniques for MATLAB, i.e., vectorization.

Power Electronics for Renewable Energy Integration into Hybrid AC/DC Microgrids Kai SUN Aug 27, 2015

How long is the vector? >> length(x) >> d=size(x) % What are the entries in the matrix d?

Performance of 3-Phase 4-Wire Solid State Transformer under Imbalanced Loads

WIND TURBINE TECHNOLOGY

Beginner s Matlab Tutorial

Modelling, Simulation and Performance Analysis of A Variable Frequency Drive in Speed Control Of Induction Motor

KB COPY CENTRE. RM 2300 JCMB The King s Buildings West Mains Road Edinburgh EH9 3JZ. Telephone:

Renewable Energy Applications: Photovoltaic and Wind Energy Conversion Systems (WECS)

DCMS DC MOTOR SYSTEM User Manual

MATLAB. Creating Graphical User Interfaces Version 6. The Language of Technical Computing. Computation. Visualization. Programming

NDSU Technology Learning & Media Center

Topography of an Origin Project and Workspace

6.025J Medical Device Design Lecture 3: Analog-to-Digital Conversion Prof. Joel L. Dawson

GelAnalyzer 2010 User s manual. Contents

Links. Blog. Great Images for Papers and Presentations 5/24/2011. Overview. Find help for entire process Quick link Theses and Dissertations

Nuclear Science and Technology Division (94) Multigroup Cross Section and Cross Section Covariance Data Visualization with Javapeño

7-41 POWER FACTOR CORRECTION

Design Considerations for an LLC Resonant Converter

User s Guide to ArcView 3.3 for Land Use Planners in Puttalam District

Scicos is a Scilab toolbox included in the Scilab package. The Scicos editor can be opened by the scicos command

Understanding Poles and Zeros

Tutorial 2: Using Excel in Data Analysis

MATLAB Workshop 14 - Plotting Data in MATLAB

Instructions for Creating a Poster for Arts and Humanities Research Day Using PowerPoint

Drivetech, Inc. Innovations in Motor Control, Drives, and Power Electronics

FRENIC5000MS5 for Machine Tool Spindle Drives

Equipment: Power Supply, DAI, Transformer (8341), Variable resistance (8311), Variable inductance (8321), Variable capacitance (8331)

dspace DSP DS-1104 based State Observer Design for Position Control of DC Servo Motor

Figure 1. An embedded chart on a worksheet.

Periodontology. Digital Art Guidelines JOURNAL OF. Monochrome Combination Halftones (grayscale or color images with text and/or line art)

What is new in WiseImage

ACE: Illustrator CC Exam Guide

Fixplot Instruction Manual. (data plotting program)

SOLID MECHANICS TUTORIAL MECHANISMS KINEMATICS - VELOCITY AND ACCELERATION DIAGRAMS

Hybrid Wind-Fuel Cell Renewable Energy Utilization Scheme for Village Electricity

Modeling Grid Connection for Solar and Wind Energy

GUIDELINES FOR PREPARING POSTERS USING POWERPOINT PRESENTATION SOFTWARE

Printing Guide. MapInfo Pro Version Contents:

Microsoft Excel Basics

MATLAB Control System Toolbox Root Locus Design GUI

EDEXCEL NATIONAL CERTIFICATE/DIPLOMA UNIT 5 - ELECTRICAL AND ELECTRONIC PRINCIPLES NQF LEVEL 3 OUTCOME 4 - ALTERNATING CURRENT

Lab 1: Introduction to PSpice

CONVENTIONALLY reduced order models are being

This activity will show you how to draw graphs of algebraic functions in Excel.

Sensorless Field Oriented Control (FOC) for Permanent Magnet Synchronous Motors (PMSM)

So you say you want something printed...

MapInfo Professional Version Printing Guide

Business Objects Version 5 : Introduction

DATASTREAM CHARTING ADVANCED FEATURES

Analog signals are those which are naturally occurring. Any analog signal can be converted to a digital signal.

Linear algebra and the geometry of quadratic equations. Similarity transformations and orthogonal matrices

Charts for SharePoint

Transient analysis of integrated solar/diesel hybrid power system using MATLAB Simulink

Custom Reporting System User Guide

DataPA OpenAnalytics End User Training

Manufacturing Equipment Modeling

Interactive Voting System. IVS-Basic IVS-Professional 4.4

LAMBDA CONSULTING GROUP Legendary Academy of Management & Business Development Advisories

Coordination Control of a Hybrid AC/DC Microgrid With Various Renewable Energy Sources

Graphic Design. Background: The part of an artwork that appears to be farthest from the viewer, or in the distance of the scene.

Principles of Adjustable Frequency Drives

Analysis of System Performance IN2072 Chapter M Matlab Tutorial

A series Metric (cm) Imperial (inch)

Power Electronics. Prof. K. Gopakumar. Centre for Electronics Design and Technology. Indian Institute of Science, Bangalore.

The following is an overview of lessons included in the tutorial.

Modeling and Control for Smart Grid Integration with MPPT of Solar/Wind Energy Conversion System S. Sathish Kumar 1, B.Swapna 2, Dr.C.

Figure 1: Multiple unsynchronized snapshots of the same sinusoidal signal.

ε: Voltage output of Signal Generator (also called the Source voltage or Applied

CATIA Drafting TABLE OF CONTENTS

New Pulse Width Modulation Technique for Three Phase Induction Motor Drive Umesha K L, Sri Harsha J, Capt. L. Sanjeev Kumar

GeoGebra. 10 lessons. Gerrit Stols

Visualizing Data: Scalable Interactivity

Polynomial Neural Network Discovery Client User Guide

AN ULTRA-CHEAP GRID CONNECTED INVERTER FOR SMALL SCALE GRID CONNECTION

Creating a PowerPoint Poster using Windows

Paladin DesignBase Toolbar Functions

jorge s. marques image processing

Section 1.1. Introduction to R n

Frequency Response of FIR Filters

Preparing graphics for IOP journals

Introduction to Complex Numbers in Physics/Engineering

chapter Introduction to Digital Signal Processing and Digital Filtering 1.1 Introduction 1.2 Historical Perspective

Basic Excel Handbook

Visualization with ParaView

ABB PV + Storage REACT-3.6/4.6-TL 3.6 to 4.6 kw

Formulas, Functions and Charts

How to build text and objects in the Titler

Transcription:

Preparing Figures in Matlab and L A TEX for Quality Publications Azad Ghaffari Cymer Center for Control Systems and Dynamics - UC San Diego Second Edition, January 214

Image formats: Vector vs. Raster Raster graphics or bitmap Made up of individual pixels, resolution dependent Resizing reduces quality Minimal support for transparency Conversion to vector is difficult File types:.jpg,.gif,.tif, and.bmp Vector graphics or line art Created mathematically w/o the use of pixels High resolution Scalable to any size w/o pixelation or quality loss Conversion to raster is easy File types:.eps,.pdf,.ai, and.dxf Vector Raster

Figures in Matlab Handle Graphics is an object-oriented structure for creating, manipulating and displaying graphics Graphics objects: basic drawing elements used in Matlab to display graphs and GUI components Every graphics object: Unique identifier, called a handle Set of characteristics, called properties Possible to modify every single property using the command-line Objects organized into a hierarchy Root Figure UI Objects Axes Hidden Annotation Axes Core Objects Plot Objects Group Objects Annotation Objects

Avoid common mistakes Don t Use graphical commands with their default setting Export figures using the export menu function Modify figure properties using the mouse Use third party graphics editors where possible Do Use functions and scripts to generate plots: Reuseability Specify figure properties: Modifability Generate your figures using print command: Controllability

plot function Calling the plot function creates graphics objects: Figures: Windows that contain axes toolbars, menus, etc. Axes: Frames that contain graphs Lineseries plot objects: Representations of data passed to the plot function Text: Labels for axes tick marks, optional titles and annotations Main functions for working with objects gcf Handle of the current figure gca Handle of the current axis in the current figure get Query the values of an object s properties set Set the values of an object s properties delet Delete an object copyobj Copy graphics object

Example t = :.1:4*pi; y = sin(t); plot(t,y) xlabel( Time(s) ) ylabel( y(t) ) title( Sin function ) legend( y=sin(t) ) y(t) 1.8.6.4.2 -.2 -.4 -.6 -.8 Sinusoidal function -1 2 4 6 8 1 12 14 Time(s) y=sin(t) Save the plot as.eps Use L A TEX command \includegraphics[width=2.5in]{sin1} Problems: Huge difference between font size of the text and figure Axes are not proportional Figure is not informative to the audience!

Figure size What is the size of your presentation? For a beamer slide: width=5.4 in, length=3.78 in What is the desired figure size? Figurewidth=4in, figureheight=2in Runfigure command before drawing the plot figure( Units, inches,... Position,[xy width height],... PaperPositionMode, auto ); (x,y)=position of the lower left side of the figure

Figure size 1.5 Sinusoidal function y=sin(t) y(t) -.5-1 5 1 15 Time(s) Dimensions are corrected Correction needed: Font size and type Axes limits Legend and labels to appear in L ATEX format

Axes settings Commands right after runningplot axis([ t(end) -1.5 1.5]) set(gca,... Units, normalized,... YTick,-1.5:.5:1.5,... XTick,:t(end)/4:t(end),... Position,[.15.2.75.7],... FontUnits, points,... FontWeight, normal,... FontSize,9,... FontName, Times ) Figure is exported to.eps

Axes setting Axes position, limits, font, and ticks locations are corrected y(t) Sinusoidal function 1.5 1 y=sin(t).5 -.5-1 -1.5 3.125 6.25 9.375 12.5 Time(s)

Labels and legend LATEX typesetting by settinginterpreter tolatex Labels can have different font sizes ylabel({ $y(t)$ },... FontUnits, points,... interpreter, latex,... FontSize,9,... FontName, Times ) xlabel( Time(s),... FontUnits, points,... FontWeight, normal,... FontSize,7,... FontName, Times )

Labels, legend, and L A TEX commands legend({ $y=\sin(t)$ },... FontUnits, points,... interpreter, latex,... FontSize,7,... FontName, Times,... Location, NorthEast ) title( Sinusoidalfunction,... FontUnits, points,... FontWeight, normal,... FontSize,7,... FontName, Times ) The figure is exported to.eps

Labels and legend Mathematical writing is corrected Figure has large white boundaries Fonts are not proportional to the values we want Sinusoidal function 2 y = sin(t) 1.5 y(t) 1.5 -.5-1 -1.5 3.125 6.25 9.375 12.5 Time(s)

How to save the plot Don t export the plot to.eps Useprint command to generate.eps files print -depsc2 myplot.eps Main vector formats -deps.eps black and white -depsc.eps color -deps2.eps level 2 black and white -depsc2.eps level 2 color -dpdf.pdf color file format

Exported.eps vs. printed.eps Exported.eps y(t) 2 1.5 1.5 -.5-1 Sinusoidal function y = sin(t) -1.5 3.125 6.25 9.375 12.5 Time(s) Printed.eps y(t) 2 1.5 1.5 -.5-1 Sinusoidal function y = sin(t) -1.5 3.125 6.25 9.375 12.5 Time(s)

Inserting.eps in L A TEX \includegraphics[options]{myplot} is useful to change the look of the.eps file Sinusoidal function 2 y(t) 1.5 1.5 -.5-1 -1.5 3.125 6.25 Time(s) 9.375

Ex. 1-1 -2-3 -4-5 2 4 6 8 1 6 4 2-2 (a) (Γ 11) 1 (b) (Γ 22) 1-1 -2-3 -4 2 4 6 8 1-5 -4 2 4 6 8 1 12 14 16 18 2 Time(s) (c) (Γ 12 ) 1 = (Γ 21 ) 1

Ex. 2 95 9 Step Down Newton Gradient Scalar 85 b D2(%) 8 75 7 Step Up 65 5 55 6 65 7 75 D 1 (%) a

Ex. 3 6 (a) (c) 6 Current(A) 4 2 4 2 C 1 252 C 3 4 5 5 C (b) 24 75 C 1 W/m 2 1 8 W/m 2 3 4 5 6 W/m 2 (d) 4 W/m 2 24 Power(W) 16 8 16 8 1 2 3 4 5 Voltage(V) 1 2 3 4 5 Voltage(V)

Ex. 4 PV module Power (W) 28 21 14 7 ( C, 1. kw/m 2 ) (25 C, 1. kw/m 2 ) (5 C, 1. kw/m 2 ) (25 C,.8 kw/m 2 ) (25 C,.6 kw/m 2 ) (25 C,.4 kw/m 2 ) Vw = 7 m/s Vw = 9 m/s Vw = 11m/s Vw = 13 m/s 2 15 1 5 Turbine power (kw) 1 2 3 4 5 Voltage(V) 2 4 6 8 1 12 Shaft speed (rad/s)

Ex. 5 6 15 Current(A) 4 2 1 5 Power(W) 1 2 3 4 5 Voltage(V) 1 2 3 4 5 Voltage(V)

Ex. 6 16 14 12 Pt (kw) 1 8 6 ES w/ inner control 4 ES w/o inner control P&O w/ FOC Pt 2 1 15 2 25 3 35 4 Time (s)

Ex. 7 7 35 35 65 38 4 6 35 38 44 42 43 3 4 445 D2(%) 55 43 38 35 5 42 4 45 3 35 38 4 4 45 5 55 6 65 7 D 1 (%)

Ex. 8 Turbine power, Pt (kw) 2 15 1 5 Vw = 7 m/s Vw = 9 Vw = 11 Vw = 13 P t = C p P w 2 4 6 8 1 12 Turbine speed, ω t (rad/s)

Export Simulink models (Not for publication) Change the orientation to portrait, landscape, or tall Open the model orient(gcs, portrait ) print the model to an.eps file specify the name of your Simulink model using the switch -s print -deps -r3 -s myfig.eps

Export Simulink models (Not for publication) Interpreted MATLAB Fcn yg(t) y_g y_g h_theta_g h_theta_g h_g_g s s+omega_h High pass 1 s K*u Fout Fin Interpreted MATLAB Fcn Sg(t) K_g Interpreted MATLAB Fcn Mg(t) Filter1 t y_n Interpreted MATLAB Fcn Interpreted MATLAB Fcn Sn(t) yn(t) Interpreted MATLAB Fcn Mn(t) h_g_n s s+omega_h y_n High pass1 1 s K*u Matrix Multiply Fout Fin -K_n Filter2 h_theta_n h_theta_n H h_h_n Interpreted MATLAB Fcn inv Gamma Riccati Sigma Fout Fin Filter3 Interpreted MATLAB Fcn N(t)

Diagrams in L A TEX Picture environment For mathematical drawings Very limited options Time consuming β = v/c = tanhχ χ u(k) x B (k) x C (k) y(k) H B (q) N[ ] H C (q)

Diagrams in L A TEX L A TEXCAD package Has a basic GUI Easy to use and very time saving Not precise, basic graphical elements with 3 different pen sizes Generates a L A TEX compatible.tex output S(t) θ ẋ = f(x,α(x,θ)) y = h(x) M(t) y s s+ω h ω l + K Λ z = y η s+ω s ΓĜ Ĝ l N(t) Ĥ ω l Σ Γ = ω r Γ ω r ΓĤΓ s+ω l

Diagrams in L A TEX L A TEXCAD package T 11,S 11 T 12,S 12 T 1n,S 1n I 1 PV 11 PV 12 PV 1n T 21,S 21 T 22,S 22 T 2n,S 2n PV 21 PV 22 PV 2n I 2 T m1,s m1 T m2,s m2 PV m1 + PV m2 V dc DC Bus T mn,s mn I m PV mn I dc

Diagrams in L A TEX L A TEXCAD package D Multivariable ES V dc I dc T 11,S 11 T 12,S 12 T 1n,S 1n I 1 PV 11 PV 12 PV 1n d 11 d 12 d 1n T 21,S 21 T 22,S 22 T 2n,S 2n I 2 PV 21 PV 22 PV 2n d 21 d 22 d 2n T m1,s m1 T m2,s m2 PV m1 + PV m2 T mn,s mn I m PV mn d m1 d m2 d mn V dc DC Bus I dc

Diagrams in L A TEX TikZ and PGF packages Many options and tools Very sophisticated Cover many types of diagrams Other useful extensions based on Tikz and PGF (T 1,S 1 ) I 1 Converter I o1 PV 1 V 1 V o1 Multivariable MPPT I (T 2,S 2 ) 2 PV 2 V 2 (Tn, Sn) In PVn Vn D 1 Converter I o2 D 2 Converter Dn Ion V o2 Von P = V dc I dc V dc I dc Inverter U inv I grid AC grid

Diagrams in L A TEX TikZ and PGF packages [(T 1,S 1 ),,(T n,s n )] T D S(t) D 1 DC/DC V 1 PV 1 P 1 D 2 DC/DC V 2 PV 2 P 2..... Dn DC/DC Vn PVn Pn P = V dc I dc M(t) High-pass filter + ˆD K s ΓĜ Ĝ Low-pass filter N(t) Γ = ργ ργĥγ Ĥ Low-pass filter

Diagrams in L A TEX TikZ and PGF packages SaA Output frequency = ωo SbA Input frequency = ωi Shaft and gearbox ScA Wind turbine B Matrix converter AC grid Wind speed = Vw Blade pitch angle = β Turbine speed = ωt Turbine inertia = Jt Ks Gearbox ratio = n Rotor inertia = J Generator IG Rotor frequency = ωr Pole pairs = p Rotor speed = ωr p vc vb va SaB SbB ScB SaC SbC ScC va vb vc N

Electrical circuits in L A TEX CrcuitTikZ package I1 IRF64 IL1 L1 LA 25-NP Io1 PV1 + C + V1 (T1, S1) I2 + PV2 V2 C 1 IR2127 IRF64 C 2 IL2 MUR22 L2 MUR22 IC1 rc1 LA 25-NP C2 IC2 Vo1 Io2 + Vo2 Electronic load + Vdc = 5V (T2, S2) IR2127 rc2 Idc PWM1 PWM2 ADC5 IL2 MPPT DS114 ADC6 ADC8 IC2 Vo2 ADC7 Vdc

How to convert L A TEX-produced figures into.eps Put figure in a separate L A TEX file Generate.dvi output using latex command Make sure figure fits in one page Convert.dvi to.eps using command line dvips -E figure.dvi-o figure.eps Open.eps file using ghostview and measure lower-left (Ax, Ay) and upper-right (Bx, By) coordinates Open.eps file using a text editor and look up %%BoundingBox: X1 Y1 X2 Y2 Replace X1 Y1 X2 Y2 with Ax Ay Bx By Command includegraphics with option clip prints only BoundingBox area on the output

References Damiano Varagnolo, How To Make Pretty Figures With Matlab, http://www.ee.kth.se/ damiano/matlab/howtomakeprettyfigureswithmatlab.pdf Version 8, 21. Yair Moshe, Advanced Matlab Graphics and GUI, http://sipl.technion.ac.il/new/download/matlab_support/matlab_guides/graphics%2and%2gui %2using%2Matlab.pdf November, 21. Richard E. Turner, Umesh Rajashekar Publication quality figures using Matlab, http://www.gatsby.ucl.ac.uk/ turner/teatalks/matlabfigs/matlabfig.pdf June, 211. Jeffrey D. Hein, Creating.eps figures using TikZ, http://heinjd.wordpress.com/21/4/28/creating-eps-figures-using-tikz/ April, 21.