• No results found

YZ250F Matlab Documentation

N/A
N/A
Protected

Academic year: 2021

Share "YZ250F Matlab Documentation"

Copied!
12
0
0

Loading.... (view fulltext now)

Full text

(1)

Matlab Code

Matlab Code

NOTE:

NOTE: This model

This model treats TDC

treats TDC as 180[degrees] and

as 180[degrees] and BDC as

BDC as 0[degrees].

0[degrees]. Highlig

Highlighted

hted n!"ts are

n!"ts are

those that #ill need to be

those that #ill need to be $hanged.

$hanged.

1.%

1.%

%Engine Inputs

%Engine Inputs

RPM = 10000;

RPM = 10000; %Revolutions Per Minute [1/min]%Revolutions Per Minute [1/min]

L = .053;

L = .053; %!tro"e o# Engine [m]%!tro"e o# Engine [m]

$ = .0;

$ = .0; %$ore o# Engine [m]%$ore o# Engine [m]

l = .0&35;

l = .0&35; %Lengt' o# Engine (onne)ting Ro* [m]%Lengt' o# Engine (onne)ting Ro* [m]

+,)-l = 1;

+,)-l = 1; %+umer o# (-lin*ers [unitless]%+umer o# (-lin*ers [unitless]

(,r = 1.5;

(,r = 1.5; %(ompression Rtio [unitless]%(ompression Rtio [unitless]

+,r = ;

+,r = ; %+umer o# Revolutions Per Poer !tro"e%+umer o# Revolutions Per Poer !tro"e

t'et, = 55;

t'et, = 55; %(omustion $urn 2urtion [*egrees]%(omustion $urn 2urtion [*egrees]

t'et,0 = 150;

t'et,0 = 150; %(rn" ngle t !trt o# (omustion [*egrees]%(rn" ngle t !trt o# (omustion [*egrees]

t'et,# = t'et,04t'et,;

t'et,# = t'et,04t'et,; %inl (om. ngle [*egrees]%inl (om. ngle [*egrees]

I67 = 38;

I67 = 38; %7ime [*egrees] 'en Int"e 6lve (loses%7ime [*egrees] 'en Int"e 6lve (loses

E67 = 310;

E67 = 310; %7ime [*egrees] 'en E9'ust 6lve :pens%7ime [*egrees] 'en E9'ust 6lve :pens

These are the known engine inputs.

These are the known engine inputs. The bore, stroke, and

The bore, stroke, and connecng rod lengths are used to

connecng rod lengths are used to

calculat

calculate the engine displacement and other parameter

e the engine displacement and other parameters.

s. The “theta” values will be altered to

The “theta” values will be altered to

determine the ideal

determine the ideal spark advance.

spark advance.

&.%

&.%

%uel Inputs

%uel Inputs

,rtio = 18.;

,rtio = 18.; %)tul ir uel Rtio :# (R 2uring 7esting [unitless]%)tul ir uel Rtio :# (R 2uring 7esting [unitless]

lm* = 1;

lm* = 1; %E9)ess ir (oe##i)ient [unitless]%E9)ess ir (oe##i)ient [unitless]

L6 = 88.e;

L6 = 88.e; %Loer eting 6lue :# uel Mi9ture [</"g]%Loer eting 6lue :# uel Mi9ture [</"g]

et,)om = .&5;

et,)om = .&5; %ssume* (omustion E##i)ien)-%ssume* (omustion

E##i)ien)-These are the fuel inputs.

These are the fuel inputs. These values should be know

These values should be known based on the type of fuel, test results

n based on the type of fuel, test results,,

etc.

(2)

'.%

%tmosp'eri) Inputs

P,$2( = &500; %Inlet Pressure[P] ('rt oun* :n Eng. 7oolo9> 7,$2( = 300; %ssume* Inlet 7emperture [?]

R,ir = @; %As (onstnt or ir [</"gB?] gmm1C30> = Deros; %Prello)te Amm

rr-gmm1> = 1.8; %!ets Initil Amm 6lues ollos (urve it> 7, =800; %ssume* ll 7emperture !uggeste* 6lue>

The atmospheric inputs should be changed based on the elevaon, temperature, etc. at the

point of tesng. The wall temperature is assumed in this code, but there are several methods

for predicng the wall temperature based on the equivalence rao if interested, look these up

online!.

(.%

This secon of code uses test values to predict the speci"c heats rao as a funcon of

temperature. These coecients have been obtained e#perimentally.

(3)

This block of code sets inial array values at $ero. This speeds up the code and sets inial

condions.

*.%

%ecause the inial condions are already set, the loop runs between & and '() the "rst loop is

speci"ed in the inial condions!. The "rst poron of this block of code speci"es the di*erent

crank angles, the volume, and the heat transfer surface area.

(4)

“+fthen” statements specify condions in which the piece of code should operate. +n this case,

the burn fracon and fuel mass equaons won-t calculate unless the crank angle falls within a

certain criteria between burn iniaon and the "nal degree of burning!.

8.%

This piece of code says that the temperature and pressure only change when the intake and

e#haust valves are closed.

,.%

 large poron of last part of the loop is used to calculate the speci"c heats rao. This adds

comple#ity to the code, but also makes the code much more accurate. ll that needs to be

known here is that the speci"c heats rao decreases with increased temperature this can

change peak temperature/pressure predicons by several hundred units!.

+ndicated torque, indicated power, indicated mean e*ecve pressures, etc. are all based on the

equaons found in the 0eywood book. 1trange mulplicaon factors in the plot statements are

simply conversion factors between 2nglish and metric systems.

(5)

0 50 100 150 200 250 300 350 -20 -10 0 10 20 30

Power Vs. Crank Angle (English)

theta[deg]    P  o  w   e   r    [    h      ] 0 50 100 150 200 250 300 350 -10 -5 0 5 10 15

!or"#e Vs. Crank Angle (English)

theta[deg]    !  o  r   "   #   e    [    l    $    %    &    %    t    ]

The indicated power is the value that occurs at '()3degrees4. This plot was found through

integraon integral of 5d6!. The e#act value can be found by viewing element '() in the

“78dot” array in the 9T:% workspace!. The indicated torque can be found the same way.

(6)

ny variable can be found ne#t to the 9T:% command window. The indicated torque

torque!, indicated power 78dot!, and indicated mean e*ecve pressure imep! can be found

in this menu.

"ll M/T/B $ode

%Fniversit- :# I*'o Engine !imultion

%Fses G!ingle HoneG (omustion nl-sis it' 6rile !pe)i#i) ets Rtios %:nl- Mo*els 7'e (ompression n* E9pnsion !tro"es

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )ler ll; )lose ll; )l); %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Engine Inputs

RPM = 10000; %Revolutions Per Minute [1/min] L = .053; %!tro"e o# Engine [m]

$ = .0; %$ore o# Engine [m]

l = .0&35; %Lengt' o# Engine (onne)ting Ro* [m] +,)-l = 1; %+umer o# (-lin*ers [unitless]

(7)

+,r = ; %+umer o# Revolutions Per Poer !tro"e t'et, = 55; %(omustion $urn 2urtion [*egrees]

t'et,0 = 150; %(rn" ngle t !trt o# (omustion [*egrees] t'et,# = t'et,04t'et,; %inl (om. ngle [*egrees]

I67 = 38; %7ime [*egrees] 'en Int"e 6lve (loses E67 = 310; %7ime [*egrees] 'en E9'ust 6lve :pens

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Engine (l)ultions $se* :n Previous Inputs

%ssumes verge !ur#)e re In 'i)' et 7rns#er :))urs

,p = pi/8>$J; %(ross !e)tionl Piston re [mJ]

,)' = ,p; %(-lin*er e* !ur#)e re in )'mer> 6,* = +,)-l,pL; %2ispl)e* 6olume :# Engine [mJ3]

+ = RPM/0; %(onverts RPM to RP! [1/s]

!,r,p = L+; %(l)ultes Men Piston !pee* [m/s]

 = L/; %(l)ultes (rn" R*ius 1/ stro"e>[m] 6,72( = 6,*/(,rB1>>/+,)-l; %(l)ultes (lern)e 6olume [mJ3]

6,$2( = 6,*/+,)-l>46,72(; %(-l. 6olume t $2( [mJ3]

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %uel Inputs

,rtio = 18.; %)tul ir uel Rtio :# (R 2uring 7esting [unitless] lm* = 1; %E9)ess ir (oe##i)ient [unitless]

L6 = 88.e; %Loer eting 6lue :# uel Mi9ture [</"g] et,)om = .&5; %ssume* (omustion

E##i)ien)-%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %tmosp'eri) Inputs

P,$2( = &500; %Inlet Pressure[P] ('rt oun* :n Eng. 7oolo9> 7,$2( = 300; %ssume* Inlet 7emperture [?]

R,ir = @; %As (onstnt or ir [</"gB?] gmm1C30> = Deros; %Prello)te Amm

rr-gmm1> = 1.8; %!ets Initil Amm 6lues ollos (urve it> 7, =800; %ssume* ll 7emperture !uggeste* 6lue>

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %7'ese re Pol-nomils Fse* 7o (l)ulte Amm s  un)tion :# (rn" ngle %Pol-nomil (onstnts

,1 = .&; , = 3&.1eB0; ,3 = 5.&eB0&; ,8 = B@.eB13; ,5 = .5@eB1;

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,0 = 308&.33; ,1 = B5.eB0; , = B&.5eB05; ,3 = 1.53eB0&; ,8 = B00.eB18; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ),u = .35@8; ),r = 8.1@eB03; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, *,0 = 10.810; *,1 = .@515; *,3 = B3.15; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

(8)

e,0 = B15.001e03; e,1 = B15.@3@e03; e,3 = &.13e03; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, #,0 = B.103&; #,1 = B.3@5; #,3 = .158; #,8 = B18.3; #,5 = 11@.; #, = 18.503; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, r,0 = B.&; r,1 = 11.&@; r, = B588; r,3 = B.8358; %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#-ing Initil (on*itions or Loops

%26K2Ket). re Reltive 7o ('nge In 7'et i.e. 26/2t'et> t'et1C30>=Deros; %!trting (rn" ngle [*eg]

61C30>=Deros; %Prello)te 6olume

rr-61>=6,$2(; %!trting (omustion ('mer 6olume [mJ3] 261C30> = Deros; %Prello)te ('nge In 6olume

rr-261> = 0; %!pe)i#-ing Initil ('nge In 6olume [mJ3 P1C30>=Deros; %Prello)te Pressure

rr-P1> = P,$2(; %Inlet Pressure ["P]

2P1C30> = Deros; %!pe)i#-ing Initil ('nge In Pressure 71C30>=Deros; %Prello)te 7emperture

rr-71> = 7,$2(; %Inlet 7emperture [?]

271C30> = Deros; %!pe)i#-ing Initil ('nge In 7emperture 1C30> = 0; %Prello)te Mss $urn

rr-21C30> = Deros; %Prello)te ('nge In Mss $urn r)tion [unitless] 2N1C30> = 0; %Prello)te et Relese

rr-N1C30>=Deros; %Prello)te et

rr-M,1C30> = 0; %Prello)te Mss In (omustion ('mer rr-P,overR71C30> = Deros; %Prello)tes I*el As L rr-P,overR71> = P1>/R,ir71>>; %Initil 6lue I*el As rr-s1C30>=Deros; %Prello)tes 2istn)e (rn"/Piston 9es

rr-s1> = B)os*t'et1>>4sOrtlJ B Jsin*t'et1>>J>; %Initil 6l.  = ,)' 4 ,p 4 pi$l4Bs1>>; %Initil et 7rns#er re

1C30> = Deros; %Prello)te or" ,*ot1C30> = Deros; %Prello)te Poer 7orOue1C30> = Deros; %Prello)te 7orOue

N,*ot1C30> = Deros; %Prello)te et 7rns#er rr-u1C30> = Deros; %Prello)te Internl Energ-

rr-*u1C30> = Deros; %Prello)tes ('nge In Internl Energ- rr-)v1C30> = Deros; %Prello)tes et (p)it-

rr-F1C30>=Deros; %Prello)te (onstnt GFG

rr-F1> = .@!,r,p4.00387,$2(6,*/6,$2(>2P1>/P,$2(>;

',g1C30>=Deros; %Prello)te et 7rns#er (oe##i)ient rr-',g1> = 3.P1>/1000>J.@F1>J.@$JB.>71>JB.55>;

2N,1C30>=Deros; %Prello)te (onve)tive et Loss

rr-%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, #or i = C30

%!pe)i#ies 7'et [*eg] (rn" ngle t'eti> = t'etiB1>41;

%!pe)i#ies 2istn)e $eteen (rn"/Piston 9es s  un)tion :# t'et s = B)os*t'eti>>4sOrtlJ B Jsin*t'eti>>J>;

(9)

6i> = 6,72( 4pi/8>$J>l 4  B s>;

%!pe)i#ies ('nge In 6olume s  un)tion :# (rn" ngle 26i> = 6i>B6iB1>;

%!pe)i#ies I*el As Portion :# EOutions P,overR7i> = PiB1>/R,ir7iB1>>;

%Instntneous !u#)e re or et 7rns#er>  = ,)' 4 ,p 4 pi$l4Bs>;

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies Mss r)tion $urn s  un)tion :# (rn" ngle eie )n.> %lso !pe)i#ies Mss :# uel In (omustion ('mer s  un)tion :# %7'et i# t'ett'et,0   i>=0; else i> = 1Be9pB5t'eti>Bt'et,0>/t'et,>J3>; en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!olves or InQe)te* Mss :# uel 2uring (omustion

i# t'et,0 t'eti> i# t'eti>  t'et,# M,i> = 6t'et,0B1>P,overR7t'et,0B1>/lm*,rtio>; en* en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies ('nge In Mss r)tion $urn s  un)tion :# (rn" ngle 2i> = i> B iB1>;

%(l)ultes et 7rns#er (oe##i)ient s  un)tion :# (rn" ngle Fi> = .@!,r,p4.00387,$2(6,*/6,$2(>2PiB1>/P,$2(>;

',gi> = 3.PiB1>/1000>J.@Fi>J.5$JB.>7iB1>JB.55>;

%(l)ultes (onve)tive Losses Into ll s  un)tion :# (rn" ngle 2N,i> = ',gi>7iB1>B7,>0/piRPM>>;

%(l)ultes ('nge In et 7rns#er totl> s  Fn)tion :# (rn" %ngle

2Ni> = et,)omL6M,i>2i>B2N,i>; %(l)ultes 7otl et 7rns#er Per (-)le> Ni> = NiB1>42Ni>;

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies Pressure n* 7emperture In)reses $eteen Int"e 6lve

%(losing n* E9'ust 6lve :pening i# I67 t'eti>E67   27i>=7iB1>gmmiB1>B1>1/PiB1>6iB1>>>2Ni> ...   B1/6iB1>>26i>>;   2Pi>=BPiB1>/6iB1>>26i>4PiB1>/7iB1>>27i>; Pi> = PiB1>42Pi>; en* %,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Returns 7emperture 6lues 7o $eginning :# Loop

(10)

7i> = 7iB1>427i>;

%(l)ultes (-lin*er or" [<] s  un)tion :# (rn" ngle i> = iB1>4Pi>26i>;

%(l)ultes Poer ["] s  un)tion :# (rn" ngle ,*oti> = +,)-li>+>/1000;

%In*i)te* Men E##e)tive Pressure

imep = ,*ot30>+,r1000/6,*1000+>;

%(l)ultes 7orOue[+m] s  un)tion :# (rn" ngle 7orOuei> = ,*oti>1000>/pi+>;

%(l)ultes et Loss ["] s  un)tion :# (rn" ngle N,*oti> = +,)-lNi>+/1000;

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, % 7'e olloing !e)tion :# (o*e (l)ultes n Fp*te* 6lue :# Amm % Fsing 7'e GPol-nomil Met'o*G 2evelope* $- ?riegerB$ormn

% Fser :# 7'is (o*e Must $e (re#ul $e)use ))ur)- :# 7'is Met'o* % 2rops s 7'e uel Mi9ture $e)omes In)resingl- Ri)'

%(l)ultes K$ )tors or olloing $lo)" :# (o*e

,t = ,17i>4,7i>J4,37i>J34,87i>J84,57i>J5; $,t = ,04,17i>4,7i>J4,37i>J34,87i>J8;

%(l)ultes )tor G2G s  un)tion :# lm* 2,lm* = *,0 4 *,1lm*JB1>4 *,3lm*JB3>;

%(l)ultes )tor GG s  un)tion :# 7empertureKlm* E,7Lm* = e,0 4 e,1lm*JB1>4 e,3lm*JB3>>/7i>; ,7PLm* = #,0 4 #,1lm*JB1> 4 #,3lm*JB3> 4 ...

#,8 4 #,5lm*JB1>>/7i>>>log#,Pi>>; %(l)ultes (orre)tion )tor or Internl Energ-u,)orr = ),ue9p2,lm* 4E,7Lm* 4 ,7PLm*>;

%(l)ultes Internl Energ- s  un)tion :# (rn" ngle ui> = ,t B $,t/lm* 4 u,)orr;

%(l)ultes ('nge In Internl Energ-*ui> = ui> B uiB1>;

%(l)ultes et (p)it- G(,vG s  un)tion :# (rn" ngle )vi> = *ui>/27i>;

%(l)ultes (orre)tion )tor or GRG 6lue s  un)tion :# (rn" %ngle

R,)orr = ),re9pr,0loglm*> 4 r,14r,/7i> 4 ...   r,3log#,Pi>>>/lm*>;

%(l)ultes )tul GRG 6lue R = .@ 4 .00/lm* 4 R,)orr; i# i=3

%(l)ultes )tul Amm 6lue n* Returns 7o $eginning :# (o*e gmmi> = 1 4 R/)vi>;

en* en*

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %!pe)i#ies (on*itions or Minimum n* M9imum Plot 6lues

v,min = min6>; v,m9 = m96>; p,min = minP>; p,m9 = m9P>;

P,min = min,*ot>; P,m9 = m9,*ot>; 7,min = min7>; 7,m9 = m97>;

N,min = minN,*ot>; N,m9 = m9N,*ot>; 7min = min7orOue>; 7m9 = m97orOue>;

(11)

%,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, %Plot !ttements

#igure1> plott'etK>

titleSMss r)tion $urne* 6s. 7'etS > 9lelSt'et[*eg]S>

-lelSMss r)tion $urne* %>S > 9is[0 30 B.1 1.1]> #igure> plott'etK6> titleS6olume 6s. (rn" ngleS > 9lelSt'et[*eg]S> -lelS6olume [mJ3]S> 9is[0 30 v,min v,m9]> #igure3> plott'etKP.000185033@>

titleS(-lin*er Pressure 6s. (rn" ngle Englis'S > 9lelSt'et[*eg]S>

-lelSPressure [psi]S>

9is[0 30 p,min0.000185033@ p,m90.000185033@]> #igure8>

plott'etK7>

titleS(-lin*er 7emperture 6s. (rn" ngleS > 9lelSt'et[*eg]S>

-lelS7emperture [?]S> 9is[0 30 7,min 7,m9]> #igure5>

plott'etK,*ot1.3800&>

titleSPoer 6s. (rn" ngle Englis'>S > 9lelSt'et[*eg]S>

-lelSPoer ['p]S>

9is[0 30 P,min1.3800& P,m91.3800&]> #igure>

plott'etK7orOue0.3518&>

titleS7orOue 6s. (rn" ngle Englis'>S > 9lelSt'et[*eg]S>

-lelS7orOue [l##t]S>

9is[0 30 7min0.3518& 7m90.3518&]> #igure>

plott'etKP.000185033@K SS>

titleSPressureKPoerKn* et 7rns#erS > 'ol* on;

plott'etK,*ot1.3800&K SgS> plott'etKN,*ot1.3800&K SrS> legen* Pressure Poer 

9lelSt'et[*eg]S>

(12)

References

Related documents

According to the most recent estimates of displacement, there are 79.5 million people forcibly displaced by conflict in the world, including 45.7 internally displaced persons

It can be concluded that the presented robot has the design criteria such as suitable degrees of freedom, low inertia and high safety and so is suitable for gait

Fundamental properties together with the distribution of the trace map values over the Galois field GF ( p, m ) and Galois ring GR ( p e , m ) have been used to construct

APPENDIX B: PEDIATRIC RISK INDICATORS FOR HEARING LOSS .... This document has been developed to provide background and recommendations for standard procedures for a) developing

In this research, descriptive statistics, Pearson correlation to investigate the correlation between spiritual health and spiritual intelligence and the clients’

Accordingly we investigated the relation of seafood – that is, fish and shellfish – intake before pregnancy to length of gestation, birthweight and decreased fetal growth in a cohort

The Tabasco Restaurant &amp; Pizzeria for 12 years is located both in the center of Fira, right in the main square, and just outside the village of Karterados in the area hosting

There are also several other civil engineering firms in the area, but Premier Engineering Design would be the only firm that specializes in whitewater design in Grand Rapids.