2 Fix more typos
source | link

This might seem as a silly question, but is it feasible to use a mathematical expression as the name of a function?

For example, I'm studying the cross section of Compton scattering and there is a formula for the differential cross section, which is denoted as $\frac{d\sigma}{d\Omega}$. I'd like to express the latter as a function of energy E, angle θ and atomic number Z.

If I, naively, use $\frac{d\sigma}{d\Omega}[E\_, r\_, \theta\_] := \ldots$$\frac{d\sigma}{d\Omega}[Z\_, E\_, \theta\_] := \ldots$ I get the anticipated error:

SetDelayed::write : Tag Times in dσ/dΩ[Z_,e_E_,θ_] is Protected

Instead of the obvious workaround of using a name such as diffSection[E_[Z_,r_E_,θ_] := ... is there any other way ?

This might seem as a silly question, but is it feasible to use a mathematical expression as the name of a function?

For example, I'm studying the cross section of Compton scattering and there is a formula for the differential cross section, which is denoted as $\frac{d\sigma}{d\Omega}$. I'd like to express the latter as a function of energy E, angle θ and atomic number Z.

If I, naively, use $\frac{d\sigma}{d\Omega}[E\_, r\_, \theta\_] := \ldots$ I get the anticipated error:

SetDelayed::write : Tag Times in dσ/dΩ[Z_,e_,θ_] is Protected

Instead of the obvious workaround of using a name such as diffSection[E_,r_,θ_] := ... is there any other way ?

This might seem as a silly question, but is it feasible to use a mathematical expression as the name of a function?

For example, I'm studying the cross section of Compton scattering and there is a formula for the differential cross section, which is denoted as $\frac{d\sigma}{d\Omega}$. I'd like to express the latter as a function of energy E, angle θ and atomic number Z.

If I, naively, use $\frac{d\sigma}{d\Omega}[Z\_, E\_, \theta\_] := \ldots$ I get the anticipated error:

SetDelayed::write : Tag Times in dσ/dΩ[Z_,E_,θ_] is Protected

Instead of the obvious workaround of using a name such as diffSection[Z_,E_,θ_] := ... is there any other way ?

1
source | link

Is it possible to use a mathematical expression as function name?

This might seem as a silly question, but is it feasible to use a mathematical expression as the name of a function?

For example, I'm studying the cross section of Compton scattering and there is a formula for the differential cross section, which is denoted as $\frac{d\sigma}{d\Omega}$. I'd like to express the latter as a function of energy E, angle θ and atomic number Z.

If I, naively, use $\frac{d\sigma}{d\Omega}[E\_, r\_, \theta\_] := \ldots$ I get the anticipated error:

SetDelayed::write : Tag Times in dσ/dΩ[Z_,e_,θ_] is Protected

Instead of the obvious workaround of using a name such as diffSection[E_,r_,θ_] := ... is there any other way ?