Questions tagged [syntax]

Questions on correct (or improved) formulation of Mathematica code to achieve particular results. Use this tag (not "symbol") for questions about all those odd @@ /@ # & and ~ characters.

Filter by
Sorted by
Tagged with
2
votes
1answer
208 views

Evaluating functions out of expressions stored in list

I have a method that takes an integer $n$ and returns a list of variables vars = {x1,...,xn} and down the line a list of expressions in $x_{1},\cdots,x_{n}$ is ...
3
votes
1answer
62 views

Manipulate's LocalizeVariables and initial values of variables

Manipulate[a, {{a, 0.25, "label"}, 0, 1}, LocalizeVariables -> False] The initial value is then set to 0. On the other hand,...
1
vote
1answer
87 views

Why do I need a second Function in SortBy for Association?

I cannot understand why I need a second pure function when trying to sort Association by Key. Here is an example ...
0
votes
1answer
94 views

Compute inner product of using a double sum vector [closed]

I am struggling to create a vector in Mathematica to compute an inner product. The first vector whose elements are generated over the sum over $m$ is $$a = \sum_{m=0}^n\sum_{r=0}^m C_r a_m + \sum_{m=...
1
vote
0answers
105 views

List plot DataRange doesn't work [duplicate]

I have a set of coordinates for 0.4 < x < 5.6 and -10 < y < -4. When I use ListPlot, it plots the data in the ranges 0 < x < 5.6 and -10 < y < 0: I tried to use ...
1
vote
0answers
35 views

Trouble Plotting the maximum values of a function

First off, I apologize if this question is either incredibly obvious, or has been clearly asked and answered before. I've been searching the forum for a while, and the questions and answers thusfar ...
1
vote
1answer
125 views

Difference between f[x] and f as arguments of functions

I'm new to Mathematica and trying to better understand the syntax. In the documentation, the function Limit has the signature: ...
0
votes
1answer
191 views

Can I make Wolfram Alpha use a specific substitution when integrating? [closed]

Can I define the '$u = \dots$' for an integral? For example when I integrate $\frac{x^3}{\sqrt{6 - x^2}}$ with respect to $x$, the program automatically sets $u = x^2$, how can I change this so it ...
4
votes
0answers
129 views

Crossing a symbol like p, similar to HBAR

Is it possible in Mathematica to cross a symbol like p, similar to h-bar, used to denote the Planck constant? Picture in case of font problems: In case of h, we have HBAR, inputted as ESC-hb-ESC ...
6
votes
1answer
346 views

FindFaces in Mathematica 11.3

I just upgraded to Mathematica 11.3. but now my FindFaces instructions do not work anymore. I guess they changed the syntax in 11.3. Here is the original code: <...
0
votes
1answer
81 views

VariationalD of Nested Integral

I am trying to calculate the variational derivative with respect to f of the the nested integral below $$ \mathcal{J}\left[f(x) \right] = \int\limits_a^b \text{d} x \,e^{-f(x)} \int\limits_a^x \text{...
1
vote
2answers
147 views

How to add the legend for one point on the plot

Consider we want to add one point on the plot with some legend (see the question). How to add the separate legend for this point? How to add the legend for many points at the plot? Thank you.
5
votes
1answer
162 views

Counting a part of the speech in a sentence

I want to count a number of nouns in a sentence. For that, I'm using TextStructere but I don't know how to get tags of each word.
0
votes
0answers
30 views

Shorthand of Get[] [duplicate]

I thought that << expr was just a shorthand form of Get[expr]. I have now found that it clearly isn't. Namely it holds <...
1
vote
2answers
66 views

NSolve question [closed]

I thought I could do this: Define a list for variable s: s = {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9} Define a value ...
2
votes
1answer
101 views

HTTPRequest with multiple parameters

Want to use the API from this site. I'm having trouble using the same parameters. But I can do this with curl as shown on the site: ...
0
votes
0answers
43 views

Solve not working now, but did befoe [duplicate]

I did this Solve earlier and it worked. Why is it not working now? I tried other solves after this one, and did not work, also. I tried creating a new notebook, and it did not work there, also.
0
votes
3answers
43 views

Understanding Solve output [duplicate]

In Solve output for such as: Solve[r^2 - 6 r - 3 s^2 + 8 s Sqrt[r] == 0 && 0 < s < 1, r, Reals] Where in the documentation do I learn how to read ...
0
votes
1answer
24 views

Specify constant range in solve [closed]

For example in: Solve[r^2 - 4 r - s^2 - 4 s Sqrt[r] == 0, r, Reals] How can I specify a range for constant s, say between 0 and 1?
0
votes
0answers
48 views

RSolveValue syntax

Can't see anything wrong with this: sol4 = RSolveValue[{a[n + 1] - 1.2*a[n]*(1 - a[n]) == 0, a[1] ==0.1}, a[n], n] But I just get an echo from Mathematica
14
votes
2answers
481 views

a caveat in `Iconize`

We got this nice Iconize function to shrink code in notebook from version 11.3. But, I noticed a caveat in reverting an Iconize-...
1
vote
1answer
322 views

Solve Parametric Equation

This seems really easy and I'm probably just messing up on the syntax somewhere (I'm pretty new to Mathematica and I did pour through the Solve page trying to find an answer). I'm basically ...
2
votes
2answers
44 views

Defining a property of a variable that includes another function (sign)

I have a function that has a lot of sign functions that depend on a variable $\sigma$ and I know the property that $\sigma=1$ with probability $m$ and $-1$ with probability $1-m$. For example we can ...
0
votes
1answer
56 views

Please explain the following code containing Partition and Flatten

I'm a beginner in Mathematica. I have the following code: A = NestList[func, x0, n]; B = Partition[Flatten[{#, #, #, #} & /@ A][[2 ;; -2]], 2] I don't ...
16
votes
3answers
512 views

Language`* documentation project

Language` context is around for a long time. It is also heavily used (APIFunctions / FormFunctions dependencies deployment rely on it). It is undocumented and ...
0
votes
1answer
64 views

Shading between parametric equations using two functions [closed]

I have a two functions: ...
1
vote
1answer
74 views

How to get the sequence of members of nested lists?

I work with Mathematica 7. I have a list of lists, e.g.: l = { {{1,2}}, {{1,2},{2,3}} }. What is the Mathematica command to get the sequence (not the list) of ...
4
votes
1answer
77 views

URLSubmit handling of query parameters

Bug introduced in 11.2 or earlier and persisting through 11.3 [CASE:4007421] confirmed myApi = CloudDeploy@APIFunction[{"i" -> "Real"}, #i &]; Why does ...
1
vote
0answers
52 views

Syntax problem with ODE [closed]

The problem is I can clearly see that my input is not interpreted correctly. I write eq1 == x'[t] == - y/((x - t)^2 + y^2) and it is interpreted as the following ...
11
votes
1answer
176 views

Syntax information for pure functions

Mathematica's help on SyntaxInformation does not rule out syntax information for pure functions. SyntaxInformation[f] gives information used to generate syntax coloring and other advisories when f[…...
1
vote
1answer
75 views

Summation and production using hold

Let's take a sum and an example production $z_{1}=\sum_{k=1}^{3}(k!+(k+1)!)$ and $z_{2}=\prod_{k=1}^{3}(k!+(k+1)!)$ I wish to get in z1 a result like that $...
1
vote
2answers
102 views
11
votes
5answers
198 views

How can I translate a MathWorld statement into Mathematica syntax?

The Wolfram Mathworld has the following statement here: A derivative identity for expressing higher order modified Bessel functions in terms of $I_0(x)$ is $I_n(x)=T_n(d/(dx))I_0(x)$ However, I'm ...
8
votes
1answer
102 views

HTTPRequest syntax problem

Bug introduced in V11.0 and persisting through 11.3 [CASE:3981157] confirmed ...
1
vote
0answers
53 views

How to write down existence and uniqueness?

Mathematica has strong commands ForAlland Exists. However, I face difficulties, trying to express "existence and uniqueness" in ...
2
votes
0answers
46 views

How to add sugar for NetEncoder?

I'm tired of the extra level of list in NetEncoder and would like to get rid of it. The obvious thing fails: ...
5
votes
2answers
409 views

Why this syntax for renaming columns in datasets?

Form the documentation of Dataset: ...
0
votes
0answers
41 views

Simple assignment results in “Tag times in 1 Null is protected” error [duplicate]

I've read multiple topics about "Tag times is protected" error, but none of them were struggling with the same problem I am (or maybe I just didn't see it), so I'm asking for help since I'm unable to ...
0
votes
0answers
25 views

What does Solve output with # and & mean [duplicate]

I tried to solve a symbolic equation using Solve and in that I get expressions like #1^5 &, 1 what does this mean? I ...
2
votes
1answer
67 views

How to pass parameter to an API function?

I have a very simple question. I don't know how to pass multiple parameters to a web deployed APIFunction. I created a function: ...
8
votes
2answers
121 views

interpretation of <-> as UndirectedEdge in 11.2?

I have a package developed in earlier versions of Mathematica. In it, I use the notation x_ <-> y_ for undirected edges. When I use this package in 11.2, ...
4
votes
1answer
77 views

Merging unevaluated key/values

RuleDelayed is a supported key/value wrapper in Associations. What are general guidelines/idiomatic methods for working with ...
5
votes
2answers
233 views

Unexpected interpretation of a variable with subscripts

I am new to Mathematica and encounter the following problem. Define two variables g = 1 and Subscript[g, 1]= 1. If we execute $...
0
votes
1answer
96 views

Proper syntax for DSolve [closed]

Can I solve an ODE like xy dy = x^2 dx using DSolve or it should be in the following form ...
0
votes
1answer
68 views

What do the semicolons of the following bit of code do? [closed]

I am trying to understand code used to solve the 100 doors problem of rosettacode. The code in question is this ...
5
votes
2answers
141 views

How to construct infix operator with usual behavior?

I am trying to define my own infix operator and having problems with strung-together evaluation. The code below is a simple example. What I would like is to have the operator treated associatively, ...
1
vote
1answer
61 views

How do we input powers of indexed variables?

I have tried (a[i])^2 and alternatively (a^2)[i] Apparently both seem to work, but I was wondering what was the right way ...
1
vote
0answers
89 views

NIntegrate and definite Integrate give different results

Suppose the function f[x_,q_]=(15876 Exp[-0.527076 q^2] (x^2-2 x+2) SphericalBesselJ[1,5 q]^2 (q^2-8100 x^2))/(3425*Pi*q^5*x); I need to perform the integration ...
0
votes
1answer
691 views

Table with the logarithmic step

Suppose some function y[x]. I need to calculate the table of the value of this function with the logarithmic step of the coordinate, i.e., the operation which corresponds to the Mathematica's command ...
0
votes
1answer
89 views

Solve diophantine equation with constraints by counting and listing results [duplicate]

I need this code to list me and say the total solutions found ...