Errors during solving equations - sym/subsindex (line 796) and sym/subsref (line 841)
显示 更早的评论
Hello, I need to solve the equations, in order to find Cadt and Cbdt. My code is:
syms Cadt Cat Cbdt Cbt dt Maa Mab Mbb k ga gb KA KB KC
eqn1 = (Cadt-Cat)/dt == Maa*(-k^2*ga - 2*(KA+KC)*k^4*Cadt - 2*KC*k^4*Cbdt) + Mab(-k^2*gb - 2*KC*k^4*Cadt - 2*(KB+KC)*k^4*Cbdt);
eqn2 = (Cbdt-Cbt)/dt == Mab*(-k^2*ga - 2*(KA+KC)*k^4*Cadt - 2*KC*k^4*Cbdt) + Mbb(-k^2*gb - 2*KC*k^4*Cadt - 2*(KB+KC)*k^4*Cbdt);
sol = solve([eqn1, eqn2], [Cadt, Cbdt]);
Sol1 = sol.Cadt
Sol2 = sol.Cbdt
However, I am getting theses errors:
Error using sym/subsindex (line 796)
Invalid indexing or function definition. When defining a function, ensure that the arguments are symbolic variables and the body of the function is a SYM expression. When indexing, the
input must be numeric, logical, or ':'.
Error in sym/subsref (line 841)
R_tilde = builtin('subsref',L_tilde,Idx);
Error in Semi_implicit_conc_eqn_solve (line 8)
eqn1 = (Cadt-Cat)/dt == Maa*(-k^2*ga - 2*(KA+KC)*k^4*Cadt - 2*KC*k^4*Cbdt) + Mab(-k^2*gb - 2*KC*k^4*Cadt - 2*(KB+KC)*k^4*Cbdt);
It would be a great assistance if you let me know what went wrong in this code. Thanks a lot!
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Symbolic Math Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!