Unexpected behaviour of symbolic substitution
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Moritz Schulze
le 6 Sep 2017
Commenté : Moritz Schulze
le 11 Sep 2017
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 commentaire
John Chilleri
le 6 Sep 2017
I ran the above code and did not have the string '\\\nb(t)' in any variable (including ans) (R2015b).
Réponse acceptée
Nicolas Schmit
le 7 Sep 2017
\\\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.
Plus de réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!