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

learn more… | top users | synonyms

12
votes
5answers
237 views

Prevent Plus from threading

This is probably a very simple question, but I couldn't find a duplicate. As everybody knows, {x, y} + v gives {x + v, y + v}. ...
4
votes
2answers
92 views

Derivative before Numerical Integration

I need to take the derivative of a function that have a numerical integration on it. The variable in which the integration will be taken is not the same as the one in which the derivative will be ...
2
votes
1answer
117 views

Function not returning number [closed]

I am quite new to Mathematica and I guess this question is really basic, but I can't figure it out myself. I'm making a simple notebook that plots a Hamiltonian function, a plane of constant energy, ...
3
votes
0answers
48 views

Monitor CUDA function

Is there a way to monitor CUDA function without bringing much performance reduction. For example, Map can be monitored by ...
1
vote
0answers
57 views

Finding correct combination of functions

I am trying to write code where I have an array $S$ or numbers in any order [5,4,2,1,....] Then I have a specific set of functions that I can write. ...
1
vote
2answers
74 views

Recursion definition wont work [closed]

When I try use any function for example f[n_] := n f[n - 1] and then f[10] I am getting error "Recursion depth of 1024 ...
2
votes
1answer
82 views

Function under Button, need help [closed]

I would like to put this function under button so I can just press button to evaluate instead of having to shift+enter ...
2
votes
0answers
423 views

Mathematica 10.3.1 - New in 10.3.1: Alphabetical Listing [closed]

I am missing a complete information page about the news in version 10.3.1 like e.g. for 10.3: http://reference.wolfram.com/language/guide/NewIn103AlphabeticalListing.html I only found this: ...
1
vote
0answers
169 views

Help with calculating a complicated integral

Edit: The question is solved : )) Thank you for your attention ! I am sorry for mass questions, but the question bothers me a lot. So I would like to ask this question here. This problem arises when ...
6
votes
1answer
88 views

How to recognize variables like built-in functions?

Many built-in functions can recognize variables. For example, function 'Table' makes its iterator change color. How can I implement a function that has a similar behavior? In this function, I can pass ...
1
vote
0answers
41 views

Rescale large numerical factors in rational functions

Given a rational function $$ f(x_1,x_2) = \dfrac{r_1 x_1^2 + r_2 x_2}{r_3 x_1 + r_4 x_2}, $$ with $r_i$ arbitrary real or complex numbers, is there a built-in function to get Mathemtica to rewrite as ...
1
vote
1answer
103 views

Simple code failing which used to run perfectly

This very simple code ran perfectly two days ago, and now it is failing, for no reason that I can see. It is simply running indefinitely, and when I abort it, it continues running until I abort it ...
3
votes
1answer
71 views

Defining a list of functions

I'm using polynomial mappings such as s[{x_,y_}] := {x + y^2, y -x} and playing with compositions of such mapping, e.g. ...
5
votes
3answers
227 views

How to Handle Infinity in calculations?

In my numerical calculations I have a list of Eigenvalues with some of them equal to zero. So, when I calculate the log to the base ...
2
votes
1answer
112 views

Problem with implementing Regula Falsi [closed]

I checked the "Questions that may already have your answer" and didn't really find what I need. It's actually pretty basic. I want to solve an equation manually with Regula Falsi. I dont need a ...
-1
votes
3answers
78 views

How to change function iteratively as a function of its previous form?

I am trying to do the following :- f[x_] := {x, 2}; Do[f[x_] :=Append[f[x], {x, 4}],{3}] % runs into recursion limit because I want to grow my function (which ...
1
vote
0answers
40 views

When evaluating this integral Mathematica returns two different answers

When evaluating this integral in Mathematica 10.3 Student Edition: ...
14
votes
1answer
217 views

What is the difference between defining a function and specifying the type of argument, versus applying a test to that argument?

Say I want to create a function that evaluates differently based on what type of argument is given. I've found two ways of doing this, ...
3
votes
1answer
87 views

Extreme Slowdown with Fold

I am doing a finite difference model, and need to create a list recursively. For a small list, Fold is extremely fast, but when the list becomes large enough, Fold becomes extremely slow. Here is the ...
4
votes
0answers
48 views

How to know the string data/settings, of some options/functions

It is known that several functions and options take some sort of input in this form: option->"something" function["something"] The simple example for this is ...
2
votes
1answer
72 views

How can I iterate a function up to a certain integer and plot the resulting functions to a single graph [closed]

Firstly I'm sorry if this has been asked before, but I couldn't find what I was looking for. Say I have a function: f[x, a] := x^2 + a Is it possible to plot a ...
6
votes
2answers
206 views

Fitting does not work

I have a set of points, which is basically one minus a Lorentz curve. And the NonlinearModelFit ...
5
votes
5answers
204 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
51 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
43 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
77 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
91 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
115 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
32 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
112 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 ...
0
votes
1answer
67 views

Need help in writing loop to assign value and calculate the called function [closed]

First of all sorry if my question is very simple as I am beginner in Mathematica. I want to add a loop at the beginning of the code to assign different values for ...
1
vote
1answer
40 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
78 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
400 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
64 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, ...
4
votes
3answers
186 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
75 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
115 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
40 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
73 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
56 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
87 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
87 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
62 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
49 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
34 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
158 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
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 ...
1
vote
1answer
54 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.