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

learn more… | top users | synonyms

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
46 views

Output of Coefficientrules into Jacobian matrix

I have a pair of large polynomials in u, v, a1...a9 and b1...b9, generated by ...
3
votes
1answer
89 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 ...
1
vote
2answers
115 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
120 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
125 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 ...
1
vote
1answer
47 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
117 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] ...
17
votes
1answer
417 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 ...
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, ...
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 ...
0
votes
1answer
138 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 ...
8
votes
1answer
120 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
61 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
84 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
98 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
1answer
145 views

Check an inequality if one condition holds

A = Abs[-1 + 1/(1 + β)] + Abs[-((1 + 2 α + Sqrt[1 + 4 α + 4 α β])/(2 α + 2 α β))] Is A <1 if ...
0
votes
2answers
95 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
39 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? ...
4
votes
4answers
165 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.
2
votes
1answer
54 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 ...
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
52 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
92 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
65 views

Function input syntax [closed]

My functions are ...
6
votes
2answers
643 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
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
101 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
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 ...
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 ...
2
votes
1answer
100 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
64 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 ...
5
votes
1answer
46 views

How to evaluate following inputs only after finishing CreateDialog

I have a code which starts with the following Cell: ...
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: ...
2
votes
1answer
117 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
232 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
53 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
358 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
64 views

DiracDelta of a function

If I have, for instance, FunctionExpand[DiracDelta[x^2+x-3]] it evaluates to ...
1
vote
1answer
92 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
35 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
123 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
70 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 ...