Solve system of equations dependent on parameter
古いコメントを表示
I want to solve a system of linear equations in Matlab. The problem is that this system will have a non-unique solution in general ( so the Nullspace is non-trivial) and this system depends on a parameter beta(non-zero!), that I don't want to specify in advance. Hence, I want to have the solution in terms of this parameter. Is MATLAB able to do this? In what way would I need to enter the equations and the parameter and which command would I need to use so that Matlab gives me all solutions? Could anybody here give me an idea how I would need to do this? Thanks to all of you.
4 件のコメント
Matt J
2014 年 5 月 10 日
Hence, I want to have the solution in terms of this parameter
In the case where the solution is non-unique, what do you consider to be "the" solution? Also, is the system square?
Star Strider
2014 年 5 月 10 日
Do you have the Symbolic Math Toolbox?
Simon Becker
2014 年 5 月 10 日
Star Strider
2014 年 5 月 10 日
The Symbolic Toolbox might make it possible for you to simplify it more easily than manually.
採用された回答
その他の回答 (1 件)
John D'Errico
2014 年 5 月 10 日
You will need the symbolic toolbox for anything more than what you can do with pencil and paper. Easy enough with it though.
syms x y z beta
xyz = solve(2*x + beta*y + 2*beta*z - 2,-x + 3*y + 2*z - beta,x,y,z)
Warning: 2 equations in 3 variables. New variables might be introduced.
> In /Applications/MATLAB_R2014a.app/toolbox/symbolic/symbolic/symengine.p>symengine at 56
In mupadengine.mupadengine>mupadengine.evalin at 97
In mupadengine.mupadengine>mupadengine.feval at 150
In solve at 170
Warning: The solutions are parametrized by the symbols:
z1 = C_
> In solve at 190
xyz =
x: [1x1 sym]
y: [1x1 sym]
z: [1x1 sym]
The solution is in xyz, where each of x,y,z depend on the unknown parameter z1.
xyz.x
ans =
-(beta^2 + 4*z1*beta - 6)/(beta + 6)
xyz.y
ans =
(2*(beta - 2*z1 - beta*z1 + 1))/(beta + 6)
xyz.z
ans =
z1
カテゴリ
ヘルプ センター および File Exchange で Symbolic Math Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!