6
$\begingroup$

I would like to use the I as a symbol for the electrical current. How can I redefine it, so it is not interpreted as the imaginary unity?

$\endgroup$
  • $\begingroup$ I thought you guys used J or j? $\endgroup$ – cormullion Jan 11 '13 at 13:47
  • 13
    $\begingroup$ I would strongly recommend against doing so since complex numbers are fundamental in Mathematica. Instead, you should use some other symbol, which you can easily make print as "I" if you so wish. $\endgroup$ – Oleksandr R. Jan 11 '13 at 13:49
  • $\begingroup$ Yes, we use j for the imaginary unit, and i and I for currents. But if I use I for a current, mathematica interprets it as the imaginary unity. So, how can I get Mathematica to interpret I as my own symbol instead of the imaginary Unit? $\endgroup$ – Diegos Jan 11 '13 at 13:54
  • 1
    $\begingroup$ @Diegos Do you find using \[CapitalIota] unacceptable? If you really want to use raw I I'll show you how, but using it is against my better judgement. $\endgroup$ – Mr.Wizard Jan 11 '13 at 13:55
  • $\begingroup$ Thank you, I will use capital iota $\endgroup$ – Diegos Jan 11 '13 at 14:17
20
$\begingroup$

The short answer is don't do it. Really, it's just not a good idea. You can use other symbols, such as \[CapitalIota] which looks almost exactly like I and is entered with EscIEsc.


If you're really determined you could substitute symbols using $PreRead and MakeBoxes but again I don't recommend it. For example:

MakeBoxes[I, _] := "\[ImaginaryJ]"

MakeBoxes[currentI, _] := "I"

$PreRead = # /. {"I" -> "currentI", "j" -> "I"} &;

Mathematica graphics

$\endgroup$
  • $\begingroup$ I understand your recomandation Oleksandr, but what sense does it make for Mathematica to permit using j as imaginary unity (typical in electrotechnics), if I is still reserved (so not accessible to symbolise currents)? Consequently using j as imaginary unity, should permit to use I as current $\endgroup$ – Diegos Jan 11 '13 at 13:57
  • $\begingroup$ @Diegos Mathematica isn't set up to make those kinds of changes, perhaps unfortunately. In the long run you will almost certainly want to find alternatives to what you are describing. $\endgroup$ – Mr.Wizard Jan 11 '13 at 13:59
  • 1
    $\begingroup$ Thank you anyways, I will use capital iota in this case. But it would certainly be an improvement, if in a future time one could replace predefined symbols for one's own computations: something like a "local redefinition bracket". $\endgroup$ – Diegos Jan 11 '13 at 14:09
  • $\begingroup$ @Diegos I added an example to my answer that may interest you. When you say "local redefinition bracket" do you mean something like Leonid used here? That is possible. $\endgroup$ – Mr.Wizard Jan 11 '13 at 14:14

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