# Tag Info

0

Symbolizing subscripts before running your code also works. << Notation Symbolize[ ParsedBoxWrapper[ SubscriptBox["_", "_"]]]

3

If I understood your requirements correctly, what you need is Defer, which is in the same class of functions as Hold and Unevaluated, but will evaluate if explicitly evaluated. Then, using Trott–Strzebonski: Clear@factorial factorial[n_Integer /; n >= 0] := With[{m = n - 1}, If[n >= 2, n*Defer@factorial[m], 1]] factorial[0] = 0; (In the lines ...

1

The only solution I could come up with was to use TraceScan to detect the first evaluation of the symbol, at which point I'd copy the symbol (including all its UpValues, DownValues, etc.) to a temporary place, unset the symbol to prevent further evaluation, and set $Pre to restore the symbol immediately prior to evaluating the next input (as well as ... 2 I can't provide working code because I don't have access to Mathematica now, but you can do this using MakeExpression. You can reverse engineer the required box structure by typing the InfixForm of Times[x,y] in an Input Cell. Select the input cell, and press Shift-Ctrl-E to see the underlying box structure for infix multiplication. You want the same ... 0 Actually$\partial _t f[t]$in Mathematica is interpreted as D[f[t],t] by default. You don't need to redefine it. Considering$\partial _t = D[f,t]\$ given by the OP is only an example of what the OP wants to do, I regard this question as a way to redefine the basic rules for the input of the expression. You can define the low-level input rules by using ...

0

When I read this question, it seems to be asking for set-delayed. For example, say we want to calculate D[f[t],t] over and over but want to give it a name like q. Then q := D[f[t], t] does this. If you don't have f defined then q Derivative[1][f][t] If f is defined, say f[t_] := t^2 q 2 t

2

With the notation package something like this is easy. I would never use this by myself, because IMO such sugar can easily introduce bugs and undesired behavior if one is not cautious. I will paste a screenshot so that you see how I used the Notation package, but first of all you have to load it: << Notation then you can use Testing it ...

3

Here is one way to rewrite your minimal example. The main thing I have changed (apart from removing surplus Dynamics) is to use downvalues of a single symbol to store the state of each sector. That is, instead of creating symbols sector1, sector2 etc by string manipulation, use sector[1], sector[2] and so on. The definitions of ring, cir, points1 and ...

1

Just a really quick hack that is nevertheless useful sometimes: LocateFunction[f_]:=(SystemOpen[Context[f]];NotebookFind[SelectedNotebook[],f//ToString]) If applicable, this opens the package relating to the symbol´s context and primes the search (use F3 to search for subsequent locations of the symbol).

2

My previous answer had heavy shortcomings and errors, so I took a deeper breath and figured out a more robust way. The problem with FindFile["context"] is twofold. First, it can only return the first file in a possibly long list of files adding to the same context. Second, it might not work on a context extracted from a symbol because symbol contexts might ...

Top 50 recent answers are included