Solving a symbolic equation system with degrees of freedom

廉价感情. 提交于 2021-02-11 16:57:27

问题


I'm trying to solve a symbolic system with degrees of freedom. It supposes to use parameters, but it fails to handle something simple such as:

syms x1 x2 x3 x4 x5 x6 x7 x8 real

con = [
    x1 + x2 + x3 + x4 + x5 + x6 + x7 + x8 == 1080
    x2 + x3 == 0
    x6 + x7 == 0
    ];

s = solve(con, 'ReturnConditions', 1 ,'PrincipalValue', true)

The output:

Warning: Unable to find explicit solution. For options, see help. 
> In solve (line 317)
  In testm (line 10)
  In run (line 91) 
s = 
  struct with fields:

            x1: [0×1 sym]
            x2: [0×1 sym]
            x3: [0×1 sym]
    parameters: [1×0 sym]
    conditions: [0×1 sym]

Lucien's solution applies to this as well:

Solving a symbolic equation with integer variables


回答1:


Perhaps it can help you.

s = solve(con, [x1 x2 x3 x4 x5 x6 x7 x8], 'ReturnConditions', 1 ,'PrincipalValue', true);



来源:https://stackoverflow.com/questions/65819088/solving-a-symbolic-equation-system-with-degrees-of-freedom

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!