Search code examples
variablesmathwolfram-mathematica

make a Variable with Subscript in Mathematica


I'm very new to Mathematica and I need Mathematica to treat the Pmax in Subscript[P, max] = 12 "kW" as a single variable. That is because I have a lot more of these like Pmotor and P1, P2 and so on, I want to keep it clear and Simple. I tried Symbolize[ParsedBoxWrapper[SubscriptBox["P", "max"]]] but I don't get it to work properly... When I define Pmax the "P" is black but the "max" is still blue which I think means its a undefined Variable? can I tell Mathematica to treat Subscripted Variables as single variables?


Solution

  • Here is a demo using Notation. Once your notebook is set up as below it can be rerun in a fresh session quickly, all in one go (although the first line is then superfluous).

    enter image description here