# Questions tagged [expression-construction]

The tag has no usage guidance.

93 questions
Filter by
Sorted by
Tagged with
49 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 ...
32 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 ...
208 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 ...
114 views

50 views

### Producing the same output as Tuples[{0, 1}, 4]? [closed]

How can I use the functions decimalToBinary and padWithZeros to produce the same output as ...
299 views

### Handling multi-part equations

How are multi-part equations best handled? For example, take the torsion equation: We could express part of this equation like this: ...
87 views

### How to generate expression a + a1 e1 + a2 e2 + a12 e12 (subscripted)?

Sorry to ask this twice. I thought I could get away with just a0 + a1 e1 + a2 e2 + a3 e1 e2, but for my application I can't. I can generate a + a{1} e1 + a{2} e2 + a{12} e12 (subscripted), but that's ...
179 views

### How to make RawBoxes to be Expression

expr = First@ Level[Values@ WolframLanguageData["Plot", EntityProperty["WolframLanguageSymbol", "DocumentationExampleInputs"]], {3}] Plot[Sin[...
314 views

### How can a generate an expression like a0 + a1 e1 + a2 e2 +a3 e3 + a4 e1 e2 + a5 e1 e3 + a6 e2 e3?

I wish to input n and then generate an expression. It would look like the above when $n = 3$. I would like to use subscripts for ...
279 views

### a function to extract all subexpressions from an expression

Can somebody help me with a function f such that it extract all sub expressions (i.e. looking down the expression tree) from any expression given to it and also a ...
77 views

### Proper formulation of Do expression [closed]

I'm having trouble with the following code: ...
72 views

### How Defer[1+Evaluate[1+1] work?

I want to generate some expressions. The expression is not evaluated expect some parts will evaluate first. A simple example is Defer[1+1+1] and in this expression ...
57 views

...
262 views

### How to overload the operator “*” as KroneckerProduct [closed]

Can I use the expression below a * b * c * d for short to instead KroneckerProduct[a,b,c,d] automatically when a,b,c,d are ...
83 views

### Solving equations with change of variables is not working?

I want to express it in the form $$\text{expr=}\int_{-\infty}^{\infty}C_1\exp\left(-t^2\right)f(t)dt$$, i.e., the integrand is a bounded smooth function $f(t)$ times $\exp(-t^2)$ and the domain of ...
521 views

### How to convert a string into a structured list

I am trying to use an efficient notation for the timing of sounds that i can play in Mathematica. I would like to parse the string "{ab{c{de}}f}" as the list ...
59 views

### Is it the correct syntax with TransformedDistribution?

I define a function as f[x_] := ...;which is in fact the PDF of a random variable $X$. The PDF if given by $f_X(x)$. Let $Y$ is a random variable, which is the ...
475 views

### How to find the lowest power in multi-variable expression?

I am sorry for asking a similar question again. I asked How to find the lowest power of variable in expression? and I got a wonderful answer, but I have one more question for a multi-variable ...
885 views

### How to find the lowest power of variable in expression?

If I have expression like a1/x +a2/x^2 + a3/x^3 I want to return 1/x^3. In general case, ...
99 views

### Find most general 3-tensor under given constraint?

Consider A to be a general $2\times 2\times 2$ tensor: A = Table[ a[i,j,k], {i, 1, 2}, {j, 1, 2}, {k, 1, 2}]; pictorially one ...
276 views

### How to represent 1 as Symbol[“Integer”]

Maybe this is a boring question, but I cannot figure it out. Because every expression has a Head, and Head[1] is ...
810 views

### Convert string to function with an argument

I am trying to build an expression by first writing it out as a string and then using ToExpression to convert it to an expression. However, I cannot figure out how to make expression recognize x as an ...
1k views

### Create a list of all possible multivariate monomials of a certain order

Given variables x[i] for i=1,2,...,n I would like to create a list of all possible multivariate monomials of order ...
59 views

### What is the meaning of #, Root and & [duplicate]

I am new, but can any one tell me what is the meaning of formulas of x and y in the picture?
Motivation Here I've asked how to derive coefficients of numerical approximation of the linear transport equation $$u_t + u_x = 0, \tag{1}$$ on a fixed 3-point stencil automatically and here I've ...