Any time you try to execute a command of the form a*b=c
, you'll generate this error:
Of course, that's exactly what you've done in your last line:
ρ Dt[v, t] = -Gradient[p] + μ Laplacian[v] + f
We can see the issue more clearly if we examine the left side of the equation in FullForm
FullForm[a*b]
(* Out: Times[a,b] *)
Furthermore, Times
is protected.
Attributes[Times]
(* Out: {Flat, Listable, NumericFunction, OneIdentity, Orderless, Protected} *)
Thus, you're trying to set the value of a protected symbol. As rm-rf points out, it's not just about removing the ρ
, as otherwise you're trying to set the value of Dt
.
Perhaps more to the point - if you want to represent an equation that you want to solve, you should type:
ρ Dt[v, t] == -Gradient[p] + μ Laplacian[v] + f
Note the double equals sign. This tests for equality, rather than setting a value - which is what you generally want when solving an equation.
NDSolve
... If you are just trying to get rid of the error, switching=
with==
in the final line helps... checkref/character/Equal
in Mathematica Help. $\endgroup$