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.

learn more… | top users | synonyms

2
votes
2answers
118 views

Integrate using \[Esc] int \[Esc]

I like writing integrals symbolically instead of using Integrate[]. I suddenly seem to not be able to do this and am confused. I type \[Esc] int \[Esc] then ...
-1
votes
0answers
44 views

What is this syntax, [[1, 1, 2]]? [closed]

Ndsol = Solve[{D[y[z, n], n] == w, w == we(1 - (p - pe))}, {we, w, n}] nd[z_, we_, p_, pe_] = Ndsol[[1, 1, 2]] The what do the ...
1
vote
1answer
34 views

Partial derivative of defined function with vector input

Background: Have written a formula for the refractive index for a glass slab (n) that depends on the variables t,a and d. Now I want to calculate for example some sort of error and I'll be needing to ...
1
vote
1answer
48 views

What is the correct idiom for mapping a 0 value in a modulo n expression back to n?

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 ...
-1
votes
0answers
21 views

EllipticK error message [closed]

I need help correcting this error message in Mathematica. ...
-2
votes
0answers
20 views

How to use EllipticK in a plot and avoid getting the “not a machine-sized real number” error message? [closed]

k = Sin[π/2]; m = k^2 θ (τ) = 2 ArcSin[Sin (π/3).JacobiSN[x_, m] {τ - τ0, k}]; Plot[θ (τ_), {t, 0, 4 EllipticK[m]}] ...
0
votes
0answers
32 views

What does this “Cos[1.theta]”mean in Mathematica? [duplicate]

{{u[theta] -> 2.22328*10^8 - 2.22328*10^8 Cos[1. theta]}}
0
votes
1answer
42 views

Block Matrix Multiplication [closed]

I have a = {{-1}, {0}, {0}} b = IdentityMatrix[3] c = {a, b} d = {{7}, {2}, {0}, {0}} and would like to compute e = c.d ...
0
votes
1answer
54 views

How do I apply a conditional append rule to plot randomly chosen points?

I'm working on an attempt at forming a sort of "Mandelbrot" set using Newton's method and randomly chosen points. Effectively I need to define a loop for Newton's method to determine whether my points ...
1
vote
1answer
93 views

Separate output screen; clearing (cleaning) output screen

Is there a way to split the screen so that the code is on top visible, and execution of code look at the bottom? Is there any way to clean the screen from previous runs, so that the result of ...
18
votes
2answers
463 views

What is the difference between Composition (@*) and sequential applications (@)?

What is the difference between f@*g@*h@x and f@g@h@x Both evaluate to f[g[h[x]]] ...
26
votes
2answers
2k views

What are the cool kids talking about when they use ##&[]? [duplicate]

All the cool kids are apparently using ##&[] for Unevaluated @ Sequence[] but I have no idea what either means. ...
0
votes
0answers
31 views

What does a single @ do? [duplicate]

I have a simple expression: N@Log2@g[2048] I understand that N is Numerical value , that a function called g is being ran with 2048 as its first argument. But ...
4
votes
4answers
142 views

Get Axes Range of Plot?

Say I have some plot plot = Plot[Sin[x], {x,0,10}] (*as an example*) Is there a way I can get the x and y axes min/max values from the "plot" variable? If I ...
1
vote
1answer
17 views

SetterBar Display using MatrixForm

I have vAwGOptns = { {{0}, {0}}, {{1}, {0}}, {{0}, {1}}, {{1}, {1}} }; and would like to select ...
0
votes
1answer
50 views

NDSolve emitting dvnoarg error [closed]

I'm trying to solve this simple system of ODEs, but it gives me the error "The function v1 appears with no arguments". I've attached a screenshot of the code. I hope someone could help me, I really ...
1
vote
0answers
32 views

Using Nearest on a 2D List (seeing extra parentheses)

I am working a problem involving colliding particles. I define a list of particle diameters (effectively a bin distribution). I need to know if two particles collide, in what bin diameter should I ...
1
vote
3answers
142 views

How can I make a summary of all the commands of Mathematica?

I would like to have a simple way to get summary information about all the many commands built into Mathematica. How could I do this? Is there a site I may refer to?
2
votes
2answers
133 views

Using list elements as function calls ?

Is it possible to take elements of a matrix or list and use them as arguments of a function? I have a matrix of values, something like this; ...
1
vote
1answer
36 views

RecurrenceTable [closed]

I got an error saying ...
0
votes
0answers
33 views

Assigning to a variable with a computed name [duplicate]

I wish to assign about a dozen variables to complicated expressions. to ensure that the correct variable is assigned to the correct expression, I’d like to do something resembling ...
1
vote
1answer
48 views

NestList and RandomChoice from a list of functions

I am tryingg to modify Chaos Game Fractals from Wolfram Demonstrations. The part I am having problem with is this. Original code: ...
0
votes
1answer
31 views

How to get array/list of results of RotationMatrix?

For most other functions, passing in a list of arguments will return a list of results. E.g. t = Range[0, 10]; m = N[Sin[t]] returns ...
1
vote
1answer
49 views

Ways to protect certain parts of expressions

I am currently working on a quantum mechanics problem where I try to find equations that relate different states of a many-body system. The states are described by sets of pairs of integers, like ...
1
vote
1answer
43 views

Cannot use Part in Pure Function [duplicate]

I need to select some lists in the nested list of form of {{1,2,3},{2,3,4}}. I have used Select to complete my work. But when I tried Position, it doesn't work. For example, ...
1
vote
1answer
61 views

Trying to calculate derivatives of spherical harmonics

I am trying to confirm what is shown on this website: http://functions.wolfram.com/Polynomials/SphericalHarmonicY/20/01/01/0001/ But when I type ...
2
votes
1answer
82 views

HSQLDB database webserver access

I need a database that runs its connection over http and not tcpip. The "HSQLDB (webserver)" jdbc driver should be able to do just that. The following code launces the webserver but the OpenSQLConnect ...
2
votes
1answer
90 views

Table of references [duplicate]

I have a list of variables (say a, b, c, d, e) that I want to assign in a single command. {a,b,c,d,e} = {1,2,3,4,5} would ...
1
vote
3answers
69 views

Form a matrix to have inequality elements

It looks like a silly question, but I could not find any answers online. Your help is greatly appreciated! Say I have two lists now. ...
0
votes
2answers
58 views

For Loop in Mathematica {n, factored form of x^(n)-1} for 95<=n<=105

I am new to mathematica. I am trying to write a for loop to print out {n, factored form of x^(n)-1} for 95<=n<=105. I have followed the directions of another for loop, and gotten the following ...
5
votes
4answers
307 views

Long list of similar rules

Given the following: ...
6
votes
6answers
860 views

Can't comment strings with '*)' inside it

I believe it's a bug in notebook's comment parser. I can't comment strings with *) inside it. Something like: ...
0
votes
1answer
51 views

Fastest way to make division between a number and elements in a list [duplicate]

I have a list y={{a,b},{c,d},...} of dimension {10^5, 2}, and number x. I want to divide only the second part of each element of the list by x, and have as result a new list {{a,b/x},{c,d/x},...}. ...
0
votes
1answer
33 views

Full superset not displayed on Manipulate slider

I wish to incorporate ODE solution with Bondary condition sets: ...
2
votes
0answers
44 views

Syntax error in debug mode

Bug persists through 10.1 It appears that in debug mode, the \[Piecewise] symbol gives syntax error. Is it a bug? Are there ways to fix that except write it in ...
2
votes
1answer
75 views

Local evaluation works, CloudDeploy did not work

I a playing around with my programming cloud account. What I have found, interactive functions often are not working because there are several details that are not implemented into the cloud. So I ...
5
votes
2answers
235 views

Associativity of `/@` [duplicate]

Why are the following not equivalent: Map[Line, Map[(Print[#]; #) &, {{{2, 1}, {1, 1}}, {{-2, 1}, {3, 1}}}]] which produces ...
0
votes
1answer
48 views

Help for properly writing simple derivative expression

I need help to write the following expression (only 1 iteration): f(x) = ...some basic function... f[X0,...,Xp] = f(p)(x0) / p! What I have so far: ...
0
votes
1answer
58 views
3
votes
2answers
116 views

Substitution in parameters to “Which”

Why in this expression ...
0
votes
1answer
51 views

While Loop Not Looping [closed]

no matter what I do, the following function always returns the first v. This does does not make sense to me at all. It should loop and reevaluate v and only stop when v matches the condition. What am ...
0
votes
1answer
54 views

Position of elements in a list satisfying some criteria - Understanding the syntax [closed]

From this post: if one wants to know the position of the elements of a list that satisfy some criteria, (s)he can do something like that: ...
1
vote
2answers
52 views

How to get the outermost command evaluated first?

I have an expression like ToString[Stuff[...]]. I plan on having the Stuff[...] be manipulated as a string according to the output of other parts of the program. The problem is that Mathematica tries ...
2
votes
1answer
102 views

Array in Sum in Minimize - error “Part specification x[1] is neither a machine-sized integer”

Help please M = 10; z = Array[x, M] {x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10]} ...
2
votes
1answer
57 views

RegionUnion issues with many Regions

The new RegionUnion[] function is just what I needed if only I could get it to work. I have many non-overlapping regions that I will need to use as plotting domains ...
0
votes
0answers
41 views

How can I mix // with a function of two arguments? [duplicate]

I often find myself using // when playing around with expressions, but it is always cumbersome to have to switch to the full notation just to apply a function of ...
9
votes
5answers
449 views

Postfix Double Slash Notation with Multiple Parameters [duplicate]

Examples A convenient shorthand that I use frequently is the "double slash" notation to string commands together. For example, I can write: ...
1
vote
1answer
89 views

How a novice user better understand the Q/A [duplicate]

A novice user reading Q/A here: I sometime need to just understand the syntax and meaning of commands exampled here. where is the best place to find it?
0
votes
1answer
79 views

Moment generating function for custom distribution [closed]

For some reason the following fails. I tried everything I could, and I don't know what else to try. ...