Questions tagged [expression-construction]

The tag has no usage guidance.

82 questions
Filter by
Sorted by
Tagged with
68 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} ] ...
140 views

Using With[…] with a list specification as a variable

If you have some defined function, say f[a_, b_ c_, x], one can initialize this by using With[...] as ...
80 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 ...
31 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 ...
74 views

How to pass an expression as list elements for a Mathematica command

I'm trying to build a generic function that will calculate sums on different iterators. To simplify let consider: ...
17 views

Transform String to Expression [duplicate]

I have a variable postVector and another called CHKpostVector. Both are global variables. Only the variable ...
783 views

How to define constants in Mathematica like c1,c2,c3,…cn?

Manually defining the constants is tedious if the 'n' is large. how to do this?
59 views

Generate multivariate monomials with constraints

I'm trying to generate multivariate monomials in variables $p_1, \ldots, p_n$. Each monomial has either $p_i$ as a factor, otherwise $(1-p_i)$. I need to generate all monomials which have exactly $k$ ...
76 views

Creat a matrix with boundary condition

I would creat a symmetric matrix, but how can I set the boundary in Subscript? ...
164 views

Constructing expressions using Sum vs Array[… Plus] vs Plus@@Table[…]

For constructing a sum of terms which are symbolic, I noticed that in addition to ...
63 views

Translation of GLSL expression (2) [closed]

What's the most compact WL translation of this GLSL expression: length(max(vec2(x,y),s)) ?
54 views

Generate a system of linear differential equations from a coefficient matrix

I want to generate a system of linear equations that is stable. For that I generated random coefficients and divided the 10 by 10 matrix by the largest eigenvalue and set the diagonal to -1: ...
936 views

Is expression in Mathematica well defined?

According to Mathematica, everything is an expression. So an atom is also an expression. But in other parts of documentation, they say that an expression is of form ...
59 views

How to send Map[Plus[1, #] &, {1, 2, 3}] to Mathematica from C# via IKernelLink?

Here is a piece of my code ...
603 views

Replace element of a matrix with condition

consider a matrix $\left( \begin{array}{ccccc} 0 & 0 & 1 \\ 1 & 0 & 0 \\ 1 & 1 & 0 \\ \end{array}\right)$ How do I do a program that does these steps 1-Replace each ...
274 views

Generating a family of 0-1 matrices satisfying a particular property

I'm looking for an elegant way to generate the set of all possible matrices that satisfy the following properties: Each matrix has 9 rows and c columns, where 1<=c<=9. Each matrix has exactly ...
161 views

61 views

Misunderstanding of Replace code

I am looking for the right way to replace $\delta \, \, \text{by} \, \, 0.05 \, \, \, \beta \, \, \, \text{by} \, \, \, 1.77 \, \, \, \text{and} \, \, \, n \, \, \, \text{by} \, \, \, 12$ in this ...
111 views

I have a term 'Keff' in terms of 'W'. I need to write 'W' in terms of 'Keff'. Does Mathematica provide an option for that

I have read similar answers on this topic. I am still not able to execute my code.The code is as follows. ...
64 views

...
277 views

Defining a function to use in another function dependent on similar parameters [closed]

I want to define a variable dependent function which can be used to define another function which depends on the same variable and other variables. For example, I have a system where I define ...
63 views

Determine class of special function from algebraic constraints?

Consider vectors x_i in arbitrary dimension. Let's say I have an expression in six variables F[x_1,x_2,x_3][x_4,x_5,x_6], which ...
185 views

Find six vectors with rational entries under constraints?

Define six vectors v[i] with i=1,2,3...,6. Each v[i] is six dimensional and all entries in ...
424 views

How does one initialize large arrays in Mathematica with a structured format? [closed]

I want to create a 10 by 10 matrix that increases by 1 every unit across like: 1 2 3 4 5 6 7 8 9 10 11..... Is there a function that does this without having ...
194 views

How do I make a definition/function/method as I would in Java/MATLAB/Python

I've been trying to figure this out for a few hours now and it's driving me nuts. I am trying to confirm that, after transforming a Schrodinger equation, that the new wavefunctions satisfy the new ...
140 views

Is there a way to convert a string to a Table indicator? [closed]

I have a list like this: list = {"k1","k2"} I want to use the elements in the list as Table indicators: ...
What is the correct idiom for mapping the $0$ value in a modulo $n$ expression back to $n$. For example if I want to be sure that any integer value maps back to the index for a character in the ...