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

learn more… | top users | synonyms

0
votes
1answer
75 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 ...
0
votes
2answers
64 views

Function input syntax [closed]

My functions are ...
6
votes
2answers
612 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 ...
-4
votes
3answers
84 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
74 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
5
votes
1answer
72 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 ...
2
votes
1answer
70 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 ...
2
votes
1answer
94 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 ...
0
votes
1answer
60 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 ...
4
votes
1answer
34 views

How to evaluate following inputs only after finishing CreateDialog

I have a code which starts with the following Cell: ...
4
votes
1answer
74 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: ...
2
votes
1answer
104 views

How to properly define this function of function

I encountered real problem at first, and here is the toy example variable argument stored some expression that is generated from other parts of the program. I ...
7
votes
4answers
225 views

Iteration of functions

I'm trying to define a function f, such that f[a_]:=a; f[f[a__]]:=f[a]; Then, I tried to evaluate f[x,y]. Since ...
1
vote
1answer
52 views

A bijection between a list of $n$ elements and the canonical basis of $\mathbb{R}^n$

I have some lists omega[i], i=0,1,...,15. And, e.g., omega[0] has four elements. I would like to define a function that maps omega[0][[i]] into $e_i$, where $e_1=\{1,0,0,0\}$, $e_2=\{0,1,0,0\}$... ...
5
votes
3answers
356 views

A simple list question

If I have list1={x^a, x^b, x^c} and list2={1,2,3}, how do I substitute one into the other to get ...
1
vote
0answers
56 views

DiracDelta of a function

If I have, for instance, FunctionExpand[DiracDelta[x^2+x-3]] it evaluates to ...
1
vote
1answer
83 views

How can I produce a function with maxima at given locations

At the first I ask a general question and after that I bring out the special problem. If we have some functions such as f1[x], f2[x], f3[x] and f4[x] and they have shared intersections points. Is ...
2
votes
1answer
53 views

Issue with plotting function

I can't seem to work out why nothing is showing when I try to plot h[t] in the example below: ...
1
vote
1answer
96 views

Extracting the 'critical point'

I have a discrete function (or list of ordered pairs) with respect to a discrete integer n, f[n]. In the format ...
0
votes
1answer
33 views

PermutationReplace does not seem to work when Combinatorica is open. Is there a function that is equivalent.?

I want a permutation to act on a set. For example: I want the permutation {2,1,3,5,4} to act on the set {2,3,4} by returning {1,3,5}. I need to do this in the same code that has functions that need ...
3
votes
3answers
120 views

Greater operator should give greater element

4>3 gives True. What is the "greater_operator" to obtain the result 4? For lists accordingly: ...
0
votes
1answer
57 views

Defining a function to use in another function dependent on similar parameters [closed]

I want to define a variable dependent function which can be used to define another function which depends on the same variable and other variables. For example, I have a system where I define ...
3
votes
2answers
65 views

FindRoot, How to Return Null After x Number of Iterations

I am using FindRoot to find the root of a function, say f(x), and going through a loop for different values of ...
0
votes
1answer
58 views

How to implement the for loop to replace text strings or texts?

I wonder define a bunch variables named like $X_1$, $X_2$, $...$, $X_n$. Is there some smart way to declare them instead of by pure typing. One trick I can image is to use the for loop,...
0
votes
0answers
54 views

Cannot assign one element of an multi-output function (a list of outputs) to a new function

My aim is to define two functions by writing only one time the actual definition. The first one gives me a matrix and the second one is one of the elements of the matrix. Moreover, as I want to ...
18
votes
1answer
350 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? ...
6
votes
1answer
105 views

Relevant help page for: Sum`?

When I type Sum into Mathematica, it also offers Sum` in the autocomplete dropdown, but when I click the little menu button next ...
0
votes
1answer
76 views

Defining Function With Two Variables [closed]

I need to define some functions with more than one variable, but the examples only list one variable cases, so I tried this: f[x_, y_] = (y/x) + xy f[1, 2] ...
11
votes
1answer
230 views

What has changed in the Template system in 10.3?

Bug introduced in 10.3 Bug persists in 10.3.1 There are couple of issues that are breaking my code after upgrading to 10.3. I wasn't able to narrow all of them down but this is what I've found. ...
9
votes
2answers
218 views

Graph subtree with respect to the flow

So let's say we have a TreeGraph: ...
6
votes
0answers
64 views

How to instruct MatrixLog to work with singular matrices?

How to instruct MatrixLog to work with singular matrices by ignoring the zero eigenvalues (thus only acting on a subspace orthogonal to the matrix kernel)? I'm ...
0
votes
1answer
41 views

How can evaluate this function [duplicate]

Suppose this function F[c_, n_, s_] := Module[{}, Abs[s - 1 + (-1 + c)^n]] I calculate its second derivative on c ...
1
vote
2answers
77 views

Composing multiple functions [closed]

I am trying to compose three functions in the following manner: Adx[z_] = (z[x + dx, t] + z[x, t])/2 Ddt[z_] = (z[x, t + dt] - z[x, t])/dt Ddt[Adx[z]] I get the ...
2
votes
1answer
86 views

Why `Chop` does not make the real part of machine complex numbers an exact zero? [duplicate]

The documentation says Chop does not make the real part of machine complex numbers an exact zero: In[2]:= Chop[10.^-12 + 2. I] Out[2]= 0. + 2. I Why does ...
12
votes
3answers
502 views

Map a function of several arguments

I have three lists, e.g. list1 = {{a,b,...}}; list2 = {{1,2},{3,4},...}; list3 = {{x,y},{z,w},...}; and a function ...
7
votes
2answers
121 views

Recursive function activity

We had the following question on an activity for our students: Let $f_0(x)=x+|x-100|-|x+100|$, and for $n\geq 1$, let $f_n(x)=|f_{n-1}(x)|-1$. For how many values of $x$ is $f_{100}(x)=0$? When I ...
2
votes
1answer
52 views

How does RootLocusPlot handle TransferFunctionModel

I'd like to analyze the poles (denominator-roots) of a TransferFunctionModel, that was generated from a ...
7
votes
3answers
189 views

Through does not work with Subtract

Through[(Max - Min)[#]] & @ {1, 2, 3, 4, 5} gives 5 + (-Min)[{1, 2, 3, 4, 5}] Of course I can work around by ...
2
votes
3answers
61 views

Having a function check a column and perform a task every time an entry satisfies a condition

So I have a matrix (technically a table) points = Table[{x, f[x]}, {x, Range[0, 2, .1]}]; Which gives something like this in matrixform \begin{array}{cc} ...
2
votes
1answer
71 views

Plot a function with respect to two parameters that are not explicitly function parameters

$$function = |\delta|\frac{I_1(\kappa)}{I_0(\kappa)}$$ where $I_0(\kappa)$ and $I_1(\kappa)$ are the modified bessel functions of the first kind of order $0$ and $1$ I want to plot the function in ...
2
votes
1answer
88 views

How to prevent a definition from overwriting my input

I developed the following manipulate code to be a limited knockoff of Polking's dfield. I export the code to Enterprise CDF so that one may type a first-order ODE into the input box and create a slope ...
1
vote
1answer
66 views

Defining function from table [closed]

I have a table of values of the form Table[{i1,j1}, {i2,j2}...] and I want to define a function like f[i] to take the values ...
5
votes
1answer
111 views

Newton's Method Converges in Mathematica for non-convergent functions

In mathematica I set f[x_] := Sign[x] Sqrt[Abs[x]] and then I solved it in a root finding for Newton's method by doing ...
5
votes
5answers
483 views

Defining indefinitely many functions

Is it possible to define a class of indefinitely many functions f1, f2, f3, ... such that ...
1
vote
2answers
52 views

Find function to relate two lists of values

I know Mathematica has the FindFit function to determine the parameters of a known function that fits a sequence of points, but what if you do not know the relationship (linear, log, quadratic, etc)? ...
2
votes
1answer
89 views

How does this code work to substract a set A from a set B?

In an answer to a question (as given here: code), the proposed function was to to subtract a set B from a Set A: ...
4
votes
2answers
178 views

How do Reap and Sow work in this context

I have a list of points in 3D and I need to count how many times each point is repeated. For a similar problem with a list of characters many different solutions have been proposed in this post: ...
2
votes
1answer
75 views

Issue plotting/re-creating 3d function

I am trying to re-create images created in Mathematica using the equations in the photos attached. I was able to somewhat plot the Equation 6 (Cartesian coordinates) Figure 4 using this code ...
0
votes
3answers
83 views

How to Change Vertex List in a Grid Graph

I would like to actually change the vertices in a grid graph instead of simply changing the label. Ultimately, I want the vertices to be points on a plane. So if given a simple grid graph ...