This post is not about a specific Mathematica problem but about to develop the best way to enter mathematical equations with subscripts and superscripts. I have a model of a large number of equations in which variables have subscripts, superscripts, and an index to create a set of equations using Table.
I wonder if anybody can suggest me the best way to enter model equations such as those in dynamic stochastic equilibrium models. Equations have all kinds of subscripts and superscripts, and I like to know the best way of writing such equations in Mathematica.
EDIT 1
Here is an example of a model I aim to solve. Using the suggested subscript and superscript notation to write a Mathematica code will be very complicated and there must be another way to code this model because Mathematica is supposed to be powerful solve much more complicated and larger system of non-linear equations.
As can be easily seen from this example model, I could log-linearize the model and redefine the variables and solve the system. My question is not about solving this model but entering the model equations in an efficient format using Mathematica. It is obvious to me that using long-subscript and superscripted variables is not the way forward. I am interested in a robust and stable coding of model of this kind.
I hope my question is clear.
Thanks.



y[a,b][c,d][x]could denote a function with 2 sup and 2 superscripts and one variable. – yarchik Jun 30 '19 at 07:58Formatto define print forms, e.g.Format[y[a_, b_][c_, d_][z_]] := Subsuperscript[y, Row[{a, b}], Row[{c, d}]][z]– kglr Jun 30 '19 at 09:05Codemodels of this kind efficiently, it will be a real contribution to usingMathematicafor modeling non-linear systems. – Tugrul Temel Jul 02 '19 at 05:38tis time and it can be thought as a system of difference equations. My question is not about solving the model but writing the system equations most efficiently usingMathematica.kandk subscript tis the same variable. No subscript means current timet. – Tugrul Temel Jul 02 '19 at 05:56Powerin the system? – xzczd Jul 02 '19 at 06:13Mathematicaan efficient programming language for solving a large system of dynamic non-linear equations with many superscripts and subscripts and powers...? – Tugrul Temel Jul 02 '19 at 06:45y[a,b][c,d][x]are too hard to read and check. – xzczd Jul 02 '19 at 06:57Mathematicacannot handle modeling of the complex non-linear equations system. Simply I cannot beleiv that is true. – Tugrul Temel Jul 02 '19 at 07:17Superscript[…]and pressCtrl+Shift+N. ) But they may not be convenient for certain subsequent processing. – xzczd Jul 02 '19 at 07:29RecurrenceTable) to solve your system, you will have to use Mathematica notation:k[t]notk_t. – Chris K Jul 02 '19 at 07:38Subscriptcan be used in this case actually:RecurrenceTable[{Subscript[a, n + 1] == 3 Subscript[a, n], Subscript[a, 1] == 7}, Subscript[a, n], {n, 1, 10}]– xzczd Jul 02 '19 at 07:46RecurrenceTablewas basically a discrete-time clone ofNDSolve. – Chris K Jul 02 '19 at 07:51NDSolve, too: `s = NDSolve[{D[Subscript[y, x], x] == Subscript[y, x] Cos[x + Subscript[y, x]], Subscript[y, 0] == 1}, Subscript[y, x], {x, 0, 30}];Plot[Evaluate[Subscript[y, x] /. s], {x, 0, 30}, PlotRange -> All]` :D
– xzczd Jul 02 '19 at 07:59RecurrenceTableactually looks nice. – Chris K Jul 02 '19 at 08:07Superscriptin an easy way, you'll find this post interesting: https://mathematica.stackexchange.com/a/57492/1871 – xzczd Jul 02 '19 at 08:28