Questions about the use of built-in Mathematica functions, including pure functions.

learn more… | top users | synonyms

5
votes
5answers
214 views

Nested function with an increasing argument

If, for example, I have a nesting function like Nest[1 + x^n (#) &, 1, 3] it gives the result ...
0
votes
1answer
54 views

Defining functions with parameters

I want to change my code in which I set the global values of my parameters in the beginning, to a code in which I leave the parameter values undefined in the definition of functions. Take for example ...
0
votes
1answer
45 views

Output of Coefficientrules into Jacobian matrix

I have a pair of large polynomials in u, v, a1...a9 and b1...b9, generated by ...
17
votes
1answer
411 views

List of symbols marked [[EXPERIMENTAL]] in the documentation

Some of the built-in Wolfram Language symbols are marked as [[EXPERIMENTAL]] in the documentation. For example How can I get a list of all the symbols marked as ...
3
votes
1answer
86 views

Evaluate Limit only if both directions(sides) are equal?Ex: $\lim _{x\to 0}\left(\frac{1}{x}\right)=DNE$

I want the limit of a function to only evaluate if both the left and right hand side are equal. For example $\lim _{x\to 0}\left(\frac{1}{x}\right)$ doesn't exist(two sided limit). However, the right ...
2
votes
0answers
52 views

Import names into notebook namespace [duplicate]

I have function that at some point has list of strings (e.g. {"apple","pear"}) and I want to declare (initialize) those variables in notebook namespace to default ...
1
vote
2answers
110 views

Back from transfer function (s-domain) to differential equation (in t-domain)

I've got the following transfer function (in the s-domain): $$\text{H}(s)=\frac{\text{C}s}{\text{RC}s+1}$$ Is there a function in Mathematica 10 that I can go back to the differential equation (in ...
5
votes
1answer
119 views

Why are so many built-in numerical function doesn't check its argument is packed array or not? [closed]

This question is brought by this one. Outer[Times, RandomReal[1., 1000000], {1., 2.}]; is much slower than ...
1
vote
0answers
34 views

Defining an object which is function in some variables and tensor in some other indices

I am trying to define an object which function in some variable and tensor in other indices. My attempt at it was: ...
1
vote
3answers
121 views

how to find circles that intersect a square

I use the following (based on ideas and functions I got as ansers in [1], [2] by, repsectively, @ybeltukov and @J.M.) in order to find random circles with centers inside a unit square that intersect ...
5
votes
3answers
212 views

Make own rule for multiplication

I'm new to mathematica, so I still cannot use it properly. I want to do symbolic programming. My question is : is there any way to define our own multiplication. Suppose $a,b$ are arbitrary ...
8
votes
6answers
2k views
1
vote
1answer
46 views

Apply Grad and Mod to Matrix

Let f:=x^3+y*x*z+z^3; Let mat = {{2, 2, 2}, {3, 1, 7}, {1, 6, 3},{4, 5, 1},{0,4,9}}; be a list of points . I want to compute ...
2
votes
1answer
108 views

How to put the result of NDSolve in a function?

I have solved an ODE with NDSolve, and put the result in S: S = NDSolve[{y'[x]==(y[x]^4+y[x]+1)^(1/2),y[0]==0}, y, {x, 0, 100}] But i don't want to plot y[x] ...
3
votes
1answer
58 views

Automatically discover the class of an arbitrary matrix

In Wolfram|Alpha it is possible to discover some specific classes to which a matrix belongs. For instance, typing this in Wolfram|Alpha ...
0
votes
2answers
66 views

List of points of an increasing sine function

I'm trying to obtain a list of the points of an amplitude-increasing sine function. I would like to give a certain value for input, e.g. 0.5. Sine will start increasing and decreasing from this point, ...
0
votes
1answer
117 views

Calculate overlap coefficient between two functions

I have two functions and I want to calculate the overlap coefficients between those two functions. A similar question has been answered for Python and R, however, I couldn't find an answer for ...
28
votes
3answers
378 views

How to create a dynamic expanding DisplayForm's styled like the ones in v10?

The display forms for objects like ClassifierFunction are nice clickable boxes I like this, and now I'm trying to create my a custom version of this for my ...
51
votes
2answers
4k views

What is so special about Prime?

When we try to evaluate Prime on big numbers (e.g. 10^13) we encounter the following issue: ...
8
votes
1answer
119 views

What's wrong with MovingMap + Apply[Rule] etc.?

I don't why this happens, I don't know if those two examples are related. I don't have time to investigate, but maybe someone can solve this? ...
1
vote
1answer
56 views

FindRoot::Istol error

I recently tried to find a root with FindRoot in Mathematica. I know that the problem has a solution, but when using FindRoot, this error appears : ...
1
vote
1answer
59 views

Assigning solutions to a variable [duplicate]

If I do Solve[x+1==0, x] then I get {{x -> -1}} But I want to assign the solution -1 directly before seeing the result, ...
3
votes
1answer
80 views

InverseFunction: how can I extract the function inside?

This is probably a trivial question. But I could not find an answer. Given the explicit expression for ft in te assignment ...
0
votes
0answers
57 views

Workaround of non-integer indexed objects? [duplicate]

When using indexed object, I found the behavior of value 0.7 as the index quite strange, then did the following test. The first output cell was executed directly as the second input cell. Have not ...
6
votes
1answer
96 views

Can Mathematica return the order of an element in $S_n$

I want to input an element like Cycles[{{1, 2}, {3, 4, 5}}] and I want Mathematica to return 6, the order of this element in $S_5$.
0
votes
2answers
84 views

How to evaluate function in the grid?

I have a function f[a_, b_]: = b^a + a b. a takes values {1,2,3,4}, and ...
6
votes
0answers
50 views

KeyIntersection fails (?) when an association is empty

I think I found a bug in KeyIntersection (Mma 10.2). To illustrate, input the following: ...
0
votes
1answer
38 views

Why this throw Null^2 Return[e1]? [closed]

I am amazed by the difficulty of Mathematica, due to my OOP background. Why does the following code not return the output I am expecting? ...
2
votes
1answer
53 views

If I want a function only applies to the elements of a specific list, how should I define the function? [closed]

If I define a list: list={1,2,3,4}; and I want a function f to apply only to the elements in the list (for here it is ...
4
votes
4answers
164 views

Numeric range: present or not

There is a formula to test whether a number is included in a range? For example, if 3 is between -2 and 6.
1
vote
1answer
59 views

Simplify the following transformed equation [closed]

y=7f(-1/6(x-1))+1 The base function is f(x)=x^2. I just don't understand where the ^2 went and how to simplify this. Any help is much appreciated, thanks.
4
votes
1answer
51 views

apply a constraint to summation limits

I have a list as list={{-0.5, 5}, {-0.25, 2}, {0, 3}, {0.25, 2}, {0.5, 5}} and I want to use of Esc+sum+Esc symbol for ...
0
votes
2answers
39 views

How to use With on previously defined expressions [duplicate]

The command With[{x = 1}, x] outputs 1. The command t = x; With[{x = 1}, t] outputs ...
0
votes
1answer
91 views

How do I create a function to rotate a rectangle about its origin? [closed]

I am new to Mathematica and was trying some new things. I wanted to rotate a rectangle using a rotation matrix by any angle theta from say o to 2pi. I could do it using predefined Mathematica ...
6
votes
2answers
635 views

How does one clear the memory of a recursive function

I want to implement the recursive function v[n_] := v[n] = v[n-1] + f[n-1] + Random[NormalDistribution[0,s]] to get ...
1
vote
1answer
311 views

Is there a function for falling factorial in Mathematica

If I had to construct a function for falling factorial in mathematica I'd do something like that (hope I'm not mistaken): fallfact[x_,k_]:=$\prod_{j=0}^{k-1}(x-j)$ But is there a built-in ...
7
votes
1answer
708 views

Demonstrating Ackermann's Function

The Ackermann function is an extremely fast growing function. There are some slightly different versions of the function, but the one that I am looking for can be defined as: $$ A_0(x)=x+1 \\ ...
-4
votes
3answers
85 views

x² function (0-3) to solve the Riemann integrate [closed]

x² function (0-3) to solve the Riemann integrate the range What is it that Mathematica code? Please show me the steps
-1
votes
2answers
93 views

The prime numbers between 1 and 100 [closed]

I'm new on this and the help seems not as helpful on this particular subject The prime numbers between 1 and 100 mathematica show steps
2
votes
2answers
138 views

Can Mathematica return the first few terms of a sequence given the first few terms of a Dirichlet Generating Function?

For example: a=Sum[1/n^s,{n,1,6}]; Expand[a^2] returns a big mess. I want to see something like: 1/1^s + 2/2^s + 2/3^s + 3/4^s + 2/5^s + 4/6^s + ... + 1/36^s.
2
votes
1answer
72 views

Interpreting Mathematica's expression for a function domain

When I study the domain my function f: f[x_] := 2/(Cos[x]^2) + 1/Log[Sin[x]] FunctionDomain[f[x], x, Reals] I receive the ...
5
votes
1answer
74 views

What does the Combinatorica function: NumberOfPermutationsByType return?

I am using Mathematica 9. If I input: NumberOfPermutationsByType[{2, 2, 1, 1}] Mathematica returns 1/8. I was expecting ...
14
votes
3answers
389 views

Clever use of DownValues, or failure to understand the “Mathematica Way.”

I needed to look at the changes in the values of about 4000 items from one year to the next. I have a table with identifiers and values for each year. Not all of the items are in each list. The ...
2
votes
1answer
99 views

Domain definition of a function

I study the following equation: f[x_] := (Exp[2*x] - Log[E + x])/(x^3 + Sin[x]*Cos[x]) Plot[f[x], {x, -10, 2}] When I observe the plot of this function, It ...
13
votes
6answers
1k views

Building a continued fraction

I've completed a problem that involves approximating $e$ by a continued fraction: $$\frac{N_1}{D_1+\frac{N_2}{D_2+\frac{N_3}{\ddots+\frac{N_k}{D_k}}}}$$ with the $N_i$ being the list ...
19
votes
1answer
376 views

DumpSave 10.2 style from 10.3

Szabolcs has asked WRI support about mx files, in particular: Can we expect that MX files written by Mathematica 10.0.0 will be readable by future point released such as 10.0.1 or 10.0.2? ...
0
votes
1answer
62 views

Is there any way to plot function from other function?

For example, I have a function W[L_, m_] := 1 + 3 L + 2 L^2 - 6 m - 6 Lm + 6 m^2 I also have r = m/L What is the easiest ...
7
votes
3answers
381 views

How to rename a built-in function?

I want a built-in function renamed without loss of any properties, I want the shorter name to appear in all results and to be recognized as input. Is it possible?
4
votes
1answer
78 views

issue with `Nearest` with mixed type input

Bug introduced in 10.0.2 and fixed in 10.2 See if anyone else can reproduce this error: ...