symbolic-math

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]

Solving a symbolic equation system with degrees of freedom

半腔热情 提交于 2021-02-11 16:55:07
问题 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]

Solving a symbolic equation with integer variables

时光毁灭记忆、已成空白 提交于 2021-02-11 12:14:35
问题 Why does the following return an empty solution? syms a b positive integer s = solve(a + b == 5, 'ReturnConditions', 1) This does work: s = solve([a + b <= 5, a + b >= 5], 'ReturnConditions', 1) It seems that I had a problem in general solving a system with degrees of freedom: Solving a symbolic equation system with degrees of freedom The solution over there applies here: s = solve(a + b == 5, [a b], 'ReturnConditions', 1) 来源: https://stackoverflow.com/questions/65748247/solving-a-symbolic

passing a vector to a matlabfunction WITHOUT num2cell

限于喜欢 提交于 2021-01-27 21:03:15
问题 For each of my simulation runs I generate a number of m-files using the matlabFunction command. these m-files are used to generate artificial potential fields. The number of (scalar) inputs may vary among different runs (due to the number of robots I am simulating), but stay constant during the run itself. Because each robot has its own potential field function I have to prepare input vectors for each of these robots. I am currently doing this in the following manner for each robot i: Tvec =

Symbolic toolbox trims final “dot” from symbol name

妖精的绣舞 提交于 2021-01-27 16:42:38
问题 I encountered weird behaviour of the symbolic toolbox of octave, where a symbolic variable ending in -dot looses the final dot -suffix. pkg load symbolic; clear, clc; syms xxxdot syms % Symbolic variables in current scope: xxxdot xxxdot % xxxdot = (sym) xxx I only stumbled upon it, because I had the same variable with and without the suffix -dot . But note that if another symbolic variable is defined without the final -dot , Octave symbolic will not merge them. So the math is still correct:

Symbolic toolbox trims final “dot” from symbol name

♀尐吖头ヾ 提交于 2021-01-27 16:31:34
问题 I encountered weird behaviour of the symbolic toolbox of octave, where a symbolic variable ending in -dot looses the final dot -suffix. pkg load symbolic; clear, clc; syms xxxdot syms % Symbolic variables in current scope: xxxdot xxxdot % xxxdot = (sym) xxx I only stumbled upon it, because I had the same variable with and without the suffix -dot . But note that if another symbolic variable is defined without the final -dot , Octave symbolic will not merge them. So the math is still correct:

Matlab - Solving a system of 2 matricial equations : building each element of matrix solution

时光怂恿深爱的人放手 提交于 2020-12-15 01:51:37
问题 With Matlab, I have a matrix solution to find from 2 matricial equations (size matrix is 7x7). Here the 2 equations to solve with " a " and " b " are the unknow matrices and where F1, F2, P1 and P2, D, D2, D are known. Solving "a" and "b" would allow me to build a new matrix P = a . P1 + b . P2 . (remark : D matrix is equal to : D = a.a.D1 + b.b.D2 with D1and D2 diagonal matrices) : a.a + a.P1.b.P2^T + b.P2.a.P1^T + b.b - Id = 0 (equation 1) F1.a.P1 + F1.b.P2 + F2.a.P1 + F2.b.P2 − (a.P1 + b

Matlab - Solving a system of 2 matricial equations : building each element of matrix solution

女生的网名这么多〃 提交于 2020-12-15 01:50:32
问题 With Matlab, I have a matrix solution to find from 2 matricial equations (size matrix is 7x7). Here the 2 equations to solve with " a " and " b " are the unknow matrices and where F1, F2, P1 and P2, D, D2, D are known. Solving "a" and "b" would allow me to build a new matrix P = a . P1 + b . P2 . (remark : D matrix is equal to : D = a.a.D1 + b.b.D2 with D1and D2 diagonal matrices) : a.a + a.P1.b.P2^T + b.P2.a.P1^T + b.b - Id = 0 (equation 1) F1.a.P1 + F1.b.P2 + F2.a.P1 + F2.b.P2 − (a.P1 + b

Matlab - Solving a system of 2 matricial equations : building each element of matrix solution

旧城冷巷雨未停 提交于 2020-12-15 01:46:15
问题 With Matlab, I have a matrix solution to find from 2 matricial equations (size matrix is 7x7). Here the 2 equations to solve with " a " and " b " are the unknow matrices and where F1, F2, P1 and P2, D, D2, D are known. Solving "a" and "b" would allow me to build a new matrix P = a . P1 + b . P2 . (remark : D matrix is equal to : D = a.a.D1 + b.b.D2 with D1and D2 diagonal matrices) : a.a + a.P1.b.P2^T + b.P2.a.P1^T + b.b - Id = 0 (equation 1) F1.a.P1 + F1.b.P2 + F2.a.P1 + F2.b.P2 − (a.P1 + b

Matlab - Solving a system of 2 matricial equations : building each element of matrix solution

丶灬走出姿态 提交于 2020-12-15 01:45:43
问题 With Matlab, I have a matrix solution to find from 2 matricial equations (size matrix is 7x7). Here the 2 equations to solve with " a " and " b " are the unknow matrices and where F1, F2, P1 and P2, D, D2, D are known. Solving "a" and "b" would allow me to build a new matrix P = a . P1 + b . P2 . (remark : D matrix is equal to : D = a.a.D1 + b.b.D2 with D1and D2 diagonal matrices) : a.a + a.P1.b.P2^T + b.P2.a.P1^T + b.b - Id = 0 (equation 1) F1.a.P1 + F1.b.P2 + F2.a.P1 + F2.b.P2 − (a.P1 + b