問一道大學(xué)數(shù)學(xué)Matlab實(shí)驗(yàn)題:利用 Taylor公式近似計(jì)算sin7,并分析展開點(diǎn)x和展開階數(shù)? 學(xué)習(xí)高等數(shù)學(xué)的感想
使用matlab如何利用 Taylor公式近似計(jì)算sin7°,并分析展開點(diǎn)x和展開階數(shù)?
第一步,根據(jù)sin7°,創(chuàng)建函數(shù)f=sin(x)
第二步,利用taylor()函數(shù),對(duì)f=sin(x)進(jìn)行關(guān)于x=a(a=7)冪級(jí)數(shù)展開,即 taylor(f,x,'Order',n)
當(dāng)n=5時(shí),p=taylor(f,x,'Order',5),%p=- x^3/6 + x
當(dāng)n=7時(shí),p=taylor(f,x,'Order',10), %x^9/362880 - x^7/5040 + x^5/120 - x^3/6 + x
第三步,計(jì)算x=7/180*pi時(shí)的y值。即
當(dāng)n=5時(shí),y=eval(p) %計(jì)算結(jié)果
當(dāng)n=10時(shí),y=eval(p) %計(jì)算結(jié)果
第四步,分析計(jì)算結(jié)果可以看到,隨著階數(shù)('Order')的提高,y值越接近 于真值。
當(dāng)n=5時(shí),誤差為2.267e-07
當(dāng)n=10時(shí),誤差為0
鄒妮13836221394: matlab數(shù)學(xué)實(shí)驗(yàn)考試題,求高手幫忙做一下,急!
定西市波發(fā): ______ >> x=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1]; >> y=[0.3 0.5 1 1.4 1.6 1.9 0.6 0.4 0.8 1.5 2]; >> p=polyfit(x,y,3); >> plot(x,y,'rp'),hold on >> y=@(x)(p(1)*x^3+p(2)*x^2+p(3)*x+p(4)); >> fplot(y,[0,1]),grid on
鄒妮13836221394: 求解數(shù)學(xué)建模實(shí)驗(yàn)(用MATLAB)題目
定西市波發(fā): ______ a = randperm(100); b = a(1:15) [asort ind] = sort(b(1,:)); b = b(:,ind); b
鄒妮13836221394: 使用Matlab隨機(jī)生成三行四列數(shù)組,要求其中的元素為〔5,10〕中的整數(shù) 數(shù)學(xué)實(shí)驗(yàn) -
定西市波發(fā): ______ 5+round(5*rand(3,4))
鄒妮13836221394: 數(shù)學(xué)實(shí)驗(yàn)怎樣在同一坐標(biāo)系內(nèi)畫不同的曲線在matlab環(huán)境下,
定西市波發(fā): ______ >>?x=-pi:0.25:pi; y1=sin(x); y2=cos(x); hold?on >>??plot(x,y1,'ro') >>??plot(x,y2,'kp')
鄒妮13836221394: 用MATLAB編寫一道求遞推數(shù)列極限的題 -
定西市波發(fā): ______ 可這樣:clc clear for n=2:10 x(1)=sqrt(5);a=x(1); for i=2:n x(i)=x(i-1)^2-2; a=a*x(i); b=a/(x(i)^2-2); end disp([n,b]) end 結(jié)果是:2.0000 0.95833.0000 0.99914.0000 1.00005.0000 1.00006.0000 1.00007.0000 1.00008.0000 1.00009.0000 1.000010.0000 1.0000 從而可證:當(dāng)n趨于無窮時(shí),極限為1
鄒妮13836221394: mathematica 數(shù)學(xué)實(shí)驗(yàn)!! 問個(gè)簡(jiǎn)單的問題 -
定西市波發(fā): ______ mathematica 數(shù)學(xué)實(shí)驗(yàn)!! 問個(gè)簡(jiǎn)單的問題 懸賞分:100 - 離問題結(jié)束還有 14 天23 小時(shí)有三個(gè)作圖的程序,如下: g[t_] := Plot[E^(-x^2/2)/Sqrt[2*Pi], {x, -t, t...
鄒妮13836221394: 數(shù)學(xué)實(shí)驗(yàn)選擇題 MATLAB 急求! -
定西市波發(fā): ______ 1)對(duì)下面有關(guān)程序的功能的說法不正確的是( B )(A)該程序先對(duì)函數(shù)積分,后對(duì)積分的結(jié)果求導(dǎo); (B)該程序先對(duì)函數(shù)求導(dǎo),后對(duì)求導(dǎo)的結(jié)果積分;(C)該程序積分及求...
鄒妮13836221394: matlab 數(shù)學(xué)實(shí)驗(yàn) 高手幫幫忙! -
定西市波發(fā): ______ 在matlab中輸入一下命令:x=[-5000:100:5000]; y=[-5000:100:5000]; [X,Y]=meshgrid(x,y); z=30*(1 - (X^2+Y^2) / 10^6); surf(X,Y,z); 感覺畫出來很奇怪.因?yàn)?x^2+y^2) / 10^6是很小的數(shù).
鄒妮13836221394: 用matlab編程解數(shù)學(xué)題(急) -
定西市波發(fā): ______ 文件1jisi.m%Creat the function for jisi%Let x(1)=x, x(2)=y function dx=jisi(t,x,a,b,c) s=sqrt((c-x(1))^2+(a*t-x(2))^2); dx=[b*(c-x(1))/s;b*(a*t-x(2))/s]; 文件2seajisi.m clear,clf,shg%Set the definied time%ts=0:0.05:.5;% ts=0:0.1:1.6; n=length(ts); x0=[0 0];%...
鄒妮13836221394: matlab數(shù)學(xué)實(shí)驗(yàn)解答7
定西市波發(fā): ______ MATLAB命令如下:y=inline(Dsolve('Dy=x+y','y(1)=2','x')) y(1.5)結(jié)果如下:y(x) = -x+exp(-1.0).*exp(x).*4.0-1.0 y(1.5)= 4.0949
第一步,根據(jù)sin7°,創(chuàng)建函數(shù)f=sin(x)
第二步,利用taylor()函數(shù),對(duì)f=sin(x)進(jìn)行關(guān)于x=a(a=7)冪級(jí)數(shù)展開,即 taylor(f,x,'Order',n)
當(dāng)n=5時(shí),p=taylor(f,x,'Order',5),%p=- x^3/6 + x
當(dāng)n=7時(shí),p=taylor(f,x,'Order',10), %x^9/362880 - x^7/5040 + x^5/120 - x^3/6 + x
第三步,計(jì)算x=7/180*pi時(shí)的y值。即
當(dāng)n=5時(shí),y=eval(p) %計(jì)算結(jié)果
當(dāng)n=10時(shí),y=eval(p) %計(jì)算結(jié)果
第四步,分析計(jì)算結(jié)果可以看到,隨著階數(shù)('Order')的提高,y值越接近 于真值。
當(dāng)n=5時(shí),誤差為2.267e-07
當(dāng)n=10時(shí),誤差為0
相關(guān)評(píng)說:
定西市波發(fā): ______ >> x=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1]; >> y=[0.3 0.5 1 1.4 1.6 1.9 0.6 0.4 0.8 1.5 2]; >> p=polyfit(x,y,3); >> plot(x,y,'rp'),hold on >> y=@(x)(p(1)*x^3+p(2)*x^2+p(3)*x+p(4)); >> fplot(y,[0,1]),grid on
定西市波發(fā): ______ a = randperm(100); b = a(1:15) [asort ind] = sort(b(1,:)); b = b(:,ind); b
定西市波發(fā): ______ 5+round(5*rand(3,4))
定西市波發(fā): ______ >>?x=-pi:0.25:pi; y1=sin(x); y2=cos(x); hold?on >>??plot(x,y1,'ro') >>??plot(x,y2,'kp')
定西市波發(fā): ______ 可這樣:clc clear for n=2:10 x(1)=sqrt(5);a=x(1); for i=2:n x(i)=x(i-1)^2-2; a=a*x(i); b=a/(x(i)^2-2); end disp([n,b]) end 結(jié)果是:2.0000 0.95833.0000 0.99914.0000 1.00005.0000 1.00006.0000 1.00007.0000 1.00008.0000 1.00009.0000 1.000010.0000 1.0000 從而可證:當(dāng)n趨于無窮時(shí),極限為1
定西市波發(fā): ______ mathematica 數(shù)學(xué)實(shí)驗(yàn)!! 問個(gè)簡(jiǎn)單的問題 懸賞分:100 - 離問題結(jié)束還有 14 天23 小時(shí)有三個(gè)作圖的程序,如下: g[t_] := Plot[E^(-x^2/2)/Sqrt[2*Pi], {x, -t, t...
定西市波發(fā): ______ 1)對(duì)下面有關(guān)程序的功能的說法不正確的是( B )(A)該程序先對(duì)函數(shù)積分,后對(duì)積分的結(jié)果求導(dǎo); (B)該程序先對(duì)函數(shù)求導(dǎo),后對(duì)求導(dǎo)的結(jié)果積分;(C)該程序積分及求...
定西市波發(fā): ______ 在matlab中輸入一下命令:x=[-5000:100:5000]; y=[-5000:100:5000]; [X,Y]=meshgrid(x,y); z=30*(1 - (X^2+Y^2) / 10^6); surf(X,Y,z); 感覺畫出來很奇怪.因?yàn)?x^2+y^2) / 10^6是很小的數(shù).
定西市波發(fā): ______ 文件1jisi.m%Creat the function for jisi%Let x(1)=x, x(2)=y function dx=jisi(t,x,a,b,c) s=sqrt((c-x(1))^2+(a*t-x(2))^2); dx=[b*(c-x(1))/s;b*(a*t-x(2))/s]; 文件2seajisi.m clear,clf,shg%Set the definied time%ts=0:0.05:.5;% ts=0:0.1:1.6; n=length(ts); x0=[0 0];%...
定西市波發(fā): ______ MATLAB命令如下:y=inline(Dsolve('Dy=x+y','y(1)=2','x')) y(1.5)結(jié)果如下:y(x) = -x+exp(-1.0).*exp(x).*4.0-1.0 y(1.5)= 4.0949