Questions tagged [syntax]

Questions on the correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and _ characters, which are keyboard shortcuts for the Wolfram Language named functions Apply, Map, Slot, Function, and Blank.

Filter by
Sorted by
Tagged with
0
votes
0answers
53 views

Importing n different pdf files and sending them to n different emails

How with MMA could I do to load from a folder called "jobs" "n" different pdf files and send them to "n" different "gmail" emails stored in a mails.txt file in ...
3
votes
0answers
53 views

Cheatsheet for the use of special characters syntax

My favorite mass-use of special characters is if I have an expression that is linear in all variables (call the variable list $L$) and it must be identical zero. Then I generate my equation system ...
5
votes
3answers
233 views

Simplify/Expand equation so that right side equals 0

Given an equation like $$x^2 + (x + 82)^2 = (x + 100)^2,$$ how do I type to make this into $$x^2-36x-3276=0\; ?\tag{1}$$ This almost does it ...
0
votes
2answers
49 views

How to create an operator which is a composition of a sequence of operators?

Suppose I have a sequence of operators $\partial_x$, $\partial_x^2$,..., $\partial_x^n$. I want to define an operator which is a composition of these $D_x^{(n)}=\partial_x\circ\partial_x^2\circ\cdot\...
5
votes
3answers
264 views

Evaluate equation for multiple values

This works fine; ((x - Sqrt[x])/(x + Sqrt[x]) - (x^2 - x)/36) /. x -> {1, 4, 8} but this does not ...
0
votes
1answer
44 views

Resizing the graph of a function with radicals , Why?

I am trying to graph this function $c(t)=\frac{2-\sqrt{t+3}}{1-t}$ using this code, to see its behavior at infinity. I need that in the vertical axis appears the value when $t->1$ (The graphs ...
3
votes
3answers
186 views

Filtering and Averaging

I have a large 3D matrix (Length = 300k) with duplicated values list={{1,1,a},{1,1,b},{1,2,c},{1,2,d},{1,3,e}...} If the first and second elements exactly match ...
8
votes
2answers
2k views

Is there a short way of writing (x==a || x==b || x==c)?

Something like x == (a|b|c) but that doesn't work.
0
votes
0answers
30 views

Input subscripts in Wolfram Cloud

I would like to input "rendered" subscripts in Wolfram Cloud, without having to verbosely type Subscript[a, b]. The local notebook shortcut is ...
0
votes
2answers
50 views

How to generate multiplication tables up to nxn?

I'm doing a simple multiplication table and I have this that I'm having a hard time with. I imagine that there must be a shorter way to do it, what I can't get is that it paints black the first column ...
0
votes
0answers
58 views

Is there a command to clean the entire front end? How?

I usually work with small pieces of code that result in numbers or text, and I clean up a little at a time to start again. I have searched here in the forum and in the mathematica help for something ...
0
votes
1answer
31 views

Simplifying cross product expressions II

This is related to Simplifying cross product expressions Consider the following: ...
0
votes
1answer
28 views

exclude terms from expansion

Suppose I define F1[R + a] = F1[R] + a D[F1[R],R] F2[R + 2 a] = F2[R] + 2 a D[F2[R],R] and I want to expand the square of their sum keeping only first order terms ...
-2
votes
1answer
78 views

Create table with squares and cubes and colors, how to produce the desired effect?

This should be very simple but I do not get as I want, I have tried, with print, grid, matrix but it doesn't work. Is for my niece, is to create a table of squares and cubes with big bold letters size ...
0
votes
0answers
32 views

can not replace when use ctrl+f

I have a very long output, therefore, I want to find and replace some repeated expressions with abbreviations using crtl +f in Mathematica. when I enter expressions, the mathematical can find it and ...
1
vote
1answer
55 views

Assiging Plot Range to Variables Works For X but Not Theta

Observe the following Mathematica code: ...
1
vote
1answer
52 views

How to define distributivity of CenterDot on bras and kets

I am working on a code for a coupled quantum harmonic oscillator and found myself in a hiccup when trying to evaluate the inner product of linear combinations of bras and kets. I have initially ...
0
votes
2answers
79 views

Use the good Syntax for my code [closed]

I have an error message with my below code but i don't know how to solve it. The problem come from this line k[d_, p_] = g1-[Ht] - p, and mathematica cannot execute ...
2
votes
1answer
48 views

Name of vertical pipe as in a|b

What is | called? Or is something different. In particular, I want to imitate ...
3
votes
2answers
90 views

Syntax error in NMaximize despite following official documentation

This is the code I'm trying to run: ...
0
votes
1answer
37 views

Syntax problem with `LocatorPane`

I am trying to create an image function: ...
2
votes
1answer
68 views

Getting a blank plot but don't see any problem [closed]

I have a problem. I'm trying to plot a function, but I keep getting a blank plot. This is function in InputForm: ...
0
votes
0answers
30 views

Assume some expression is false

I need to Reduce a complicated function and I want to exclude some conditions A and B. How do I assume that the expression A is ...
1
vote
1answer
53 views

Syntax for series with parameter [closed]

I am totally new to this - I cannot find how I can find a series limit that has also parameters, ie like $ a_n = \sqrt{(kn+2)} + \sqrt{(n)} , ~~k \in (0,+\infty )$ edit : cross-posted here https:/...
1
vote
0answers
34 views

What does the option 'Complexexpand' do in the Collect command? [closed]

I'm trying to re-write a long chain of commands I've received in pdf from Mathematica language to Maxima. I have this command: Collect[%, ε, ComplexExpand] I know ...
0
votes
2answers
31 views

Redefining the output of a function

ftn1 = Sin[s]^2 + 3 t^2 + u^5 3 t^2 + u^5 + sin[s]^2 ftn2[s_, t_, u_] := ftn1 ftn2[2, 1, 2] 3 t^2 + u^5 + Sin[s]^2 Hi ...
0
votes
0answers
23 views

Delete exit comment on the left, and increase menu letter size,Any way to solve the problem?

I have 2 problems, I need to delete the output comments of a special calculation and also see if there is a way to please the letters of the MMA menu, I have searched and read but it has not been ...
1
vote
2answers
58 views

Need help to plot Talbot's Contour (Newbie question)

I would like to plot these following parametrizations: $$s(\theta)=\sigma+\lambda s_{\nu}(\theta),\quad s_{\nu}(\theta)=\theta\cot(\theta) + i\nu\theta,\quad \theta\in(-\pi,\pi)$$ For more details, ...
0
votes
0answers
24 views

Clarifying the syntax of FindEquationalProof

Could someone clarify the definitions of "statement" and "expression" in the manual entry for FindEquationalProof? The best I can make of it is that an expression $E$ is either a ...
6
votes
2answers
186 views

How to visually present a variable of more than two letters as if it were one.How should I proceed?

I can't find a clear way to express my question but they say that a picture is worth a thousand words. Attached is an image of the desired result
1
vote
1answer
53 views

How can I find in Mathematica if my equation have solution or not on a given interval?

I'm new to Mathematica. I usually used Wolfram Alpha; however, since the equation that I'm working with is a long equation I need to use Mathematica. This is an example of the problem. So, I want to ...
3
votes
1answer
61 views

I'm struggling with the new syntax and with GeoGraphics

I've used Mathematica since the mid-90's, but I'm a beginner with some of the new syntax. The thing I'm trying to do is not only have a polar map of the Northern Hemisphere, ...
3
votes
1answer
101 views

Dynamic colour wheel

An extension of this question, I'd like to create multiple locators as per the example below: ...
1
vote
1answer
51 views

Checking list's elements function

Suppose I have a list of the form x={{a,b},{n1,n2,...} where n1,n2... are integers. I want to write a function that checks whether each of n1,n2, etc. is greater ...
1
vote
0answers
48 views

What does 2 in square bracket of function f[x_][2]? [closed]

There is a function which looks like f[x_][2]:= . What does 2 in square bracket mean?
3
votes
3answers
164 views

Multiple replacement/variables

In the, somewhat basic, code below I would like to learn how to replace the g2, g5 and g8 lines with a shorter command. I've made use of one parameter #1 but how do I make use of a second to vary the ....
0
votes
2answers
34 views

Define-Produce function from a loop?

Consider the following code: ...
1
vote
1answer
43 views

list elements as indices

I have the list R: ...
3
votes
3answers
502 views

How can I solve a system of linear equations? [closed]

How can I solve this system of equations in Mathematica? ...
0
votes
0answers
73 views

An issue with ParallelTable

Consider a function function[x_,y_,method_,distr_]:=NIntegrate[distr[x,y,z,t],{z,zmin[x,y],zmax[x,y]},{t,tmin[z,x,y],tmax[z,x,y]},Method->method] Here, ...
6
votes
1answer
83 views

Context Manipulation within Scoping Constructs

In the following the full context form of Test is not required as "Aaa`" is added to ...
0
votes
1answer
53 views

Parallel evaluation produces wrong result

Consider the following code: ...
1
vote
0answers
31 views

rule generalization-NCA algebra [duplicate]

How can I generalize the rule ...
0
votes
0answers
26 views

parallel computation fails

I have a code that evaluates matrix elements. It works correctly in sequential mode (one Kernel). It involves a custom function BariVi which is declared earlier and ...
1
vote
4answers
87 views

numerical values of coefficients

Consider the following output: x= (Sqrt[3/(2 (1 + Sqrt[11]/4))] b[0, π/3] - (1 + Sqrt[7/3]) b[(2 π)/3, (2 π)/3])/(4 Sqrt[2] 7^(1/4) Sqrt[1 + Sqrt[7]/4]) If i do <...
1
vote
1answer
47 views

Normal ordering of operators multiplied by scalars

I have the following code for normal ordering of two Boson operators $a(x),\,b(y)$: ...
1
vote
2answers
35 views

function changes upon condition

I have the function f[x_,y_]:=1/(Sin[x]+Sin[y]) which obviously becomes infinite for $x=\pi n, \;y=\pi n$ where $n\,\epsilon \, \mathbf{N}$. I want to give ...
2
votes
1answer
94 views

Empty graph when using parametric plot 3D

I want to plot a parametric 3D plot from the following ParametricNDSolve code: ...
1
vote
0answers
47 views

dot product of vectors with noncommutative elements

I came upon an interesting problem. Suppose you have three vectors $\psi=(a, b)$, $\phi=(c,d)$ such that their components do not commute: $ac\neq ca$, $bd \neq db$ etc. (in general the vectors may ...
1
vote
1answer
37 views

NonCommutativeMultiply syntax question

I define: ...

1
2 3 4 5
17