ODE45 error: must return a column vector.

2 ビュー (過去 30 日間)
nashyshan
nashyshan 2015 年 6 月 5 日
コメント済み: James Tursa 2015 年 6 月 6 日
I am getting this error in my code. but in the MATLAB documentation there is an example ( Example 3) where the vectors are given as input but it works just fine. Why is that I get an error in my code?
Ca_ER = 10e-6;
c0 = 2e-6;
c1 = .185;
v1 = 6;
v2 = .11;
v3 = .09e6;
v4 = 1.2;
k3 = .1e-6;
a1 = 400e6;
a2 = 0.2e6;
a3 = 400e6;
a4 = 0.2e6;
a5 = 20e6;
b2 = .21;
d1 = 0.13e-6;
d2 = b2/a2;
d3 = 943.4e-9;
d4 = d1*d2/d3;
d5 = 82.34e-9;
IP= .5e-6;
Ca=.001e-6:.01e-6:1e-6;
num=Ca.*IP.*d2;
deno= (Ca.*IP+ IP*d2+d1*d2+Ca.*d3).*(Ca+d5);
p_open=( num./deno).^3; %this is the vector input
dc=@(t,c) (c1.*((v1.*p_open)+v2).*(Ca_ER-c))-((v3.*(c.^2))/(c.^2+(k3^2)));
[t,c]=ode45(dc,linspace(0, 100, 1000),.19e-6);
plot(t,c);

採用された回答

James Tursa
James Tursa 2015 年 6 月 5 日
For a start, try changing to column vectors. E.g.,
Ca = (.001e-6:.01e-6:1e-6)';
  6 件のコメント
nashyshan
nashyshan 2015 年 6 月 6 日
編集済み: nashyshan 2015 年 6 月 6 日
Okay! I will check and get back. Thank you so much for the valuable inputs.
James Tursa
James Tursa 2015 年 6 月 6 日
We don't know what problem you are trying to solve. Are you trying to solve a scalar 1st order differential equation? A scalar higher order differential equation? A vector DE? Or what? Tell us what the DE or system of DE's is.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeProgramming についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by