9/30/2006

Problem#01黃聖峰

加選後補交的作業
%---------------程式碼--------------------------%
close all;
clc;
%---------------第一題--------------------------%
F=200; % pull force %
V=20/60; % m/min 變 m/sec %
J=0.101972; % 1J=0.101972 %

question_1_Power=F*V/J % 功率KW %
%-----------------------------------------------%

%---------------第二題---------------------------%
R1=1; % 電阻1 %
R2=20; % 電阻2 %
R3=200; % 電阻3 %
V=110; % 電壓(V) %

question_2_I=V/(R1+R2+R3) % 電流(A) %

question_2_Power=V*I % 功率(W) %
%-------------------------------------------------%

%--------------第三題------------------------------&
A=650; % 第一個邊長 %
B=428; % 第二個邊長 %
C=282; % 第三個邊長 %
s=(A+B+C)/2;

question_3_area=(s*(s-A)*(s-B)*(s-C))^(1/2) % 用Heron公式求三角形面積 %
%---------------------------------------------------%

%--------------第四題-------------------------------%
Lheat=25000; % heat from light and equipment %
Wheat=52000; % heat through wall and cell %
Fheat=84300; % heat through aerations %

question_4_N=(Wheat+Fheat-Lheat)/600 % how many hogs this house can raise %
%----------------------------------------------------%

%---------------第五題--------------------------------%
L=4; % 堰口寬度L為4呎 %
H=0.9; % 堰口溢流水頭高度H為0.9呎 %
question_5_Q=3.33*(L-0.2*H)^(3/2) % 堰口每秒流量 %
%----------------------------------------------------%


執行結果
question_1_Power =
653.7742 % 功率為653.7742 kw %

question_2_I =
0.4977 % 電流為0.4977A %

question_2_Power =
54.7511 % 功率為54.7511 w %

question_3_area =
4.5233e+004 % 面積為4.5233e+004平方公分 %

question_4_N =
185.5000 % 185頭豬最適合 %

question_5_Q =
24.8622 %堰口每秒流量為24.8622立方呎/秒
>>

Problem #01 林書如

今天才加簽成功所以補交上禮拜作業

>> ===========================================================================
>> % Question 1
>> % To find out the power of the tractor
>> f=200; % 曳引機(tractor)拉力f為200公斤
>> d=20; % 向前拉動20m
>> J=0.101972; % 單位換算1 J=0.101972kgm
>> t=60; % 需時60秒
>> p=f*d/J/t % 功率p=f*d/J/t

p =

653.7742

>> % 執行結果:所需之功率為653.7742瓦特

>> ===========================================================================
>> % Question 2
>> % Find the line current and power consumption
>> r=1+20+200; % 三電阻器串聯後之總電阻r
>> i=110/r; % 110伏特之電源除以總電阻得流經之電流i
>> p=i*110; % 電流與電壓之乘積得消耗功率
>> i

i =

0.4977

>> p

p =

54.7511
>> % 執行結果: 流經之電流為0.4977安培及所耗之功率為54.7511瓦特
>> % 討論: 第一、二題透過已有之物理基礎,了解消耗功率計算之方式,再加以MATLAB語法逐步計算求得解答,並非難事。

>> ===========================================================================
>> % Question 3
>> % To calculate the area of a trangle
>> a=650;
>> b=428;
>> c=282; % 三角形三邊長分別為650、428、282公分
>> r=(a+b+c)/2;
>> area=(r*(r-a)*(r-b)*(r-c))^(1/2) % 以海龍公式計算三角形面積

area =

4.5233e+004

>> % 執行結果: 三角形面積為(4.5233e+004)平方公分

>> ===========================================================================
>> % Quesiotn 4
>> % How many hogs this house can raise?
>> a=52000+84300; % 每小時總散熱量為a
>> h=(a-25000)/600; % 每小時總散熱量a減去照明及設備操作所產生的熱量為所有豬隻能產生的最大熱量
>> % 所有豬隻能產生的最大熱量除以每隻豬每小時產熱後得一數值h
>> floor(h) % 取出小於或等於數值h的最大數目即為合適的豬隻量,以floor(x)指令執行

ans =

185
>> % 執行結果: 豬舍中養185隻豬最合適

>> ===========================================================================
>> % Question 5
>> % Find the flow rate Q
>> L=4; % 堰口寬度L為4呎
>> H=0.9; % 堰口溢流水頭高度H為0.9呎
>> Q=3.33*(L-0.2*H)^(3/2) % 流量為Q

Q =

24.8622
>> % 討論:
>> 一剛開始看到已有公式,不加多想變複製至MATLAB視窗中執行,出現error訊息後才驚覺須以MATLAB語法重新闡述方可順利計算求解,程式語法之撰寫實在需要多加謹慎小心
>> :p

9/29/2006

可以旁聽嗎

老師您好:

我是物理治療所的學生,顏章伊
考量到這學期的學分數已經14學分
怕期中期末的報告量無法負荷
所以這堂課想轉為旁聽
想先詢問老師意見

謝謝

PROBLEM #2 黃世榮

%problem#2
程式流程:

%question 1
clear
format short
B=[98 100 102 104 98.4 98.2 98.5 101 102 99.5]
C=(B-32)*5/9 % that's a)'s answer
[u,v]=find(C>38);
D=zeros(1,10);
D(u,v)=1

%question 2
clear
A= [10 8 6 4 -5 20]
B=[2 8 5 10 -6 3]
D1=[A>B]
D2=(A>5)
D3=A+B

%question 3
clear
x=[10 20 30]
y=[1 4 6]
A=3*x+y
B=5*y/x
C=4*x.*y*2
D=sin(x).*cos(y)
E=5*x.*sin(2*y)

%question 4
R=[ 10 30 200 400]
Req1=sum(R)
%series
Req2=prod(R)/sum(R)
%parallel


%question 5
A=[1:1:24]
B=reshape(A,3,8)
C=reshape(A,6,4)
D=reshape(A,2,12)

執行結果:

Q1:

B =

Columns 1 through 8

98.0000 100.0000 102.0000 104.0000 98.4000 98.2000 98.5000 101.0000

Columns 9 through 10

102.0000 99.5000


C =

Columns 1 through 8

36.6667 37.7778 38.8889 40.0000 36.8889 36.7778 36.9444 38.3333

Columns 9 through 10

38.8889 37.5000

D =

0 0 1 1 0 0 0 1 1 0

Q2:

A =

10 8 6 4 -5 20


B =

2 8 5 10 -6 3


D1 =

1 0 1 0 1 1


D2 =

1 1 1 0 0 1


D3 =

12 16 11 14 -11 23

Q3:

x =

10 20 30


y =

1 4 6


A =

31 64 96


B =

0.9643


C =

80 640 1440


D =

-0.2939 -0.5967 -0.9487


E =

45.4649 98.9358 -80.4859

Q4:

R =

10 30 200 400


Req1 =

640


Req2 =

37500

Q5:

A =

Columns 1 through 13

1 2 3 4 5 6 7 8 9 10 11 12 13

Columns 14 through 24

14 15 16 17 18 19 20 21 22 23 24


B =

1 4 7 10 13 16 19 22
2 5 8 11 14 17 20 23
3 6 9 12 15 18 21 24


C =

1 7 13 19
2 8 14 20
3 9 15 21
4 10 16 22
5 11 17 23
6 12 18 24


D =

1 3 5 7 9 11 13 15 17 19 21 23
2 4 6 8 10 12 14 16 18 20 22 24

討論:實際上在比較龐大的矩陣,用到很多元素指令,也許可用指令配合迴圈比較清楚

r94428008 吳堉光

老師您好:
  因為我申請了gmail,所以系統自動將我部落格
的帳號由原本的信箱r94428008@ntu.edu.tw
改成happyeric1120@gmail.com
麻煩老師幫我改一下
謝謝

黃世榮r95631009

老師好 我是黃世榮 我想換此帳號 diowking@gmail.com
這是BETA的帳號

林書如r94428004

Dear 馮老師:

我是今天matlab課程加簽的學生,我已經申請了blog,想邀請老師幫我加入帳號。 謝謝老師。

姓名: 林書如
帳號: ShuRuLin
信箱:r94428004@ntu.edu.tw

祝 心怡

書如

9/28/2006

PROBLEM #1 詹弘彥

Fon老師 ∼

我的作業一是以email的方式傳給老師的,但為了求完整性,所以還是將之前寫的作業一給放上來。

P.S.~這次作業一『我沒有遲交喔』

謝謝老師啦!! ^_^

  1. The unit of POWER can be expressed as W, kW, hp, etc. Their equivalent expressions are J/s, kJ/s, in which J is joule to represent work and 1 J=0.101972kgm (You may find unit conversion table at http://www.digitaldutch.com/unitconverter/). Now, by using such relations find out the following condition when a farm tractor pulls a farm equipment working on the field at 20m/min. Suppose the draft force is meaured as 200kgf. Find out the power of the tractor.
    MATLAB CODE

>> F=200;%拉力(kg

>> S=20;%移動距離(m

>> T=60;%時間(sec

>> A=9.81;%1kgm/s=9.81w

>> W=F*(S/T)*A; %W(w)

>> W=654

W =654(w)

  1. A circuit with three resistors rated 1, 20,200 ohms in series is connected to a voltage source of 110V. Find the line current and power consumption.
    >> a=1;b=20;c=200;%
    電阻器

>> v=110;%電壓

>> r=a+b+c;%電阻串連

>> i=v/r;%i=電流(A)

>> p=i*v;%p=功率

>> i

i =0.4977

>> p

p =54.7511

  1. Calculate the area of a trangle with three sides in 650cm, 428cm, 282cm, repectively.
    >> a=650;b=428;c=282;%
    三角形三邊邊長(cm)

>> s=(a+b+c)/2;

>> area=(s*(s-a)*(s-b)*(s-c))^0.5;%海龍公式

>> area

area =4.5233e+004

  1. A hog house was designed the way that heat dissipations from lighting & equipment 25,000BTU/hr, heat flux through wall & cellings 52,000BTU/hr , heat flux through aerations 84,300BTU/hr. Suppose each hog will dissipate 600BTU/hr, how many hogs this house can raise?

>> wall=52000;fan=84300;%散出的熱量

>> input=25000;%照明與設備產生的熱量

>> pig=600;%豬產生的熱量

>> allpig=(wall+fan-input)/pig;%最多的豬量

>> allpig

allpig =185.5000

所以最多只能養185

  1. The flow rate of a rectangular water gate can be calculated from the following formula: Q=3.33x[L-0.2H]^(3/2), in which L: width of gate in ft, H:water head in ft and Q: the flow rate in cu. ft./s. Find the flow rate Q if L=4 ft and the wate head is 0.9 ft.

>> L=4;%堰開口寬度(呎)

>> H=0.9;%堰口溢流水頭高度(呎)

>> Q=3.33*(L-0.2*H)^(3/2);%Q流量(立方呎╱秒)

>> Q

Q =24.8622

PROBLEM #2

  1. During SARS period, people who passed the airport gate should have their temperatures measured. Suppose that B is the recorded body temperatures in Fahrenheit and B=[98 100 102 104 98.4 98.2 98.5 101 102 99.5]. Please workout a program to do: a) Converse the unit of B into Centigrade b)Decide who got the temperature? Design a matrix D to show that "1" for the one who has a fever (>38C) and "0" for the normal.
  2. There are two matrices A and B, in which A=[ -10 8 6 4 -5 20] and B=[2 8 5 10 -6 3]. Find D using both Matlab commands .(a) D= (A>B) (b) D= (A>5) (f) D=A+B.
  3. Suppose that x=[10 20 30] and y=[1 4 6], Calculate the following combinations using Matlab commands:(a) A= 3x +y (b) B=5y/x (c) C=4x2y (d) D=sin(x)cos(y) (e)5x sin(2y)
  4. A set of resistors are expressed in an array as R=[ 10 30 200 400]ohms. Write a M-file program to calculate the equivalent resistance if (a) all the resistors are in series (b) all of the resistors are in parallel.
  5. Suppose matrix A=1:24, please reform A into matrices B in size 3x8; C in size 6x4; D in size 2x12.

Due Date: October 6, 2006

PROBLEM #1 盧光亮

% Matlab之工程應用 PROBLEM #1
% date : 9/28/2006
% student : 盧光亮 R93622022
%---------- question 1-----------%
f=200; % f 拉力=200 (Kg)
d=20; % d 距離=20 (m)
power=f*d/0.101972/60/1000 % 單位(kW)

power =

0.6538

>> clear
>> %---------- question 2-----------%
R1=1; % resistors 1 = 1 (ohms)
R2=20; % resistors 2 = 20 (ohms)
R3=200; % resistors 3 = 200(ohms)
V=110; % voltage = 110 (V)
>> I=V/(R1+R2+R3)

I =

0.4977

>> W=110*I % 功率(W)

W =

54.7511



>> clear
>> %---------- question 3-----------%
a=6.50; %三角形第一邊 a=6.50(m)
b=4.28; %三角形第二邊 b=4.28(m)
c=2.82; %三角形第三邊 c=2.82(m)
>> s=(a+b+c)/2;
A=(s*(s-a)*(s-b)*(s-c))^(1/2) %A : 三角形面積 (m^2)

A =

4.5233

Problem #1 謝宏育

>> clear all
>> % Question 1
>> % when a farm tractor pulls a farm equipment working on the field at 20m/min.
>> % Suppose the draft force is meaured as 200kgf.
>> % Find out the power of the tractor.
>> power=200*20/0.101972/60

power =

653.7742

>> % 功率為653.7742 (w)
>> %-----------------------------------------------------------------------------
>> clear all
>> % Question 2
>> % A circuit with three resistors rated 1, 20,200 ohms in series is connected to a
>> % voltage source of 110V. Find the line current and power consumption.
>> v=110;r1=1;r2=20;r3=200;
>> i=v/(r1+r2+r3)

i =

0.4977

>> % i=0.4977 (A)
>> power=i*v

power =

54.7511

>> % 電流為0.4977,功率為54.7511 (w)
>> %-----------------------------------------------------------------------------
>> clear all
>> % Question 3
>> % Calculate the area of a trangle with three sides in 650cm, 428cm, 282cm, repectively.
>> a=650;b=428;c=282;
>> r=(a+b+c)/2;
>> area=(r*(r-a)*(r-b)*(r-c))^(1/2)

area =

4.5233e+004

>> % 三角形面積為4.5233e+004 (cm^2)
>> %-----------------------------------------------------------------------------
>> clear all
>> % Question 4
>> % A hog house was designed the way that heat dissipations from lighting &
>> % equipment 25,000BTU/hr,heat flux through wall & cellings 52,000BTU/hr,heat
>> % flux through aerations84,300BTU/hr.Suppose each hog will dissipate
>> % 600BTU/hr,how many hogs this house can raise?
>> h1=25000;% heat dissipations from lighting & equipment
>> h2=52000;% heat flux through wall & cellings
>> h3=84300;% heat flux through aerations
>> h4=600;% heat will dissipate from each hog
>> n=(h2+h3-h1)/h4 % the number of hogs

n =

185.5000

>> % 豬隻數量上限為185隻
>> %-----------------------------------------------------------------------------
>> clear all
>> % Question 5
>> % The flow rate of a rectangular water gate can be calculated from the following
>> % formula: Q=3.33x[L-0.2H]^(3/2), in which L: width of gate in ft,
>> % H:water head in ft and Q: the flow rate in cu. ft./s.
>> % Find the flow rate Q if L=4 ft and the water head is 0.9 ft.
>> l=4;h=0.9;
>> Q=3.33*[l-0.2*h]^(3/2)

Q =

24.8622

>> %流量為24.8622 ft^3/sec

MATLAB產品型錄簡表

MATLAB產品型錄簡表

MATLAB產品家族
○ MATLAB® (交談式科技計算語言)
○ Distributed Computing Toolbox (分散式運算工具箱)
MATLAB Distributed Computing Engine (分散式運算計算引擎)

<數學及最佳化>
○ Optimization Toolbox (最佳化工具箱)
○ (Extended) Symbolic Math Toolbox (延伸)符號運算工具箱)
○ Partial Differential Equation Toolbox (偏微分工具箱)
○ Genetic Algorithm and Direct Search Toolbox

(基因演算法及直接搜尋法工具箱)
<統計及資料分析>
○ Statistics Toolbox (統計工具箱)
○ Neural Network Toolbox (類神經網路工具箱)
○ Curve Fitting Toolbox (曲線契合工具箱)
○ Spline Toolbox (雲線函數工具箱)
○ Model-Based Calibration Toolbox (Model-based調校工具箱)

<生物運算>
○ Bioinformatics Toolbox (生物資訊工具箱)
○ SimBiology (生物模擬工具箱)---還沒有datasheet

<控制系統設計及分析>

○ Control System Toolbox (控制系統工具箱)
○ System Identification Toolbox (系統辨識工具箱)
○ Fuzzy Logic Toolbox (模糊邏輯工具箱)
○ Robust Control Toolbox (強韌控制工具箱)
○ Model Predictive Control Toolbox (模型預測控制工具箱)

<信號處理及通訊>
○ Signal Processing Toolbox (信號處理工具箱)
○ Communications Toolbox (通訊工具箱)
○ Filter Design Toolbox (濾波器設計工具箱)
○ Filter Design HDL Coder (濾波器設計HDL轉碼工具)
○ Wavelet Toolbox (小波工具箱)
○ Fixed-Point Toolbox (定點工具箱)
○ RF Toolbox (射頻工具箱)

<影像處理>
○ Image Processing Toolbox (影像處理工具箱)
○ Image Acquisition Toolbox (影像擷取工具箱)
○ Mapping Toolbox (地圖工具箱)
<測試及量測>
○ Data Acquisition Toolbox (資料擷取工具箱)
○ Instrument Control Toolbox (儀器設備控制工具箱)
○ OPC Toolbox (OPC工具箱)

<財務模型及分析>
○ Financial Toolbox (財經工具箱)
○ Financial Derivatives Toolbox (衍生性金融商品工具箱)
○ GARCH Toolbox (異質條件變異數自我迴歸工具箱)
○ Datafeed Toolbox (財務資料來源工具箱)
○ Fixed-Income Toolbox (固定收益商品工具箱)

<應用程式轉檔分享>
○ MATLAB Compiler (編譯器)
○ Excel Link (Excel連結工具箱)
○ MATLAB Web Server (網頁結合工具箱)

<應用程式轉檔分享目標環境>
○ MATLAB Builder for Excel (Excel增益集工具箱)
○ MATLAB Builder for .NET (.NET增益集工具箱)-

<資料庫連結與產生報告>
○ Database Toolbox (資料庫連結工具箱)
○ MATLAB Report Generator (MATLAB報告產生器)

Simulink產品家族
○ Simulink® (動態系統模擬軟體)
○ Simulink Accelerator (Simulink加速器)
○ Simulink Report Generator (Simulink報告產生器)

<定點模擬>
○ Simulink Fixed Point (Simulink定點模塊組)

<事件基礎模擬>
○ Stateflow® (事件導向系統模擬軟體)
○ SimEvent (事件模擬模塊組)

<物理模型模擬>
○ SimMechanics (機構模擬模塊組)
○ SimPowerSystems (電力系統模擬模塊組)
○ SimDriveline (傳動模擬模塊組)

<圖形化模擬>
○ Virtual Reality Toolbox (虛擬實境工具箱)
○ Gauges Blockset (儀表模塊組)

<控制系統設計及分析模塊組>
○ Simulink Control Design (Simulink控制模塊組)
○ Simulink Response Optimization (Simulink響應最佳化模塊組)
○ Simulink Parameter Estimation (Simulink參數估計模塊組)
○ Aerospace Blockset (航太模塊組)

<信號處理及通訊模塊組>
○ Signal Processing Blockset (信號處理模塊組)
○ Communications Blockset (通訊模塊組)
○ CDMA Reference Blockset (CDMA模塊組)
○ RF Blockset (射頻模塊組)
○ Video & Image Processing Blockset (動態影片及影像處理模塊組)

<程式碼產生工具>
○ Real-Time Workshop® (C程式碼產生器)
○ Real-Time Workshop Embedded Coder (內嵌C程式碼產生器)
○ Stateflow Coder (Stateflow C程式產生器)


○ xPC Target (PC環境即時控制模塊組)
○ xPC Target Embedded Option (xPC內嵌程式工具)
○ xPC TargetBox® (即時控制工業級PC硬體盒)
○ Real-Time Windows Target (Windows環境即時控制工具)


○ Embedded Target for TI C6000™ DSP
(TI C6000系列DSP嵌入式系統轉碼工具)
○ Embedded Target for Motorola® MPC555
(Motorola MPC555嵌入式系統轉碼工具)
○ Embedded Target for OSEK/VDX®
(OSEK/VDX嵌入式系統轉碼工具)
○ Embedded Target for Infineon C166® Microcontrollers
(Infineon C166微控制器嵌入式系統轉碼工具)
○ Embedded Target for Motorola® HC12
(Motorola HC12嵌入式系統轉碼工具)
○ Embedded Target for TI C2000™ DSP
(TI C2000系列DSP嵌入式系統轉碼工具)

<測試及驗證>
○ Link for Code Composer Studio™(CCS連結工具)
○ Link for ModelSim® (ModelSim連結工具)

2006/02Simulink Verification and Validation
(Simulink驗證及有效性檢測模塊組)

Matlab消息:學校版權使用

計算機及資訊網路中心校內訊息轉送服務
委託單位: 計算機及資訊網路中心
作業管理組委託人: 陳永樵
聯絡電話: 33665015
說明:

一、因應學校許多教師需求,計中已採購數學運算軟體matlab,供全校師生使用。

二、計中採購項目為MATLAB、SIMULINK及Symbolic_Toolbox共三種模組。

三、計中安裝於二十四小時開放之電腦教室(103室)及一般開放教室(117室),並有教學教室312(52人座)可供老師上課使用。

四、MATLAB系列模組眾多,各學系有不同需求,因為單獨購買單價甚高,計中將統計所有老師需求,統一代為購買,以降低各位老師負擔。

五、以下為各項軟體價格:

  • ◎MATLAB、SIMULINK及Symbolic_Toolbox三種軟體NT$6200.-(因為計中已購買基本套數,所以可以用優惠價格採購)
  • ◎其他模組:單人版 NT$15000-38000.- ,10人版NT$6000-15000.- ,25人版NT$3000-9500.- 詳細資料請詳見 http://oper.cc.ntu.edu.tw/

六、各位老師如有加購需求即日起至十月五日止,請直接email至 matlab@club.ntu.edu.tw ,並註明單位、姓名、聯絡電話、需求模組名稱及數量,計中將會統計所有老師需求數量,統一訂購。

計算機及資訊網路中心 作業管理組 上2006/9/27

PROBLEM #1: 唐翊凱

 %PROBLEM#1
>> %editor R94631038 唐翊凱
>> date ans = 28-Sep-2006
>> %Question 1
>> f=200;l=20;j=0.101972;sec=60;%f為拉力,l為拉的距離,j=0.101972kgm,sec為60秒
>> f*l/j/sec ans = 653.7742
>> %ans:需要653.7742KW
-------------------------------------------------------------------------------
%Question 2
>>
>> r=1+20+200;%r為串聯的總組抗
>> v=110;%v為電路兩端的電壓值
>> i=v/r;%i為電路的電流值
>> i i = 0.4977
>> w=v*i w = 54.7511
>> %w為此電路的功率54.7511瓦
---------------------------------------------------------------------------------- >> %Question 3
>> a=650;b=428;c=282;%a,b,c分別為三角形三邊的長度,單位為CM
>> s=(a+b+c)/2;
>> A=(s*(s-a)*(s-b)*(s-c))^(1/2)%A為此三角形的面積 A = 4.5233e+004
---------------------------------------------------------------------------------- >> %Question 4 light=25000;naout=52000;fanout=84300;pig=600;
>> %light為照明設備發出的熱流量,naout為自然流出的熱流量
>> %fanout為風扇扇出去的熱流量,pig為每一隻豬發出的熱流量
>> (52000+84300-25000)/600 ans = 185.5000
>> %所以此豬場以飼養185頭豬的情況下散熱最為理想
----------------------------------------------------------------------------------
>> %Question 5 %一個矩形堰之流量率計算公式如右:Q=3.33x[L-0.2H]^(3/2)
>> %今天已知堰口寬度為4呎(L=4),堰口溢流水頭高度為0.9呎(H=0.9)
>> L=4;H=0.9;
>> Q=3.33*[L-0.2*H]^(3/2) Q = 24.8622
>> %所以其流量為每秒24.8622立方呎


--- 本郵件來自HiNet WebMail ---

Problem #01:林士淳

題旨:利用matlab作數學運算


第一題: To get started, select MATLAB Help or Demos from the Help menu.

>> f=200%力
f = 200

>> s=20%移動距離s
= 20

>> T=60%時間
T = 60

>> J=0.101972
J = 0.1020

>> W=f*(s/T)/J%功率W = 653.7742

>>ans:
653.7742KW

第二題:

>> r1=1%電阻1r1 = 1

>> r2=20%電阻2
r2 = 20

>> r3=200%電阻3
r3 = 200

>> r=r1+r2+r3%總電阻
r = 221

>> v=110%電壓
v = 110

>> w=v*v/r%功率
w = 54.7511

>> i=v/r%電流
i = 0.4977

ans:54.7511W 0.4977A

第三題

>> a=650
a = 650

>> b=428
b = 428

>> c=282
c = 282

>> s=(a+b+c)/2
s = 680

>> A=(s*(s-a)*(s-b)*(s-c))^(1/2)%海龍公式
A = 4.5233e+004
>>ans:4.5233e+004 平方公分

第四題

>> a=25000%照明及設備操作所產生的熱量為25,000BTU
a = 25000

>> b=52000%經過牆壁及屋頂之流出之熱流量每小時為52,000BTU
b = 52000

>> c=84300%利用風扇散熱的熱流量每小時為84,300BTU
c = 84300

>> b+c-a%散熱能力

ans = 111300

>> d=600%每隻豬產生之熱量
d = 600

>> (b+c-a)/d
ans = 185.5000

>>ans:185頭最適合

第五題
>> L=4%堰開口寬度
L = 4

>> H=0.9%堰口溢流水頭高度
H = 0.9000

>> Q=3.33*(L-0.2*H)^(3/2)%矩形堰流量率
Q = 24.8622

>>ans=24.8622立方呎/秒

Problem #01:吳子青

>> % Matlab之工程應用 PROBLEM #1
>> % data : 9/21/2006
>> % student : 吳子青 R95622024
>>
>> % -------------------------------------------
>> % ** Question 1 **
>> clear
>> f=200; % f 拉力=200 (Kg)
>> d=20; % d 距離=20 (m)
>>
>> Power=f*d/60/0.101972 % Power 功率(kW)

Power =

653.7742

>> % A1: Power = 653.7742 (kW)

>> % --------------------------------------------
>> % ** Question 2 **
>> clear
>> res1=1; % resistors 1 = 1 (ohms)
>> res2=20; % resistors 2 = 20 (ohms)
>> res3=200; % resistors 3 = 200(ohms)
>> V=110; % voltage = 110 (V)
>>
>> I=V/(res1+res2+res3) % I : current (A)

I =

0.4977

>> w=I*V % w : power (w)

w =

54.7511

>> % A2: I= 0.4977(A) , power= 54.7511(w)

>> % --------------------------------------------
>> % ** Question 3 **
>> clear
>> a=650; %三角形第一邊 a=650(cm)
>> b=428; %三角形第二邊 b=428(cm)
>> c=282; %三角形第三邊 c=282(cm)
>>
>> s=(a+b+c)/2;
>> A=(s*(s-a)*(s-b)*(s-c))^(1/2) %A : 三角形面積 (cm^2)

A =

4.5233e+004

>> % A3: 三角形面積= 4.5233*10^4 (cm^2)

>> % --------------------------------------------
>> % ** Question 4 **
>> clear
>> heat_equ=25000; % heat dissipations from lighting & equipment
>> 25,000BTU/hr
>> hflux_wall=52000; % heat flux through wall & cellings 52,000BTU/hr
>> hflux_aera=84300; % heat flux through aerations 84,300BTU/hr
>>
>> n=(hflux_wall+hflux_aera-heat_equ)/600 % n=hog number

n =

185.5000

>> % A4: 在豬舍不致於過熱及最高飼養效率考量下 n=185 隻應該是最適合的情況

>> % --------------------------------------------
>> % ** Question 5 **
>> clear
>> L=4; % L: width of gate(ft)
>> H=0.9; % H: water head(ft)
>>
>> Q=3.33*(L-0.2*H)^(3/2) % Q: flow rate(cu. ft./s.)

Q =

24.8622

>> % A5: flow rate= 24.8622 (cu. ft./s.)
>>

Problem #01 R95631037

題旨:將Matlab用於算數的基本操作和程式應用

Question 1 :

f = 200

d = 20

t = 60

j = 0.101972

P = f*d/j/t

P = 200 * 20 / 0.101972 /60

= 653.7742

Ans :653.7742 KW


Question 2 :

R1=1
R2=10
R3=100
R=R1+R2+R3
= 111
v = 110
I = V / R = 0.4977
P = I * V
= 54.7511
Ans : 電流為0.4977 A , 功率為 54.7511 W
Question 3 :

A = 650

B = 428

C = 282

R = (A+B+C) / 2

= 680
S = R * (R - A) * (R - B) * (R - C)

= 4.5233e+004

Ans : 面積為 4.5233e+004 平方公分

Question 4 :

A =(52000+84300-25000)/600

= 185.5000

Ans : 185之豬最適合

Question 5 :

L = 4

H = 0.9

Q = 3.33 *[L-0.2*H]^(3/2)

= 24.8622

Ans : 每秒為24.8622 立方呎/秒

___________________________________________________
您的生活即時通 - 溝通、娛樂、生活、工作一次搞定!
http://messenger.yahoo.com.tw/

9/27/2006

Problem #01: 林翊展

題旨:matlab用於算數的基本操作

QUESTION 1:

>> 200*(20/60)/0.101972 %拉力(kg)*速度(m/s),換算成KW

ans =

653.7742

THE POWER IS 653.7742KW

QUESTION 2:

>> I=110/(1+20+200), %電流=電壓/電阻

I =

0.4977

>> P=110*I, %功率=電壓*電流

P =

54.7511

THE CURRENT IS 0.4977A , THE POWER IS 54.7511W

QUESTION 3:

>> m=650;n=428;o=282;s=(m+n+o)/2;
>> A=(s*(s-m)*(s-n)*(s-o))^(1/2) %海龍公式

A =

4.5233e+004

the area of triangle is 4.5233e+004 平方公分

QUESTION 4:

>> hog=(52000+84300-25000)/600

hog =

185.5000

it can raise 185 hogs.

QUESTION 5:

>> L=4;H=0.9;Q=3.33*[L-0.2*H]^(3/2)

Q =

24.8622

the flow rate is 24.8622 立方呎/秒

討論:
很容易忘記加乘號(*),matlab會以紅字提示格式錯誤的輸入要求,並標出錯誤點.

9/26/2006

Problem #1:吳堉光

題旨:操作使用MATLAB

程式流程和程式內容

% Problem #1

clear all

% Question 1

f=200; d=20; t=60; % f = force, d =distance, t = time

j=0.101972;

p=f*d/j/t;

fprintf('%s%s%f\n','Question#1: ','Power is ',p);

% Question 2

clear all

R1=1;R2=10;R3=100; % three resistors

R=R1+R2+R3;

V=110; % V is volt

i=V/R; % i is current

w=i*V; % w is power consumption

fprintf('%s%s%f%s%f\n','Question#2: ','Current is ',i,'; Power consuption is ',w)

% Question 3

clear all

a=650; b=428; c=282;

s=(a+b+c)/2;

a=sqrt(s*(s-a)*(s-b)*(s-c)); % Heron formatiom

fprintf('%s%s%f\n','Question#3: ','The area of trangle is ',a)

% Question 4

clear all

x=(52000+84300-25000)/600; % x is the number of hogs

fprintf('%s%s%f\n','Question#4: ','The number of hogs is ',x)

% Question 5

clear all

L=4; H=0.9;

Q=3.33*(L-0.2*H)^(3/2);

fprintf('%s%s%f\n','Question#5: ','The flow rate is ',Q)

執行結果及討論

Question#1: Power is 653.774239

Question#2: Current is 0.990991; Power consuption is 109.009009

Question#3: The area of trangle is 45233.155981

Question#4: The number of hogs is 185.500000

Question#5: The flow rate is 24.862184    

Problem #1 林冠宏

第1題 ,答:653.7742

>> 200*20/0.101972/60

ans =

653.7742

第2題,答:電流0.4977A,功率54.7511瓦

>> i=110/(1+20+200)

i =

0.4977

>> w=i*110

w =

54.7511

第3題,面積: 4.5233e+004平方公分

>> x=(650^2-428^2+282^2)/(2*282)

x =

565.3191
>> h=(650^2-x^2)^(1/2)

h =

320.8025

>> a=1/2*282*h

a =

4.5233e+004

第5題,答:24.8622立方呎╱秒

>> l=4,h=0.9

l =

4


h =

0.9000

>> q=3.33*(l-0.2*h)^(3/2)

q =

24.8622

第4題,答:185頭豬

>> t=52000+84300;i=25000;
>> n=(t-i)/600

n =

185.5000

_______________________________________
YM - 離線訊息
就算你沒有上網,你的朋友仍可以留下訊息給你,當你上網時就能立即看到,任何說話都冇走失。
http://messenger.yahoo.com.hk

9/25/2006

PROBLEM #1:黃世榮

題旨:操作MATLAB基本指令 程式流程和程式內容: %%%% Problem #1 %%%%

format long
clear
% question 1 f=200 ;%force's unit is kg
t=60 ;%time's unit is s
l=20 ;%distance's unit is m
Power=f*9.8*l/(t*1000) %power's unit is kw

% question 2
R=1+20+200 ;%resistor's unit is ohm
V=110 ; %voltage's unit is V
I=V/R %the current's unit is Amp
P=V^2/R %the power

% question 3
A=650; B=428 ;C=282; %triangle's three sides
S=0.5*(A+B+C);
Area=(S*(S-A)*(S-B)*(S-C))^0.5 % question 4
numbers=(52000+84300-25000)/600 % (total heat dissipate per hour)/(heat
form Hog per hour)

% question 5
L=4;H=0.9;
Q=3.33*[L-0.2*H]^(3/2)


執行結果與討論
Power =

0.65333333333333


I =

0.49773755656109


P =

54.75113122171945


Area =

4.523315598098368e+004


numbers =

1.855000000000000e+002


Q =

24.86218409261745

結論:使用FORAMT LONG 可以讓精度變高