Questions tagged [expression-construction]
The expression-construction tag has no usage guidance.
108
questions
1
vote
2
answers
67
views
Replacements: using condition to restrict to parts that satisfy a Boolean expression
I need to replace all integers k in a list with {k} and tried:
EDITED: as a clarification: I mean all integer elements of a list, not all integers in the list, so in the following example, only 4 ...
2
votes
0
answers
34
views
Setting pieces of "matrices" - unwanted behavior
I am constructing matrices whose elements are lists themselves (of varying length), and am (re)setting the entries of these matrices using among others the "All" command. It seems that in ...
3
votes
2
answers
755
views
Creating of the Jordan Canonical Form
I have a matrix polynomial P(s) and the Jordan blocks of P(s) corresponding to every eigenvalue sj (j=1,...,k).
How can the Jordan Canonical Form be generated, i.e. the block diagonal matrix which has ...
1
vote
4
answers
319
views
Creating a block diagonal matrix when the submatrices in the diagonal are unknown
Let us assume that we have an integer $j$ $(j=1,2,...,k)$ and that for every $j$ is generated a matrix $P$ of dimensions $j$x$j$ . For example, if $j=1$ then $P=(-2)$.
If $j=2$ then
$$R = \begin{...
1
vote
2
answers
194
views
How to sort out/ extract positive and negative powers as list?
I have the following expression
expr = x1^d1 * x2^d2 * x3^d3;
where d1,d2,d3 can contain negative values/expression i.e. in ...
2
votes
1
answer
43
views
Formula: setting parameters vs replacement, different results?
I have a question that may sound stupid and have an easy answer - but I currently do not see it.
I have defined a function of four variables, $f[a,b,c,d]=...$, in what I think is correct Mathematica ...
0
votes
1
answer
51
views
Nest expressions of several arguments
I have the following function:
Q[r_, f_, s0_] := Q[r, f, s0] = F[r, s0] D[f[s0], s0]
By calling
Q[r, Q[r, f, s0], s0]
I ...
3
votes
0
answers
183
views
Computations with OptimizedExpressions without completely expanding them
I have to manipulate huge expressions that are rational functions of many (∼30) variables with integer coefficients. Storing them just as a ratio of two polynomials would be impractical. But they can ...
2
votes
0
answers
60
views
How to do an arbitrary expression growth in Mathematica?
I want to write a function that can be used to grow an expression from a seed or another existing expression based on part specification.
...
0
votes
1
answer
178
views
Help with printing table data
I am looking for the way of building a Table in a fast way. My true table evaluates huge functions with a system of differential equations . Let us for simplicity consider this:
...
0
votes
0
answers
50
views
How to generate nested expression?
I've found some related questions, but nothing has really helped me to do what I want to do.
Given a list of variables L and a parameter ...
1
vote
0
answers
107
views
Is there a good reason why `Slot[]` is not an atomic expression?
Here's a good reason why I think it should be,
Map[ If[AtomQ@#, #->"is an atom", #->"not an atom"]&
, {"hello",Range@3, # &}
, {-1}
]
...
8
votes
2
answers
265
views
Using `With[...]` with a list specification as a variable [duplicate]
If you have some defined function, say f[a_, b_ c_, x], one can initialize this by using With[...] as
...
1
vote
3
answers
86
views
Summation and product term expressed in Mathematica [duplicate]
I have the following term which I would like to express correctly in Mathematica:
$$\sum_{i=1}^{m}\frac{1}{\prod_{j=1,j\neq i}^m(\rho_i-\rho_j)}$$
This means that for $m=3$ for example you should ...
0
votes
1
answer
87
views
Displaying positions in expression tree
Can one display the position of each character in an expression tree? For instance: g[h[i, h], l] should be displayed using TreeForm where each character is ...