how do i solve this non linear system?
1 回表示 (過去 30 日間)
古いコメントを表示
Hello, i must say that im not really good programing with matlab, i have this problem (i´ll explain it very fast):
1º I made a function that give me a vector made of real numbers i(1,6). 2º With that vector i, i would like to build and solve the next system:
f(1)= x(1)*x(2)*x(3)-i(1);
f(2)= x(1)*x(6)*x(3)-i(2);
f(3)= x(5)*x(2)*x(3)-i(3);
f(4)= x(5)*x(6)*x(3)-i(4);
f(5)= x(4)*x(2)*x(3)-i(5);
f(6)= x(4)*x(6)*x(3)-i(6);
For doing it, i tried the suggestion in this video:
And if i do it, giving constant values to i (instead of using the vector i), i can solve the system, but when i introduce i, matlab says: undefined variable i... and several more errors.
I hope that everybody can understand what i mean, and i would be really gratefull if you can help me with it. Thanks you very much!
2 件のコメント
採用された回答
Brian B
2013 年 3 月 4 日
編集済み: Brian B
2013 年 3 月 4 日
fsolve will only pass in a single argument, so i will be undefined. Assuming you want to solve this equation for fixed values of i (say i = ibar) you can use an anonymous function like this:
ibar = (1:6);
ecuaciones_con_i = @(x) ecuaciones(x, ibar);
Then pass ecuaciones_con_i to fsolve (without a @, since it is already a function handle):
xbar = fsolve(ecuaciones_con_i, x0);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Stability Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!