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
1answer
57 views

Sign of a symbolic expression as a function of parameter values

I need to know the sign of the following expression for p[t] = z/(1-a), as a function of the parameters {a, b, c, z}: ...
1
vote
1answer
66 views

How to evaluate sum with different coefficient in each term?

I would like to know if there is a syntax that allows me to enter a sum that has coefficients that vary for every term? I have no interest in evaluating them numerically, but rather to keep them as ...
1
vote
2answers
71 views

Matrix with infinity on main diagonal

The question is trivial, however, there might be unexpected solutions. What would be nice way to create a square matrix with $\infty$ on main diagonal, and some arbitrary constant everywhere else? My ...
2
votes
1answer
41 views

how to manipulate indices in a table/vector

Perhaps I'm missing something very basic. Could somebody guide me how to manipulate indices of a list. For example, if I've u = Table[Subscript[u, i], {i, 1, lp + 1}]. I've these u in an expression, ...
1
vote
1answer
37 views

GCD of Table entries

This question is from a newbie, so please be gentle in thrashing if I'm missing something very basic. How can I use GCD on a matrix/vector entries stored as Table. For example, if ...
0
votes
0answers
41 views

Treating expressions as symbols [duplicate]

I'm trying to do something like this: test = {x, y}; With[{test[[1]] = 3}, x/y] However, the following error is printed: With::lvset: "Local variable ...
0
votes
1answer
18 views

Testing Conditions in For Loops

I am attempting to create a set of coefficients that satisfy a set of conditions using the Do function and If statements. I did this successfully with a basic set of conditions: ...
12
votes
2answers
499 views

Why aren't parentheses ( ) an expression in Mathematica?

Why aren't parentheses ( ) an expression in Mathematica? Can I get an expression in a form where parentheses are represented by an expression?
4
votes
1answer
59 views

Why are SetProperty and PropertyValue not working here?

I have a very simple graph, a loop: ...
3
votes
1answer
65 views

Why minimization does not work with symbolic array as arguments

If I try to minimize with constraints a function of several variables, with Gamma regularized function involved in the constraints it seems to works, as shown below (this is just a dummy example ...
6
votes
0answers
55 views

Negative accuracy numerics ( 0``-128 notation )

What does it mean to have a negative accuracy number? I understand 0``128 to mean "the number zero to 128 decimal points". Mathematica corroborates this: ...
0
votes
0answers
30 views

Strange behaviour of VertexEccentricity when switching from map to thread [on hold]

I want to get a list of vertex eccentricies for all vertices in a graph. This example works just fine: ...
-1
votes
2answers
86 views

How to make sure input is an ODE

I'm having trouble wrapping my head around why this isn't an ordinary differential equation. ...
0
votes
1answer
84 views

How To Use D[ ] to Define a System of PDEs

We have two variables $u_{1}$ and $u_{2}$ which are functions of $x,t$. That is, $u_{1}=u_{1}(x,t)$ and $u_{2}=u_{2}(x,t)$. Consider the the system of partial differential equations $$\frac{\partial ...
3
votes
2answers
128 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
vote
1answer
41 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
50 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 ...
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
44 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
58 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 ...
2
votes
1answer
99 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 ...
19
votes
2answers
497 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]]] ...
27
votes
2answers
1k 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
147 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
55 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
33 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
149 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
136 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
41 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
49 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
34 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
53 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
48 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
71 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
88 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
96 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
73 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
59 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
312 views

Long list of similar rules

Given the following: ...
6
votes
6answers
863 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
45 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
77 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
236 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
49 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: ...