Unexpected behaviour of symbolic substitution

1 次查看(过去 30 天)
Hey, If the code attached below is executed, the result shows '\\\nb(t)' somewhere in the expression. I do not know why this happens or what that could mean. The code is not a mimimum example, since this happens only in this case. I am making use of symbolic substitutions in many occations and so far I have not come across problems. The expressions, that are defined (i.e. 'g' and 'h(t)'), seem to be fine (for example when viewed in a MuPAD notebook). Looking forward to any help! Moritz
syms a(t) b(t) c(t) h(t) u1(t) k1 k2 k3
g = diff(a(t), t) == u1(t) + (b(t)*diff(c(t), t, t) - diff(b(t), t)*diff(c(t), t) + k3*b(t)^2*diff(c(t), t))/(k3*b(t)^2) - k1*a(t)*b(t)^2;
h(t) = (2*diff(b(t), t)^2*diff(c(t), t) + b(t)^2*diff(c(t), t, t, t) - 2*b(t)*diff(b(t), t)*diff(c(t), t, t) - b(t)*diff(c(t), t)*diff(b(t), t, t) + k2*b(t)^2*diff(c(t), t, t) + k3*b(t)^3*diff(c(t), t, t) + k2*k3*b(t)^3*diff(c(t), t) - k2*b(t)*diff(b(t), t)*diff(c(t), t))/(k1*k2*k3*b(t)^5);
subs(g, a(t), h(t));
  1 个评论
John Chilleri
John Chilleri 2017-9-6
I ran the above code and did not have the string '\\\nb(t)' in any variable (including ans) (R2015b).

请先登录,再进行评论。

采纳的回答

Nicolas Schmit
Nicolas Schmit 2017-9-7
\\\n is just a line break. This happens when the formula being displayed is very long. This is just a command to tell a text editor to display the formula on several lines, should you export the results to a text file. This is just a display artefact that you can ignore, it has no impact on the mathematical meaning of your equation.

更多回答(0 个)

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by