Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

-1
votes
3answers
43 views

How to remove a line from the ListPlot?

Consider the following ListPlot: ...
0
votes
3answers
74 views

Finding the integer terms of a binomial expansion [on hold]

What functions can I use to find how many integer terms the following expression has? $$\left (\sqrt[19]{19}+\sqrt[95]{95}\right )^{1995}$$ Edit 1 In the development of that binomial, at some point ...
0
votes
0answers
41 views

magic square with prime numbers of any order

how could you create a script in Mathematica that generates magic squares of order n, but that the numbers that form the square are all primes I've looked at what's in other answers but I can not ...
3
votes
1answer
122 views

Using “?” to get function details has changed?

I'm running Mathematica 11.0 (I should upgrade, I know) and it used to be that if I entered something like ?Integrate, Mathematica would output basically a mini ...
0
votes
0answers
36 views

Define a new Front End Syntax for Function Argument Checking & Debugging

In this question I asked a basic question about how to check argument types such that there was useful output from the front end when calling functions. Based on elements of the nice answer by @j-m-is-...
3
votes
2answers
115 views
5
votes
1answer
40 views

how to comfortably concatenate substitutions

Often I have to do perform a succession of substitutions on some expression, and in a notebook the way I know to do that is ...
3
votes
1answer
71 views

Use of semi-colons in If[]

This is the code in Mathematica: h[x_] := (If[x > 5, Return[big]]; t = x^3; Return[t - 7]) I fully understand what the code does, with ...
4
votes
1answer
124 views

Solve PDEs with finite difference scheme by modifying NDSolve-based solver

Motivation As discussed here, NDSolve uses different difference orders for various spatial derivatives and the implicit design could cause trouble in certain cases....
1
vote
1answer
25 views

Replace function arguments multiple times?

I have a very large function f[x_,y_,z_] and it's too cumbersome to type it directly. So I wish to break the definition and use (...
1
vote
1answer
57 views

ImplicitRegion evaluates the region incorrectly when it must be empty

Consider the following implicit region: ...
1
vote
0answers
35 views

How do decrease uncertainty of Monte-Carlo integration?

I have some function of many arguments and need to integrate it over the region given by the products of Heaviside theta functions. Namely, I write, say, ...
3
votes
1answer
63 views

Own markers on the axis of the plot

Could you please tell me how to make the ticks on the axes not in the numeric form (say, 0, 0.1, 0.2) but in symbolic form (say, "zero", "zero point one" and so on), in the plot command?
3
votes
1answer
104 views

Force a function to report argument type mismatches

As a relative newcomer to Mathematica, I am still frequently caught out by coding errors that, at least by default, MMA does not indicate to the front end, in particular when I define a function and ...
1
vote
1answer
62 views

Evaluating an expression on one line

Is it possible to evaluate an expresson on one line? I have a linear algebra problem to re-write the straight line $-x=1-3y=-1-2z$ to a 'vector form'; ...
1
vote
0answers
41 views

Mathematica is acting as though d is a variable when it isn't [closed]

I have the Airy Stress Function ϕ[x_, y_] = 1/120 (P/(d^3))[5*(x^3 - x*L^2)*(y + d)^2*(y - 2*d) - 3*x*y*(y^2 - d^2)^2] That I need to take 2nd and 4th ...
0
votes
0answers
49 views

FullSimplify of Dirac Delta Function failed

I have t1 and t2 whose difference should be 0. But ...
3
votes
1answer
74 views

Application example of RuleDelayed in options

In this question: Options which require RuleDelayed , an example was given, where the an option has to be given as a RuleDelayed: ...
0
votes
0answers
40 views

How to use === with condition?

I have two expressions, and they are same when k is positive and x is non-zero real number. Below code gives me ...
8
votes
0answers
82 views

What is the philosophy behind \[Rule] (a.k.a. `->`) for assigning options?

Today I was banging my head against my desk when I realized that the problem I was experiencing was due to having typed ImageSize[Large] instead of ...
1
vote
1answer
77 views

What resources can I use to become familiar with high level syntax?

I was reading a question about dropping higher order terms and realized that I have a serous gap in knowledge when it comes to the finer points of mathematica computational programming. Are there any ...
1
vote
0answers
71 views

Combine two options lists [duplicate]

I have 2 functions Top and Bottom that each have an options list parameter. ...
2
votes
1answer
94 views

Joined -> True works incorrectly for the given data set

Consider a set of data ...
0
votes
0answers
30 views

Hyperbola ContourPlot missing input

I'm trying to plot a hyperbola using ContourPlot, but I can't understand what I'm missing on its call. The error says it's incorrect syntax, although I can't see any errors. ...
0
votes
1answer
45 views

If without else [closed]

The syntax for If is: If[condition, then, else] Which is the correct syntax for the case in which there is no ...
1
vote
1answer
62 views

NDsolve and Coupled first order ODE solving [closed]

I am new to this community and also to Mathematica. I am trying to solve a set of coupled first order differential equations related to the shape of a liquid drop. The code is as follows : ...
1
vote
0answers
21 views

Need explanation for specific expression syntax that starts with an integer and a period [duplicate]

I have a Table statement that I don't understand: ...
1
vote
0answers
85 views

“What is” command in Mathematica [duplicate]

I'm looking for "What is" command in Mathematica. For example, the command WhatIs[function[x]] gives a definition of the function given anywhere in the notebook or generally in kernel. Could anyone ...
3
votes
1answer
51 views

When to expect increment to add 2? [duplicate]

I expected 3 from both of these ...
-1
votes
1answer
54 views

Operations between sets of integers [closed]

sorry it was impossible to put the code in Latex, he said that there were problems of indentation, I put the image
4
votes
2answers
164 views

Mathematica syntax with combined Prefix and Times operator: @* [duplicate]

In a post on the Mathematica Community, Anton Antonov uses a syntax that I have never seen. It is the prefix function @ combined with the Times operator *. The combination appears to bind the ...
6
votes
1answer
119 views

Is (x|y|…)∈set the same as x∈set&&y∈set&&…?

I've sometimes seen that this operator is used to specify that each of given variables is in some set, e.g. Reals. Like ...
5
votes
2answers
222 views

Where to look up information about some symbols, such as “,”, “[” and “]” (not string)?

Searching { in F1 documentation, one at least gets an item for List. But the same thing is not happening for ...
1
vote
0answers
53 views

Run function as loop over two matrices

I'm still wrapping my head around Mathematica syntax. I have a matrix clustersAll that looks like ...
17
votes
2answers
310 views

When to name a variable with $

There are some symbols in the Wolfram Language that start with $, including $Abort, ...
2
votes
1answer
82 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
41 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
68 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
85 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
29 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
34 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
74 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
59 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
53 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
323 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
73 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
64 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
157 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
3answers
61 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 ...