Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Why I get the error below with this code:


ρ = 1000;
g = 9.80665;
μ = 0.001;
p[x_, y_, z_, t_] = {x^2, Sqrt[y], -z, t^3};
f[x_, y_, z_, t_] = {-x^2, Sqrt[y]/2, z, t^2};

ρ Dt[v, t] = -Gradient[p] + μ Laplacian[v] + f


Set::write: "Tag Times in 1000\ Dt[v,t] is Protected."
share|improve this question
Are you trying to solve the Navier Stokes's equation? IF so, you should look at NDSolve... If you are just trying to get rid of the error, switching = with == in the final line helps... check ref/character/Equal in Mathematica Help. – drN Oct 10 '12 at 19:36
up vote 5 down vote accepted

Any time you try to execute a command of the form a*b=c, you'll generate this error:

enter image description here

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

(* Out: Times[a,b] *)

Furthermore, Times is protected.

(* 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.

share|improve this answer
Could you explain a bit more about the why? OP clearly has no clue why it happened, and if he merely takes this suggestion and removes the ρ to not make it of the form a*b=c, then he'll get a Tag Dt is Protected error... back to square 1 :) – R. M. Oct 10 '12 at 19:49

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.