A possible bug in solver?
古いコメントを表示
Either this is a bug in 'solver' or I'm missing something.
This script should generate two identical figures, however the second part ignores an entire set of solutions.
clear all;
%%System parameters
D = 0.072;
phi = 20;
B = 8;
Beta = 0.3;
static = [];
syms x2 u
for x1=0.1:0.01:0.82
res = solve(0== -x1 + D*(1 - x1)*exp(x2/(1+x2/phi)), 0== -x2 + B*D*(1 - x1)*exp(x2/(1+x2/phi)) + Beta*(u - x2));
static = [static; vpa(res.u)];
end
plot(static,0.1:0.01:0.82)
hold all;
clear all;
%%System parameters
D = 0.072;
phi = 20;
B = 8;
Beta = 0.3;
static = [];
syms x2 x1
for u=-1:0.01:1
res = solve(0== -x1 + D*(1 - x1)*exp(x2/(1+x2/phi)), 0== -x2 + B*D*(1 - x1)*exp(x2/(1+x2/phi)) + Beta*(u - x2));
static = [static; vpa(res.x1)];
end
plot(-1:0.01:1,static)
xlabel('u')
ylabel('x1')
4 件のコメント
Azzi Abdelmalek
2012 年 12 月 6 日
Why would you find the same result with different codes?
Daniel
2012 年 12 月 6 日
Azzi Abdelmalek
2012 年 12 月 6 日
But x1 and u are different in your expression
Daniel
2012 年 12 月 6 日
採用された回答
その他の回答 (1 件)
Azzi Abdelmalek
2012 年 12 月 6 日
0 投票
In your above comment, x1 and x2 have the same effect in the equation. In your equations u appears once while x1 appears three times, then they have'nt the same effect, why are you expecting to find the same result?
3 件のコメント
Azzi Abdelmalek
2012 年 12 月 6 日
Why do you fix x1 to i? and not 4 or ....
It's not what you did in your program, what you did is
for x1=0.1:0.01:0.82
and
for u=-1:0.01:1
カテゴリ
ヘルプ センター および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!