Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

# Учёба / lab_mat-met

.pdf
Скачиваний:
2
Добавлен:
03.03.2016
Размер:
644.35 Кб
Скачать

dh_nLpL}glL\ A lZ B fh_ fZlb \b]ey^

function C=polysum(A,B)

n=length(A);

m=length(B);

if n>m, r=n-m; B=[zeros(1,r),B];

elseif m>n, r=m-n; A=[zeros(1,r),A];

end

C=A+B;

% end polysum

>ey \bdhgZggy [ievr kdeZ^gbo hi_jZpic ML fZ} \kljh}gi nmgdpiconv,

deconv, polyder lZ •gr•

C = conv(A, B) h[qbkex} dh_n•p•}glb klmi•g_\h]h ihe•ghfZ ydbc } ^h[mldhf ^\ho ihe•ghf•\ a \_dlhjZfb dh_n•p•}gl•\ : • < Jhaf•j \_dlhjZ K \bagZqZ}lvky gZklmigbf qbghf

length(C)= length(A) + length(B) - 1.

[D, R] = deconv(A, B) – hi_jZp•y jhadeZ^m, h[qbkex}:

D dh_n•p•}glb klmi•g_\h]h ihe•ghfZ hljbfZgh]h \•^ ^•e_ggy ihe•ghfZ a \_dlhjhf dh_n•p•}gl•\ : gZ ihe•ghf a \_dlhjhf dh_n•p•}gl•\ <;

R hklZqZ \•^ ^•e_ggy Ijb pvhfm kijZ\_^eb\_ \•^ghr_ggy

A = conv(D, B) + R.

A1 = polyder(A) – h[qbkex} dh_n•p•}glb :1 klmi•g_\h]h ihe•ghfZ, ydbc } iho•^ghx ihe•ghfZ a dh_n•p•}glZfb :.

[Q, D] = polyder(A, B) – h[qbkex} qbk_evgbd Q • agZf_ggbd D iho•^gh€

 4 = \$ _ qZkldb ^\ho ihe•ghf•\ a \_dlhjZfb dh_n•p•}gl•\ : • <, lh[lh , Z[h, ydsh ' %

ijbkmlg•c h^bg \bo•^gbc iZjZf_lj:

D = polyder(A, B) – h[qbkex} dh_n•p•}glb D iho•^gh€ \•^ ^h[mldZ ihe•ghf•\ a \_dlhjZfb dh_n•p•}gl•\ : • <, lh[lh D=(AB)'.

20

AZ\^Zggy

JhajZom\Zlb agZq_ggy afigghi Z ijb x ydbc afigx}lvky \i^ - ^h a djhdhf

0.1.

<bjZab ^ey \bjZom\Zggy Z gZ\_^_gi m lZ[ebpi < pbo \bjZaZo nmgdpif1(x), f2(x), f3(x } klmi•g_\i ihe•ghfb ydi jiagylvky h^bg \i^ h^gh]h ihjy^dhf i agZq_ggyf dh_nipi}gli\

>ey g_iZjgbo \ZjiZgli\

 I [ = [ − [ − [ + [ + [ + I [ = [ + [ − [ + ; I [ = − [ + [ + [ − >ey iZjgbo \ZjiZgli\ I [ = [ + [ + [ + [ − I [ = [ + [ − [ + I [ = [ − [ + [ + [ Ih[m^m\Zlb ]jZn•db nmgdp•c f1(x), f2(x), f3(x) m h^ghfm \•dg• lZ Z(x m •grhfm

21

EZ[hjZlhjgZ jh[hlZ ‹

:IJHDKBF:P,Y F?LH>HF G:CF?GVRBO D<:>J:L,<

P•ev jh[hlb gZ\qblbky hibkm\Zlb lZ[ebqg• nmgdp•€ ZgZe•lbqgbfb \bjZaZfb

 L_hj_lbqg• \•^hfhkl• :ijhdkbfZp•y \•^ eZl approximare - ijb[ebm\Zlbky - p_ ijb[ebag_ \bjZ_ggy [m^v-ydbo \_ebqbg q_j_a •gr• [•evr ijhkl•r•. :ijhdkbfZp•y lZ[ebqgh€ nmgdp•€ \L = I ([ L) ; i=1, 2, ... , n f_lh^hf gZc- f_gvrbo d\Z^jZl•\ ihey]Z_ m \bagZq_gg• iZjZf_lj•\ ^_ydh€ ZgZe•lbqgh€ nmgdp•€ F(x), sh aZ[_ai_qmxlv f•g•f•aZp•x nmgdp•hgZeZ N = ∑Q ()([L ) − \L ) . (5.1) L= Ydsh \ ydhkl• nmgdp•€ sh Zijhdkbfm} \aylb klmi•g_\bc ihe•ghf ) [ = 3 [ = & + & [ + + & N [N = ∑N & M [ M , (5.2) N M=

lh aZ^ZqZ a\h^blvky ^h \bagZq_ggy \_dlhjm dh_n•p•}gl•\ K=(K0, C1, , Ck reyohf \bj•r_ggy kbkl_fb e•g•cgbo j•\gygv d 1)-]h ihjy^dm

 ∂Φ = ∂Φ = ∂Φ = (5.3) ∂& ∂& ∂& N ∂Φ Q Q N N = ∑ ^_ Φ = ∑ ∑ & M [L M − \L ; & M [L M − \L P ; m=0, 1, …, k. ∑ [L L= M= ∂&P L= M= I•key i_j_l\hj_gv kbkl_fZ [m^_ fZlb \b]ey^ & Q + & ∑Q [ L + + & N ∑Q [N = ∑Q \ L= L= L L= L Q + Q [L + + Q [LN + = Q \L & ∑ [L & ∑ &N ∑ ∑ [L (5.4) L= L= + L= L= Q Q Q Q & ∑ [LN + & ∑ [LN + + &N ∑ [L N = ∑ [L \L L= L= L= L=

22

A kbkl_fb [Zqbfh sh _e_f_glb fZljbp• dh_n•p•}gl•\ : \•evgbo qe_g•\ B fhgZ hibkZlb nhjfmeZfb

 Q DPM = ∑ [LP+ M L= Q = ∑ [LP \L EP L=

• \_dlhjZ

(5.5)

^_ m=0, 1, …, k; j=0, 1, …, k.

I•key \bagZq_ggy dh_n•p•}gl•\ kbkl_fm fhgZ \bj•rblb [m^v-ydbf a \•^hfbo f_lh^•\ gZijbdeZ^ f_lh^hf =ZmkZ

:ijhdkbfZp•x f_lh^hf gZcf_gvrbo d\Z^jZl•\ qZklh aZklhkh\mxlv ^ey \bj•\gx\Zggy lZ[ebqg•o nmgdp•c sh [meb ihemq_g• \ oh^• _dki_jbf_glZ Z lZdh ^ey af_gr_ggy h[¶}fm •gnhjfZp•€ ijh lZ[ebqg• nmgdp•€ ijb g_\bkhdbo \bfh]Zo ^h lhqghkl• jhajZomgdm

< ML ^ey agZoh^_ggy dh_n•p•}gl•\ Zijhdkbfmxqh€ nmgdp•€ f_lh^hf gZcf_gvrbo d\Z^jZl•\ \bdhjbklh\m}lvky nmgdp•y polyfit:

P=polyfit(Xt, Yt, k).

P \_dlhj-jy^hd dh_n•p•}gl•\ Zijhdkbfmxqh]h ihe•ghfZ mihjy^dh\Zgbc aZ m[m\Zggyf klmi•g_c x ;

Yt (Xt) – lZ[ebqgZ nmgdp•y

k ihjy^hd Zijhdkbfmxqh]h ihe•ghfZ

AZ\^Zggy

:ijhdkbfm\Zlb lZ[ebqgm nmgdp•x sh ijb\_^_gZ \ lZ[ebp• KI k-]h ihjy^dm f_lh^hf gZcf_gvrbo d\Z^jZl•\ k=2, 3, 4, n- H[qbkeblb agZq_ggy f•g•f•amxqh]h nmgdp•hgZem Φ Ijh•eexkljm\Zlb j_amevlZlb ]jZn•dZfb <bdhgZlb ijh]jZfm ^\•q• ijb j•ag•c d•evdhkl• lZ[ebqgbo lhqhd n lZ n Hp•gblb \ieb\ d•evdhkl• lhqhd gZ lhqg•klv ZijhdkbfZp•€

23

 LZ[ebpy ‹ \Zj LZ[ebqg• nmgdp•€ 1,2 xt -1 1 3 5 7 9 11 13 15 yt 8.71 109,8 124.4 122.5 112.1 96.6 80.2 6.3 57.9 3,4 xt 2 3.2 4.4 6.2 7.8 9.5 10.9 11.5 12.7 yt 19.9 22 30 42.1 65 99.5 120 126.8 133.4 5,6 xt -3.5 -1.5 0.5 2.5 4.5 6.5 8.5 10.5 12.5 yt 0.45 -3.09 -4.01 -3.9 -3 -1.62 -0.18 0.99 1.72 7,8 xt 1.25 2.59 4.4 6.54 8.5 11.5 13.5 14.5 15 yt 3.0 5.0 7.0 8.5 9.3 9.9 10.6 11.2 11.64 9,10 xt -2 0 2 4 6 8 10 12 14 yt 7.84 7.13 6.31 5.29 4.03 2.5 0.87 -0.68 -0.79 11,12 xt -1.5 1 2.7 5.5 6.5 8.3 9.6 11.2 12.75 yt 2.45 1.12 -1 -2.1 -2.3 -1.9 -1 2 3.5 13,14 xt 0,67 1,5 2,5 3,5 5 6,5 10 12,4 14 yt 110 118,7 124,5 125,2 122,5 115,1 88,3 70 61,2 15,16 xt 0,5 2,5 4,5 6,5 8,5 10,5 12,5 14,5 16,5 yt 23,7 20,1 27,8 45,3 79,2 115,4 132,9 141,1 147 17,18 xt -2,77 -0,5 1 2 3,5 7 10 11,5 12,5 yt -1,5 -3,65 -4,03 -4,0 -3,54 -1,58 0,73 1,4 1,83 19,20 xt 0,5 2,0 3,5 5,0 6,5 8,5 9,5 11,0 12,5 yt 1,23 0,92 0,78 0,68 0,6 0,53 0,49 0,47 0,45 21,22 xt -1 1 3 5 7 9 11 13 15 yt 1,02 2,57 5,51 7,52 8,69 9,38 9,79 10,35 11,64 23,24 xt -3 0,5 1,5 2,5 4,3 6,2 7,7 9,0 11 yt 9,4 7,52 6,75 5,8 3,6 0,53 -1,5 -2,94 -4,4 25,26 xt -4 -2 0 2 4 6 8 10 12 yt 3,1 2,66 1,74 0,35 -1,26 -2,28 -2,07 -0,54 2,53 27,28 xt 0 0,4 1,5 3,0 4,6 7 9,2 11,5 13 yt 1,47 1,26 0,99 0,82 0,7 0,57 0,5 0,46 0,44 29,30 xt -15 -10 -5 0 5 10 15 20 25 yt 8.71 109.8 124.4 122.5 112.1 96.6 80.2 6.3 57.9

24

EZ[hjZlhjgZ jh[hlZ ‹

1GL?JIHEYP1Y

P•ev jh[hlb gZ\qblbky \bagZqZlb agZq_ggy nmgdp•c sh aZ^Zg• lZ[ebqgh ijb [m^v-ydbo agZq_ggyo Zj]mf_gl•\ aZ ^hihfh]hx •gl_jiheyp•€ nmgdp•c klmi•g_\bf ihe•ghfhf KI

L_hj_lbqg• \•^hfhkl•

M gZmp• • l_ogbp• [Z]Zlh yd• nmgdp•hgZevg• aZe_ghkl• aZ^Zxlvky g_ ZgZe•lbqgh Z m \b]ey^• ]jZn•d•\ qb lZ[ebpv

M ?HF •gnhjfZp•y ijh lZd• nmgdp•€ a[_j•]Z}lvky m \b]ey^• fZkb\•\ gZijbdeZ^

 \L = ) [L , L = Q . (6.1) LZ[ebqg• agZq_ggy Zj]mf_gl•\ gZab\Zxlv \maeZfb AZ^ZqZ •gl_jiheyp•€ ihey]Z} m agZoh^_gg• ijb[ebagh]h agZq_ggy g_e•g•cgh€ nmgdp•€ y m lhqdZo \•^f•ggbo \•^ \maeh\bo [ ≠ [ L .

Px aZ^Zqm fheb\h \bj•rblb \•^rmdZ\rb nmgdp•x sh •gl_jihex} F(x). <hgZ ijbcfZ} gZ ^_ydhfm •gl_j\Ze• > [ M [ M+ N @ agZq_ggy sh ki•\iZ^Zxlv a• agZq_ggyfb lZ[ebqgh€ nmgdp•€ m \maeh\bo lhqdZo

) ([ M ) = \ M )([ M+ ) = \ M+ ) ([ M+ N ) = \ M+ N

Lhqdm [ M a\mlv ihqZldh\bc \ma_e •gl_jiheyp•€

>m_ qZklh \ ydhkl• nmgdp•€ sh •gl_jihex} \bdhjbklh\mxlv Ze]_[jZ•qgbc ihe•ghf

 3 ([) = D [N + D [N − + + D N + N ≤ Q. N

Ijb k=n ihe•ghf Pk(x klZ} ]eh[Zevgbf •gl_jiheyglhf [h \ pvhfm \biZ^dm ch]h agZq_ggy ki•\iZ^Zxlv a• agZq_ggyfb ihqZldh\h€ nmgdp•€ \ mk•o \maeZo.

Ydsh lZ[ebqgZ nmgdp•y aZ^ZgZ m j•\ghf•jgh jhalZrh\Zgbo \maeZo lh[lh

[L + − [L = K = FRQVW lh agZq_ggy y(x) fhgZ \bagZqblb ih i_jr•c bgl_jiheyp•cg•c nhjfme• GvxlhgZ

25

 \ [ ≈ 3 [ = \ + T∆ \ + T T − ∆ \ + + T T − T − N + ∆ N \ , (6.2) M M M M N N ^_ T = [ − [ M K ∆ \ M ∆ \ M ∆ N \ M -ijyf• j•agbp• \•^ih\•^gbo ihjy^d•\ m ihqZldh\hfm \mae• Ydsh \maeb lZ[ebqgh€ nmgdp•€ jhalZrh\Zg• g_j•\ghf•jgh [L + − [L = YDU lh agZq_ggy y(x) fheb\h \bagZqblb aZ •gl_jiheyp•cghx nhjfmehx EZ]jZgZ \ [ ≈ /N [ = M+ N [ − [ M [ − [ M+ [ − [P− [ − [P+ [ − [ M+ N (6.3) = ∑ \ P [P − [ M [P − [ M+ [P − [P− [P − [P+ [P − [ M+ N P= M Nhjfmeb fhgZ aZklhkm\Zlb ^ey ihrmdm y(x) gZ •gl_j\Ze•

[ [ M [ M + N @ Ze_ gZc[•evrm lhqg•klv \hgb aZ[_ai_qmxlv ih[ebam ihqZldh\h]h \maeZ •gl_jiheyp•€ [ M : [ >[ M [ M + @

Lhfm i_j_^ lbf yd \bdhjbklh\m\Zlb •gl_jiheyp•cg• nhjfmeb g_h[o•^gh agZclb ghf_j ihqZldh\h]h \maeZ •gl_jiheyp•€ Mfh\m \b[hjm fhgZ ah[jZablb

 gZklmigbf qbghf [ < [ M = − N [ >[Q− N Q [L ≤ [ < [L+ L = Q − N L

M k_j_^h\bs• ML p_c ihrmd fh_ aZ[_ai_qblb ihke•^h\g•klv ^•c

jv = find( xt<x );

if isempty( jv ), j=1;

else j = max( jv );

end

^_ xt Zj]mf_gl lZ[ebqgh€ nmgdp•€ \_dlhj x lhqdZ •gl_jihex\Zggy

M l_og•qgbo jhajZomgdZo a\bqZcgh aZklhkh\mxlv e•g•cgm Z[h d\Z^jZlbqgm •gl_jiheyp•x M lZdhfm \biZ^dm nhjfmeb lZ ijbcfZxlv gZklmigbc \b]ey^

26

 ijb k=1 \ [ ≈ 3 [ = \ M + T( \L+ − \L ) \ [ ≈ / [ = \ [ − [ M+ + \ M+ [ − [ M L [ M − [ M+ [ M+ − [ M ijb k=2 \ [ ≈ 3 [ = \ + T \ + − \ + T T − \ + − \ + + \ \ [ ≈ / [ = \ [ − [ + [ − [ + + [ − [ + [ − [ + + \ + [ − [ [ − [ + + \ + [ − [ [ − [ + [ + − [ [ + − [ + [ + − [ [ + − [ +

(6.4)

(6.5)

(6.6)

(6.7)

Nhjfmeb lZ y\eyxlv kh[hx j•\gyggy ijyfh€ ydZ ijhoh^blv q_j_a lhqdb [ M \ M ([ M+ \ M+ ) Z lZ - j•\gyggy d\Z^jZlbqgh€ iZjZ[heb ydZ ijhoh^blv q_j_a lhqdb ([ M \ M ) ([ M+ \ M+ ) ([ M+ \ M+ )

>ey •gl_jihex\Zggy lZ[ebqgh€ nmgdp•€ \ iZd_l• ML \bdhjbklh\mxlvky interp1, interp2, icubic, splin_ lZ ^_yd• •gr•

Y=interp1(Xt, Yt, X, metod),

Yt(Xt) lZ[ebqgZ nmgdp•y

X lhqdZ Z[h fZkb\ lhqhd m ydbo g_h[o•^gh h[qbkeblb agZq_ggy •gl_jihexxqh€ nmgdp•€

metod – f_lh^ •gl_jihex\Zggy fh_ ijbcfZlb gZklmig• agZq_ggy linear’ – e•gLcgZ •gl_jiheyp•y

cubic’ – dm[•qgZ •gl_jiheyp•y ‘spline’ – dm[•qgZ kieZcg-•gl_jiheyp•y

'nearest' •gl_jiheyp•y aZ gZc[ebqbf kmk•^g•f \maehf •kgm} ihqbgZxqb a

ML5.3 ).

Y=icubic(Xt, Yt, X) dm[•qgZ •gl_jiheyp•y

Y=spline(Xt, Yt, X) dm[•qgZ kieZcg-•gl_jiheyp•y

27

AZ\^Zggy

JhajZom\Zlb ijb[ebag• agZq_ggy lZ[ebqgbo nmgdp•c yd• aZ\^Zg• m lZ[ebp•

^ey Zj]mf_gl•\ dhlj• af•gxxlvky \•^ xmin ^h xmax \ lhqdZo

F_lh^bqg• j_dhf_g^Zp•€ I•key ihrmdm ghf_jZ ihqZldh\h]h \maeZ •gl_jiheyp•€ i_j_\•jl_ mfh\m [ = [ M .

Ijb €€ \bdhgZgg• g_ \bdhjbklh\mcl_ •gl_jiheyp•cgm nhjfmem Z agZoh^vl_ agZq_ggy [_aihk_j_^gvh •a lZ[ebp• \ = \L .

>ey ]jZn•qgh€ i_j_\•jdb \b\_^•lv gZ _djZg m ]jZn•qghfm j_bf• lZ[ebqgm nmgdp•x • €€ •gl_jihevh\Zg• agZq_ggy m j•ag•c nhjf• qb j•agbf dhevhjhf GZijbdeZ^ nmgdp•x \b\_^•lv gZ _djZg m \b]ey^•³a•jhd´Z •gl_jihevh\Zg• agZq_ggy m \b]ey^• \•^j•ad•\ ijyfbo f• ^\hfZ kmk•^g•fb lhqdZfb

<b[•j f_lh^Z •gl_jihex\Zggy hj]Zg•am\Zlb m \b]ey^• f_gx >ey pvh]h \bdhjbklm\Zlb nmgdp•x ML menu.

EZ[hjZlhjgZ jh[hlZ ‹

G?E1G1CGBC I:JGBC J?=J?K1CGBC :G:E1A

P•ev jh[hlb gZ\qblbky hibkm\Zlb lZ[ebqg• nmgdp•€ ZgZe•lbqgbfb g_e•g•c- gbfb \bjZaZfb

L_hj_lbqg• \•^hfhkl•

:ijhdkbfZp•x lZ[ebqgh€ nmgdp•€ yi=f(xi), i=1, 2, … , n f_lh^hf gZcf_gvrbo d\Z^jZl•\ gZab\Zxlv j_]j_k•cgbf ZgZe•ahf

E•g•cgbc j_]j_k•cgbc ZgZe•a ihey]Z} m \bagZq_gg• iZjb dh_n•p•}gl•\ C1 C2 e•g•cgh€ aZe_ghkl•

 P1(x)=C1x+C2 , (7.1) ydZ aZ[_ai_qm} ZijhdkbfZp•x aZ\^Zgh€ lZ[ebqgh€ nmgdp•€ yi=f(xi) f_lh^hf gZcf_gvrbo d\Z^jZl•\

G_e•g•cgZ iZjgZ j_]j_k•y ihey]Z} m \bagZq_gg• iZjb dh_n•p•}gl•\ d1 d2

28

 g_e•g•cgh€ \•^ghkgh af•ggh€ x Zijhdkbfmxqh€ nmgdp•€ ya(x)=F(x, d1, d2) . (7.2) G_e•g•cgm iZjgm j_]j_k•x fh`gZ a\_klb ^h e•g•cgh€ iZjgh€ aZ ^hihfh]hx e•g•Zj•amxqbo i_j_l\hj_gv nmgdp•€ ya(x). Jha]eyg_fh ijbdeZ^ >ZgZ lZ[ebqgZ nmgdp•y Y(X): X=[0, 0.5, 1, 2, 3]; Y=[0, 1, 1.67, 2.5, 5]. <•^hfh sh \hgZ ^hklZlgvh lhqgh Zijhdkbfm}lvky \bjZahf \ [ = G [ . D G + [ I•key i_j_l\hj_gv G + [ G = = + . (7.3) \ D ([) G [ G [ G A j•\gyggy [Zqbfh sh nmgdp•y \D e•g•cgZ \•^ghkgh af•ggh€ [ . IhagZqbfh \A = [A = E = G E = I•key i•^klZgh\db m j•\gyggy \D G [ G fZ}fh \ [ = E [ + E . >Ze• lj_[Z i_j_jZom\Zlb \bo•^gm lZ[ebqgm nmgdp•x [ = \ = ihl•f L L [L \L h[qbkeblb dh_n•p•}glb e•g•cgh€ j_]j_k•€ b1 • b2 • i_j_jZom\Zlb dh_n•p•}glb g_e•g•cgh€ j_]j_k•€ G = G = E E E

AZ\^Zggy

:ijhdkbfm\Zlb lZ[ebqgm nmgdp•x sh ijb\_^_gZ m lZ[ebp• g_e•g•cghx nmgdpb}x yZ(x H[qbkeblb agZq_ggy f•g•f•amxqh]h nmgdp•hgZem Ijh•exkljm\Zlb j_amevlZlb ]jZn•dZfb

<bo•^g• ^Zgg•

n=4; x1=1; x2=2; x3=3,5; x4=5.

29

Тут вы можете оставить комментарий к выбранному абзацу или сообщить об ошибке.

Оставленные комментарии видны всем.

Соседние файлы в папке Учёба