| 24小時(shí)熱門(mén)版塊排行榜 |
| 5 | 1/1 | 返回列表 |
| 查看: 812 | 回復(fù): 4 | |||
| 當(dāng)前只顯示滿(mǎn)足指定條件的回帖,點(diǎn)擊這里查看本話(huà)題的所有回帖 | |||
maggie0211新蟲(chóng) (小有名氣)
|
[求助]
matlab中一點(diǎn)小問(wèn)題
|
||
|
程序如下: 第一個(gè): function dx=ax3(t,x) dx=[x(2) -48.6*x(1)-1.26*x(2)+48.6*x(3)+21.6*sin(x(2)) 10*x(4) 1.95*x(1)-1.95*x(3)-0.333*sin(x(1)) x(6)+5.1734*(x(1)-x(5))-5.0069*(x(2)-x(6)) -48.6*x(5)-1.26*x(6)+48.6*x(7)+21.6*sin(x(6))-4.3407*(x(1)-x(5)) -4.1015*(x(2)-x(6)) 10*x(8) 1.95*x(5)-1.95*x(7)-0.333*sin(x(5))+1.0759*(x(1)-x(5))+1.0166*(x(2)-x(6))] 第二個(gè): tspan=[0 10]; x0=[1 2 1 0 1 2 0 0.5]'; [t,x]=ode15s(@ax3,tspan,x0); e1=x(:,1)-x(:,5); e2=x(:,2)-x(:,6); e3=x(:,3)-x(:,7); e4=x(:,4)-x(:,8); plot(t,x(:,1),'r*',t,x(:,5),'o') xlabel('t') legend('狀態(tài)量x_{1}','狀態(tài)量x_{1}的估計(jì)') figure plot(t,e1) xlabel('t'); ylabel('狀態(tài)量x_{1}與其估計(jì)量的誤差e_{1}') figure plot(t,x(:,2),'r*',t,x(:,6),'o') xlabel('t') legend('狀態(tài)量x_{2}','狀態(tài)量x_{2}的估計(jì)') figure plot(t,e2) xlabel('t') ylabel('狀態(tài)量x_{2}與其估計(jì)量的誤差e_{2}') figure plot(t,x(:,3),'r*',t,x(:,7),'o') xlabel('t') legend('狀態(tài)量x_{3}','狀態(tài)量x_{3}的估計(jì)') figure plot(t,e3) xlabel('t'); ylabel('狀態(tài)量x_{3}與其估計(jì)量的誤差e_{3}') figure plot(t,x(:,4),'r*',t,x(:,8),'o') xlabel('t') legend('狀態(tài)量x_{4}','狀態(tài)量x_{4}的估計(jì)') figure plot(t,e4) xlabel('t'); ylabel('狀態(tài)量x_{4}與其估計(jì)量的誤差e_{4}') 執(zhí)行第二個(gè)程序后,出現(xiàn)如下錯(cuò)誤: ??? Error using ==> funfun\private\odearguments Solving AX3 requires an initial condition vector of length 4. Error in ==> ode15s at 228 [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ... 應(yīng)該怎么改? |
新蟲(chóng) (小有名氣)
主管區(qū)長(zhǎng) (職業(yè)作家)
![]() |
專(zhuān)家經(jīng)驗(yàn): +1059 |

木蟲(chóng) (正式寫(xiě)手)
新蟲(chóng) (初入文壇)
|
function xprim= xprim1(t,x) global a b c d e f q w r v s g xprim =[(e*s+a)*x(1)+(e*g+b)*x(2)+q*0.3*sin(t)+w*0.1*cos(2*t);(f*s+c)*x(1)+(f*g+d)*x(2)+r*0.3*sin(t)+v*0.1*cos(2*t)]; clear;clc; global a b c d e f q w r v s g a = 0; b = 1; c = 4; d = 0; e = 0; f = 1; q = 1; w = 0; r = 0; v = 1; s = 1; g = 3; [t,x] = ode45('xprim1',[0 9],[0.4;0.2]); plot(t,x) 出錯(cuò) ode45 (line 113) [neq, tspan, ntspan, next, t0, tfinal, tdir, y0, f0, odeArgs, odeFcn, ... 出錯(cuò) event_trigger_ftb (line 10) [t,x] = ode45('xprim1',[0 9],[0.4;0.2]); 您好,請(qǐng)問(wèn)這個(gè)是怎么回事呀? |
| 最具人氣熱帖推薦 [查看全部] | 作者 | 回/看 | 最后發(fā)表 | |
|---|---|---|---|---|
|
[考研] 296材料專(zhuān)碩求調(diào)劑 +12 | 202451007219 2026-04-02 | 13/650 |
|
|---|---|---|---|---|
|
[考研] 一志愿上海海洋大學(xué)083200食品學(xué)碩,求調(diào)劑,接受其他專(zhuān)業(yè) +6 | what張 2026-04-01 | 7/350 |
|
|
[考研] 301求調(diào)劑 +4 | 細(xì)胞相關(guān)蛋白 2026-04-02 | 8/400 |
|
|
[考研] 071000生物學(xué)調(diào)劑 +6 | 知昭蔓 2026-04-02 | 6/300 |
|
|
[考研] 一志愿鄭大材料工程290求調(diào)劑 +20 | Youth_ 2026-03-30 | 20/1000 |
|
|
[考研] 一志愿北京科技大學(xué)085601材料工程英一數(shù)二初試總分335求調(diào)劑 +8 | 雙馬尾痞老板2 2026-04-02 | 9/450 |
|
|
[考研] 286分調(diào)劑 +20 | Faune 2026-03-30 | 22/1100 |
|
|
[考研] 求調(diào)劑推薦 +3 | 南山南@ 2026-04-01 | 3/150 |
|
|
[考研]
|
廈大化工 2026-04-01 | 5/250 |
|
|
[考研] 材料調(diào)劑 +12 | 一樣YWY 2026-04-01 | 12/600 |
|
|
[考博] 26年申博 +3 | staryer 2026-03-30 | 4/200 |
|
|
[考研] 309求調(diào)劑 +19 | 誰(shuí)不是少年 2026-03-29 | 19/950 |
|
|
[考研] 一志愿華南師范361分,化學(xué)求調(diào)劑 +4 | Nicole88888 2026-04-01 | 4/200 |
|
|
[考研] 339求調(diào)劑 +5 | zjjkt 2026-03-31 | 5/250 |
|
|
[考研] 材料工程085601數(shù)二英一335求調(diào)劑 +5 | 雙馬尾痞老板2 2026-03-31 | 5/250 |
|
|
[考研] 調(diào)劑求院校招收 +7 | 鶴鯨鴿 2026-03-28 | 7/350 |
|
|
[考研] 348求調(diào)劑 +6 | 小懶蟲(chóng)不懶了 2026-03-28 | 6/300 |
|
|
[考研] 求調(diào)劑 +7 | 爭(zhēng)取九點(diǎn)睡 2026-03-28 | 8/400 |
|
|
[考研] 一志愿上海理工能源動(dòng)力(085800)310分求調(diào)劑 +3 | zhangmingc 2026-03-27 | 4/200 |
|
|
[考研] 一志愿吉大071010,316分求調(diào)劑 +3 | xgbiknn 2026-03-27 | 3/150 |
|