Matlab

In: Other Topics

Submitted By li95
Words 57838
Pages 232
第一章

线性规划

§1

线性规划
在人们的生产实践中,
经常会遇到如何利用现有资源来安排生产,
以取得最大经济
效益的问题。此类问题构成了运筹学的一个重要分支—数学规划,而线性规划(Linear
Programming 简记 LP)则是数学规划的一个重要分支。自从 1947 年 G. B. Dantzig 提出
求解线性规划的单纯形方法以来,
线性规划在理论上趋向成熟,
在实用中日益广泛与深
入。
特别是在计算机能处理成千上万个约束条件和决策变量的线性规划问题之后,
线性
规划的适用领域更为广泛了,已成为现代管理中经常采用的基本方法之一。
1.1 线性规划的实例与定义
例 1 某机床厂生产甲、
乙两种机床,
每台销售后的利润分别为 4000 元与 3000 元。
生产甲机床需用 A、B 机器加工,加工时间分别为每台 2 小时和 1 小时;生产乙机床
需用 A、B、C 三种机器加工,
加工时间为每台各一小时。
若每天可用于加工的机器时
数分别为 A 机器 10 小时、 B 机器 8 小时和 C 机器 7 小时,问该厂应生产甲、乙机床各
几台,才能使总利润最大?
上述问题的数学模型:
设该厂生产 x1 台甲机床和 x 2 乙机床时总利润最大, x1 , x2

应满足
(目标函数) max z = 4 x1 + 3 x2
(1)

⎧2 x1 + x2 ≤ 10
⎪x + x ≤ 8
⎪ 1 2
s.t.(约束条件) ⎨
⎪ x2 ≤ 7
⎪ x1 , x2 ≥ 0


(2)

(1)式被称为问题的目标函数,
(2)中的几个不等式
这里变量 x1 , x 2 称之为决策变量,
是问题的约束条件,记为 s.t.(即 subject to)。由于上面的目标函数及约束条件均为线性
函数,故被称为线性规划问题。
总之,
线性规划问题是在一组线性约束条件的限制下,
求一线性目标函数最大或最
小的问题。
在解决实际问题时,
把问题归结成一个线性规划数学模型是很重要的一步,
但往往
也是困难的一步,模型建立得是否恰当,直接影响到求解。而选适当的决策变量,是我
们建立有效模型的关键之一。
1.2 线性规划的 Matlab 标准形式
线性规划的目标函数可以是求最大值,
也可以是求最小值,
约束条件的不等号可以
是小于号也可以是大于号。为了避免这种形式多样性带来的不便,Matlab 中规定线性
规划的标准形式为

min cT x x ⎧ Ax ≤ b

s.t. ⎨ Aeq ⋅ x = beq
⎪lb ≤ x ≤ ub

其中 c 和 x 为 n 维列向量, A 、 Aeq 为适当维数的矩阵, b 、 beq 为适当维数的列向
量。
-1-

例如线性规划

Ax ≥ b

max cT x s.t. x 的 Matlab 标准型为

min − cT x s.t. x − Ax ≤ −b

1.3 线性规划问题的解的概念
一般线性规划问题的(数学)标准型为
n

z = ∑cj xj

max

(3)

j =1

s.t.

可行解

⎧n
⎪∑ aij x j = bi i = 1,2, L, m
⎨ j =1
⎪ x ≥ 0 j = 1,2,L, n
⎩ j

(4)

满足约束条件
(4)
的解 x = ( x1 , x2 , L , xn ) ,
称为线性规划问题的可行解,

而使目标函数(3)达到最大值的可行解叫最优解。
可行域 所有可行解构成的集合称为问题的可行域,记为 R 。
1.4 线性规划的图解法
10
2 x1 + x2 = 1 0

9
8
7

x2 = 7
(2 ,6 )

6
5
4
3
2

x1 + x2 = 8

1 z= 1 2
0
0

2

4

6

8

10

图 1 线性规划的图解示意图

图解法简单直观,
有助于了解线性规划问题求解的基本原理。
我们先应用图解法来
求解例 1。对于每一固定的值 z ,使目标函数值等于 z 的点构成的直线称为目标函数等
位线,当 z 变动时,我们得到一族平行直线。对于例 1,显然等位线越趋于右上方,其…...

Similar Documents

Matlab Ode

...MATLAB 數值微積分與微分方程式求解 數值積分 ∫ b a f ( x) dx 等於由界限範圍 x = a 到 x = b 之間 曲線 f(x) 底下的面積 (a) 矩形以及 (b) 梯形 數值積分的圖解說明 數值積分 已知數據點的積分, 已知數據點的積分,不知函數 f(x):trapz : I = trapz(x, y) (梯形積分法 梯形積分法) 梯形積分法 x : 數據點之 x 值所構成的向量 y : 數據點之 f(x) 值所構成的向量 Ex: >>x=[0 10 20 30 40]; >>y=[0.5 0.7 0.9 0.6 0.4]; >>area=trapz(x,y) %梯形法 梯形法 area = 26.5000 數值積分 之形式: 已知函數 f(x) 之形式:quad , quadl I = quad(@fun, a, b) I = quadl(@fun, a, b) (適應性辛普森法) (羅伯特二次式) fun:定義函數的 function m-file 檔名 a :積分下限 b :積分上限 數值積分 Ex: ∫ 1 0 e − x cos( x) dx 1. edit fun.m function y=fun(x) y=exp(-x).*cos(x); 2. 求積分 回到Matlab Command Window) 求積分(回到 area=quadl(@fun,0,1) 亦可使用 area=quadl(‘exp(-x).*cos(x)’,0,1) NOTE: 函數內之數學運算必須使用向量個別元素之運算 (.* ./ .^) (註:比較此結果與利用trapz指令計算之結果) 數值微分 已知數據點的微分 在 x2 之微分 數值微分 可利用 diff 函數 Ex: >>x=0:0.1:1; >>y=[0.5 0.6 0.7 0.9 1.2 1.4 1.7 2.0 2.4 2.9 3.5]; >>dx=diff(x); >>dy=diff(y); >>dydx=diff(y)./diff(x) 數值微分 Ex: f ( x) = sin( x), f ′( x) = ? x ∈ [ 0, π ] >> >> >> >> >> >> >> x = linspace(0,pi,20); y = sin(x); d = diff(y)./diff(x); % backward or forward difference dc = (y(3:end)-y(1:end-2))./(x(3:end)-x(1:end-2)); % central difference dy = cos(x); % 實際微分值 plot(x, dy, x(2:end), d,'o', x(1:end-1), d,'x', x(2:end-1), dc,'^') xlabel('x'); ylabel('Derivative') 1 0.8 0.6 0.4 Derivative 0.2 0 -0.2 -0.4 -0.6 -0.8 -1 0 0.5 1 1.5 x 2 2.5 3 3.5 工程問題中常微分方程式的解 常微分方程式 常微分方程式之形式: dy = f (t, y) dt 一般解之形式: yi +1 = yi + φ......

Words: 983 - Pages: 4

Ocr Matlab

...EEN 538: DIGITAL IMAGE PROCESSING Optical Character Recognition (OCR) using binary image processing with MATLAB Abstract- Nowadays, Optical Recognition is becoming a very important tool in several fields: medicine, physics, cosmology, traffic (plate numbers), etc. We can also use this to recognize character for example to digitalize a book. We will talk about this last topic in this report: Optical Character Recognition (OCR). I. INTRODUCTION Once we have the b&w image we can start the segmentation process. To do that we can use the function “bwconncomp”. This function returns us a struct from where we can obtain the characters because it gives us all the connected components. Thus, we can use it to get all the character even if they have 2 or 3 objects. This function returns us the pixels of the connected components (characters) but we have to figure out from those, the coordinates of the character in the original matrix (row and columns). To do this, we will obtain the centroid of every connected component and from it and using the first and last pixel detected of the connect component, we can figure out the exact coordinates of the image. The idea is as follows: Firstly, we can to convert the number that the function returns us to a column and a row. We can do this using the total rows of the original image. Once we have the first and last pixel detected of the connect component in (row, column) we can figure out directly the x-coordinates of the character in the image...

Words: 1132 - Pages: 5

Matlab Ders Notu

...MATLAB Giriş Mehmet Siraç ÖZERDEM EEM - Dicle Üniversitesi Bilgisayar Programlama MATLAB TANITIM MATLAB NEDİR? MATLAB®(MATrix LABoratory – Matris Laboratuarı), temel olarak teknik ve bilimsel hesaplamalar için yazılmış yüksek performansa sahip bir yazılımdır. 1970’lerin sonunda Cleve Moler tarafından yazılan Matlab programının tipik kullanım alanları: – Matematiksel (nümerik ve sembolik) hesaplama işlemleri – Algoritma geliştirme ve kod yazma yani programlama – Lineer cebir,istatistik,Fourier analizi,filtreleme,optimizasyon,sayısal integrasyon vb. konularda matematik fonksiyonlar – 2D ve 3D grafiklerinin çizimi – Modelleme ve simülasyon (benzetim) – Grafiksel arayüz oluşturma – Veri analizi ve kontrolü – Gerçek dünya şartlarında uygulama geliştirme şeklinde özetlenebilir. 2 1 MATLAB TANITIM - Matlab, ABD menşeli The Mathworks Inc. şirketinin tescilli adıdır. Web adresi: http://www.mathworks.com - Matlab’in Türkiye temsilcisi Bursa merkezli Figes firmasıdır. Web adresi: http://www.figes.com.tr 3 MATLAB TANITIM MATLAB, matematik-istatistik, optimizasyon, neural network, fuzzy, işaret ve görüntü işleme, kontrol tasarımları, yöneylem çalışmaları, tıbbi araştırmalar, finans ve uzay araştırmaları gibi çok çeşitli alanlarda kullanılmaktadır. MATLAB, kullanıcıya hızlı bir analiz ve tasarım ortamı sağlar. • Matlab programını C/C++ diline dönüştürebilir, • 20. dereceden bir denklemin köklerini bulabilir, • 100x100 boyutlu bir......

Words: 1728 - Pages: 7

Matlab and Ode Solvers

...Lab 0: MATLAB and ODE Solvers | ME 4173 Robot Kinematics | | | | Introduction The following report will display the results and conclusions of an experiment to simulate the output of an inverse pendulum system in MATLAB. The objectives of this experiment were to review MATLAB programming and using MATLAB to simulate ODEs and systems. Objectives * Examine the basics of MATLAB * Use MATLAB to simulate a system * Use ODE solvers to numerically integrate the system over a set time period Apparatus The apparatus used in this experiment was MATLAB. It was used to provide a simulation environment to analyze the inverse pendulum’s motion. Experiments and Results There were six components of this experiment. This experiment was mostly familiarizing with MATLAB. All code used is illustrated in the Appendix – Code. The first part consisted of learning commands within the MATLAB environment. It was a brief overview of how commands work in MATLAB. There was no code used in the part of the experiment. The second part of the experiment examined how arrays were created and used in MATLAB. The first step was to create a matrix. This matrix was then subjected to various commands including eye( ), zeroes( ), and ones( ). Indexing was also used to access various parts of the matrix. Matrix operations such as transpose, inverse, size and length were also shown. Part three of the experiment explained how a script was created and what it was...

Words: 828 - Pages: 4

Matlab

...matlab Probleme teoretice ale programării în MATLAB 1. Tipul de dată numeric. 2. Tipul de dată logic. 3. Tipul de dată caracter, şir de caractere. 4. Tipul de dată data şi ora. 5. Tipul de dată structură. 6. Tipul de dată celulă. 7. Expresii numerice şi logice în MATLAB. 8. Variabile în MATLAB. Definiţie şi tipuri de variabile. 9. Crearea variabilelor şi reguli de declarare a lor. 10. Cuvinte cheie. 11. operatori şi reguli de precedenţă. 12. Constante speciale în MATLAB. 13. Matrici, vectori, scalari. Funcţia size. Crearea cu operatorul []. 14. Crearea matricelor cu funcţii speciale. 15. Concatenarea matricelor. 16. Crearea matricelor cu blocuri pe diagonală 17. Accesarea directă şi liniară a matricelor. 18. Accesarea multiplă (cu operatorul :). 19. Accesarea logic indexată. 20. Funcţii de matrici şi funcţii de manipulare a matricelor. 21. Comanda de atribuire. Comenzi de întrerupere a execuţiei buclelor. 22. Comenzi de execuţie condiţionată. 23. Comenzi de execuţie a ciclurilor. 24. M-programe (M-scripturi şi M-funcţii) 25. Erori. Exportul şi importul datelor. Listarea pe ecran. 26. Depanarea M-programelor. 27. Utilizarea eficientă a memoriei. 28. Analiza timpului de execuţie şi principalele tehnici de reducere a timpului de execuţie. 29. Modelarea cu blocuri şi conexiuni în Simulink 30. Cele mai utilizate blocuri din biblioteca de blocuri Simulink. 1. Să se......

Words: 1953 - Pages: 8

Matlab

...Matlab Assignment 7 Make the Matalb assignment discussed in the last class (least square regression estimates). Make sure that you program a function with proper comments and at least one test for sound input. Test your function with some input vectors, for example: y=[1,2,4,23,4,6,3,2] and x=[5,4,3,2,6,5,4,3] You can take any other input vectors. m.file command: function [alpha_estimate, beta_estimate] = my_regression(y,x) n = length(x) a = sum(x); b = sum(y); c = sum(x)/n; d = sum(y)/n; e = sum(x.*y); f = sum(x.*x); alpha_estimate = d-(e-n*c*d)/(f-n*c^2)*c; beta_estimate = (e-n*c*d)/(f-n*c^2); disp('alpha =') disp(alpha_estimate) disp('beta =') disp(beta_estimate) % Purpose of the function: This function is used to calculate the % coefficients of the regression formula. % Input: value of y and x % Output: alpha_estimate and beta_estimate % How to run the function: % I use n to represent the length of vector x and y % a to represent the sum of vector x % b to represent the sum of vector y % c to represent the avergae of vector x % d to represent the average of vector y % e to represent the sum of vector x and y % f to represent the sum of square of vector x %then calculating: alpha_estimate = d-(e-n*c*d)/(f-n*c^2)*c; % beta_estimate = (e-n*c*d)/(f-n*c^2); % Author: Hengya Jin % Date of last change: 11/27/2013 end Check: >>......

Words: 298 - Pages: 2

Matlab

...PARTH  PATTNI     BIOENGINEERING-­‐MATLAB  ASSIGNEMENT   a) figure subplot(2,1,1) plot(ecg_emg) ylabel('Voltage,V/mV') xlabel('Time,t/ms') title('ECG which is contaminated with EMG signals from the diaphragm') axis([0 3000 -1 2]) subplot(2,1,2) plot(ecg50hz) xlabel('Time,t/ms') ylabel('Voltage,V/mV') title('ECG containing mains contamination') axis([0 3000 -1 2]) PARTH  PATTNI     BIOENGINEERING-­‐MATLAB  ASSIGNEMENT   b & c) figure subplot(2,1,1) length=5; for x=1:3000-length+1; zecg_emg(x)=(ecg_emg(x)+ecg_emg(x+1)+ecg_emg(x+2)+ecg_emg(x+3)+ ecg_emg(x+4))/5; end plot(ecg_emg) ylabel('Voltage,V/mV') xlabel('Time,t/ms') title('ECG which is contaminated with EMG signals from the diaphragm') axis([0 3000 -1 2]) subplot(2,1,2) length=5; for x=1:3000-length+1; zecg50hz(x)=(ecg50hz(x)+ecg50hz(x+1)+ecg50hz(x+2)+ecg50hz(x+3)+ecg 50hz(x+4))/5; end plot(ecg50hz) xlabel('Time,t/ms') ylabel('Voltage,V/mV') title('ECG containing mains contamination') PARTH  PATTNI     BIOENGINEERING-­‐MATLAB  ASSIGNEMENT   axis([0 3000 -1 2]) d) figure subplot(2,1,1) length=3; for x=1:3000-length+1; zecg_emg(x)=(ecg_emg(x)+ecg_emg(x+1)+ecg_emg(x+2))/3; end plot(zecg_emg) ylabel('Voltage,V/mV') xlabel('Time,t/ms') title('ECG which is contaminated with EMG signals from the diaphragm') PARTH  PATTNI     BIOENGINEERING-­‐MATLAB  ASSIGNEMENT   axis([0 3000 -1......

Words: 645 - Pages: 3

Pelajaran Matlab

...SUPLEMEN Pemodelan Sistem / Pengolahan Sinyal / Metode Kuantitatif TUTORIAL SINGKAT MATLAB oleh: Judi Prajetno Sugiono Sekolah Tinggi Teknik Surabaya (2005, 2008, 2011) judi@stts.edu ©2005 p. 1 of 40 MATLAB Short Tutorial Reserve word (don’t used it as variable's name) · · · · · ans pi nan inf eps Special sign · · · · · % [] ; ' : line comment begin - end of matrix row separation, or not echoed command if place in the end of a statement begin - end of string indexing sign Variable is assume as matrix % empty matrix A=[] A = [] % matrix 1x1 or a constant A=[0] A = 0 % same with A=0 A = 0 % complex number: use i or j to express imaginary part z=3+4j z = 3.0000 + 4.0000i Entry a matrix % use as column separation and or as row separation A=[1 2 3; 4 5 6; 7 8 9] A = 1 4 7 2 5 8 3 6 9 Last saved by jpsugiono 9/23/2011 judi@stts.edu ©2005 p. 2 of 40 How to point element of matrix % A(row,column) A(1,3) ans = 3 % sign use as get all row or column A(2,:) ans = 4 5 6 % sign use as get from m to n cell in row or colomn A(1:2, 2:3) ans = 2 5 3 6 row and column vector % row vector a=[0 1 2 3 4 5] a = 0 1 2 3 4 5 % column vector b=[0; 1; 3; 4; 5] b = 0 1 3 4 5 % Shortcut to build a vector % init:step:final a=0:0.2:1 a = 0 0.2000 0.4000 0.6000 String % begin and end with < ' >, and act like a matrix of......

Words: 819 - Pages: 4

Matlab

...C1: MATLAB Codes t1=[37.79 39.51 38.54 39.14 39.02 39.4 39.01 37.18] t2=[22.4 22.07 22.15 21.72 21.75 22.55 22.18 21.92] T1=mean(t1) T2=mean(t2) V1=var(t1) V2=var(t2) S1=sqrt(V1) S2=sqrt(V2) MATLAB Answers T1=38.6988 T2=22.0925 V1=0.6718 V2=0.0859 S1=0.8196 S2=0.2931 C2: MATLAB Codes beta=0.98 alpha=1-0.98 z=icdf ('norm', alpha/2, 0, 1) hatmu=mean(t1); hatmu=mean(t2) s=std(t1); s=std(t2) n=length (t1); n=length (t2) margin=z*s/sqrt(8) MATLAB Answers alpha=0.02 z=2.3263 margin(t1)=0.6741; margin(t2)=0.2931 C3: MATLAB Codes syms l s b T1 T2 l=0.0496; s=1.00; b=10; T1=0.0386988; T2=0.0220925; g=((l^2)/(2*s*sind(b)))*((1/T2^2)-(1/T1^2)) MATLAB Answers g=9.7835 C4: MATLAB Codes for Partial Derivatives g=((l^2)/(2*s*sin(b)))*((1/T2^2)-(1/T1^2)) gl=diff(g,l) gs=diff(g,s) gb=diff(g,b) gT1=diff(g,T1) gT2=diff(g,T2) MATLAB Answers for Partial Derivatives gl=-(l*(1/T1^2 - 1/T2^2))/(s*sin(b)) gs=(l^2*(1/T1^2 - 1/T2^2))/(2*s^2*sin(b)) gb=(l^2*cos(b)*(1/T1^2 - 1/T2^2))/(2*s*sin(b)^2) gT1=l^2/(T1^3*s*sin(b)) gT2=-l^2/(T2^3*s*sin(b)) MATLAB Codes for Partial Derivative Values gl0=subs(gl,[l s b T1 T2],[l0 s0 b0 T10 T20]) gs0=subs(gs,[l s b T1 T2],[l0 s0 b0 T10 T20]) gb0=subs(gb,[l s b T1 T2],[l0 s0 b0 T10 T20]) gT10=subs(gT1,[l s b T1 T2],[l0 s0 b0 T10 T20]) gT20=subs(gT2,[l s b T1 T2],[l0 s0 b0 T10 T20]) MATLAB Answers for Partial Derivative Values gl0=......

Words: 455 - Pages: 2

Matlab & Ss

...Lab 1: Introduction to MATLAB Warm-up MATLAB is a high-level programming language that has been used extensively to solve complex engineering problems. The language itself bears some similarities with ANSI C and FORTRAN. MATLAB works with three types of windows on your computer screen. These are the Command window, the Figure window and the Editor window. The Figure window only pops up whenever you plot something. The Editor window is used for writing and editing MATLAB programs (called M-files) and can be invoked in Windows from the pull-down menu after selecting File | New | M-file. In UNIX, the Editor window pops up when you type in the command window: edit filename (‘filename’ is the name of the file you want to create). The command window is the main window in which you communicate with the MATLAB interpreter. The MATLAB interpreter displays a command >> indicating that it is ready to accept commands from you. • View the MATLAB introduction by typing >> intro at the MATLAB prompt. This short introduction will demonstrate some basic MATLAB commands. • Explore MATLAB’s help capability by trying the following: >> help >> help plot >> help ops >> help arith • Type demo and explore some of the demos of MATLAB commands. • You can use the command window as a calculator, or you can use it to call other MATLAB programs (M-files). Say you want to evaluate the expression [pic], where a=1.2, b=2.3, c=4.5 and d=4....

Words: 2151 - Pages: 9

Matlab

...Lab 2: Linear Time-Invariant Systems In this experiment, you will study the output response of linear time-invariant (LTI) systems using MATLAB, and learn how to use MATLAB to implement the convolution sum. You will also investigate the properties of LTI systems. The objective of this experiment is: (1) to study how to compute the output of LTI systems, and (2) to study the properties of discrete-time LTI systems. 1. Introduction to Linear Time-Invariant (LTI) Systems In discrete time, linearity provides the ability to completely characterize a system in terms of its response [pic] to a signal of the form [pic] for all [pic]. If a linear system is also time-invariant, then the responses [pic] will become [pic]. The combination of linearity and time-invariance therefore allows a system to be completely described by its impulse response [pic]. The output of the system [pic] is related to the input [pic] through the convolution sum as follows: [pic] Similarly, the output [pic] of a continuous-time LTI system is related to the input [pic] and the impulse response [pic] through the following convolution integral: [pic] The convolution of discrete-time sequences [pic] and [pic] represented mathematically by the expression given in [pic] can be viewed pictorially as the operation of flipping the time axis of the sequence [pic] and shifting it by [pic] samples, then multiplying [pic] by[pic] and summing the resulting product......

Words: 1592 - Pages: 7

Me 2173 Matlab Project 1 Numerical Methods Using Matlab

...ME 2173 MATLAB Project 1 Numerical Methods Using MATLAB Click Link Below To Buy: http://hwcampus.com/shop/2173-matlab-project-1/ MATLAB Project 1 1.) Save Table 1 below in an excel file called 'Superheat' and complete the instructions that follow: Table 1: Properties of Superheated Steam at three different Pressures (1MPa =10116 N/m^2) T em p °C p1=0.20 MPa (120.2 C) p2=0.30 MPa (133.5 C) p3=0.40 MPa (143.6 C) volume v1(m^3/kg) energy u1(k)/kg) enthalpy h1(k)/kg) volume v2(m^3/kg) energy u2(k)/kg) enthalpy h2(k)/kg) volume v3(m^3/kg) energy u3(k)/kg) enthalpy h3(k)/kg) 150 0.960 2577.1 0.634 2571.0 0.471 2564.4 2752.8 200 1.081 2654.6 0.716 2651.0 0.534 2647.2 2860.8 250 1.199 2731.4 0.796 2728.9 0.595 2726.4 2964.4 300 1.316 2808.8 0.875 2807.0 0.655 2805.1 3067.1 350 1.433 2887.3 0.954 2885.9 0.714 2884.4 3170 400 1.549 2967.1 1.032 2966.0 0.773 2964.9 3274.1 450 1.666 3048.5 1.109 3047.5 0.831 3046.6 3379 500 1.781 3131.4 1.187 3130.6 0.889 3129.8 3485.4 600 2.013 3302.2 1.341 3301.6 1.006 3301.0 3703.4 700 2.244 3479.9 1.496 3479.5 1.122 3479.0 3927.8 800 2.476 3664.7 1.650 3664.3 1.237 3663.9 4158.7 900 2.707 3856.3 1.804 3856.0 1.353 3855.7 4396.9 1000 2.938 4054.8 1.958 4054.5 1.469 4054.3 4641.9 a. Use a MATLAB command to import the data from an excel file, as a (13x10) matrix 'SteamProps' b. Given that h=u+pv, use the column vectors of the 'SteamProps' matrix with operations to......

Words: 663 - Pages: 3

Me 2173 Matlab Project 5 Numerical Methods Using Matlab

...ME 2173 MATLAB Project 5 Numerical Methods Using MATLAB Click Link Below To Buy: http://hwcampus.com/shop/matlab-project-5/ The properties of Superheated Steam at pressure 200 kPa are shown in the table below: Table 1 Temp °C p=200 kPa (120.2 C) volume v(m^3/kg) energy u(k)/kg) enthalpy h(k)/kg) entropy s(k)/kg.K) 150 0.960 2577.1 2706.2 7.127 200 1.081 2654.6 2769.1 7.281 250 1.199 2731.4 2870.7 7.508 300 1.316 2808.8 2971.2 7.710 350 1.433 2887.3 3072.1 7.894 400 1.549 2967.1 3173.9 8.064 450 1.666 3048.5 3277.0 8.224 500 1.781 3131.4 3381.6 8.373 600 2.013 3302.2 3487.7 8.515 700 2.244 3479.9 3704.8 8.779 800 2.476 3664.7 3928.8 9.022 900 2.707 3856.3 4159.8 9.248 1000 2.938 4054.8 4397.6 9.460 The Ideal-gas specific heat at constant pressure cp in kJ/kmol • K of water vapor as a function of temperature (in Kelvin, °K) is given by: cp(T) = a + bT + cT2 + dT3 where a = 32.24, b = 0.1923 x 10-2, c = 1.055 x 10-5, d = —3.595 x 10-9. cp = c,, + R, and the gas constant, R= 0.4615 kJ/kg • K. For the computations below, convert the temperature to Kelvin: K=273+°C a. Use spline interpolation to increase the data points in table 1 for T, v, u, h, s, by creating a temperature vector in K Tnew = [150: 50:1000] + 273 and using it in the function 'interpl' to form the new vectors vnew, anew, hnew, Snew; e.g. vnew= interpl(T+273, v, Tnew,'spline'). b. Create a 1x2 subplot: subplot (1, 2, 1) has anew , hnew vs Tnew and the data plots......

Words: 458 - Pages: 2

Matlab

...Memulai Menggunakan Matlab Matlab merupakan bahasa canggih untuk komputansi teknik. Matlab merupakan integrasi dari komputansi, visualisasi dan pemograman dalam suatu lingkungan yang mudah digunakan, karena permasalahan dan pemecahannya dinyatakan dalam notasi matematika biasa. Kegunaan Matlab secara umum adalah untuk : • • • • • Matematika dan Komputansi Pengembangan dan Algoritma Pemodelan,simulasi dan pembuatan prototype Analisa Data,eksplorasi dan visualisasi Pembuatan apilikasi termasuk pembuatan graphical user interface Matlab adalah sistem interaktif dengan elemen dasar array yang merupakan basis datanya. Array tersebut tidak perlu dinyatakan khusus seperti di bahasa pemograman yang ada sekarang. Hal ini memungkinkan anda untuk memecahkan banyak masalah perhitungan teknik, khususnya yang melibatkan matriks dan vektor dengan waktu yang lebih singkat dari waktu yang dibutuhkan untuk menulis program dalam bahasa C atau Fortran. Untuk memahami matlab, terlebih dahulu anda harus sudah paham mengenai matematika terutama operasi vektor dan matriks, karena operasi matriks merupakan inti utama dari matlab. Pada intinya matlab merupakan sekumpulan fungsi-fungsi yang dapat dipanggil dan dieksekusi. Fungsi-fungsi tersebut dibagi-bagi berdasarkan kegunaannya Kuliah Berseri IlmuKomputer.Com Copyright © 2004 IlmuKomputer.Com yang dikelompokan didalam toolbox yang ada pada matlab. Untuk mengetahui lebih jauh mengenai toolbox yang ada di matlab dan......

Words: 2781 - Pages: 12

Matlab

...An Introduction to Matlab for Econometrics John C. Frain TEP Working Paper No. 0110 February 2010 Trinity Economics Papers Department of Economics Trinity College Dublin An Introduction to MATLAB for Econometrics John C. Frain. February 2010 ∗ Abstract This paper is an introduction to MATLAB for econometrics. It describes the MATLAB Desktop, contains a sample MATLAB session showing elementary MATLAB operations, gives details of data input/output, decision and loop structures, elementary plots, describes the LeSage econometrics toolbox and maximum likelihood using the LeSage toolbox. Various worked examples of the use of MATLAB in econometrics are also given. After reading this document the reader should be able to make better use of the MATLAB on-line help and manuals. Contents 1 Introduction 1.1 1.2 Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The MATLAB Desktop . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2.1 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 ∗ Comments 4 4 6 6 7 8 8 9 9 9 The Command Window . . . . . . . . . . . . . . . . . . . . . . . . The Command History Window . . . . . . . . . . . . . . . . . . . The Start Button . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Edit Debug window . . . . . . . . . . . . . . . . . . . . . . . . The Figure Windows . . . . . . . . . . . . . . . . . . . . . . . . . . The Workspace Browser . . . . . . . . . . . . . . . . . . . . . . . .......

Words: 15376 - Pages: 62