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

learn more… | top users | synonyms

3
votes
2answers
116 views

Discritizing an analytical 3D-function

I have the following Problem: I need a discretized amount of points in a 3D-volume. These points satisfy a condition to built-up a 3D-geometry. In my example below I selected a helical geometry. The ...
5
votes
1answer
80 views

Same name for functions in package and Global context

I am using a package that was written for Mathematica 3 while I am now working on Mathematica 8. I have issues with 2 functions in particular, Order and GraphComplement. They are a part of this ...
20
votes
4answers
3k views

Plotting piecewise function with distinct colors in each section

I have a piecewise function that I would like to plot but I was wondering if it is possible that each part of the function that is plotted when its corresponding condition is true be plotted with a ...
4
votes
1answer
55 views

Strange behavior of ArcTan [duplicate]

I've noticed a strange behavior of Mathematica's ArcTan function with two arguments. If both arguments are 0 or ...
7
votes
6answers
488 views

Partial sum of a list

The problem I have is really basic but I just can't get my head around it. Suppose I have a list of ordered pairs A = {{a, b}, {c, d}, {e, f}, {g, h}, ...}. I ...
2
votes
1answer
77 views

Inputs which make two function have the same value [closed]

Suppose I have two function f(x1,...,xN) and g(x1,...,xN). How can I find the values ...
0
votes
1answer
118 views

For-loop function problem [closed]

I wrote the following true anomaly function based on a Fortran program that I found in a computational space flight dynamics book. The function uses an iterative method to calculate the true anomaly ...
17
votes
0answers
122 views

V10's TypeSystem - what are these function useful for? [closed]

The symbols in the TypeSystem` context are clearly used for working with Datasets, but they seem powerful. I was hoping that someone could help explain how they work and is they are useful for ...
5
votes
1answer
129 views

Attributes with Pattern test

Probably this question has no application but it helps understand basic issues about Attributes and functions. I was writing a piece of code where I accidently ...
5
votes
1answer
119 views

How to make my fuction return a step count

I am new to mathematica, and I have this 3d random walker program which runs with a fixed (given) amount of steps. What I want it to do is to run forever but stop when two walkers collide (aka have ...
2
votes
1answer
62 views

Finding the expansion of $\sin(a_{1}+a_{2}+a_{3})$ on Mathematica [closed]

How to find the expansion of $\sin(a_{1}+a_{2}+a_{3})$ on Mathematica, using $$ \sin(a+b) = \sin a \cos b + \sin b \cos a$$ to the end? I tried FunctionExpand ...
13
votes
9answers
2k views

Finding maximum or minimum of implicit functions

is there any built in function that can be used to find maximum or minimum of implicit functions? For example, if we have the equation $$x^2 + y^2 = (2 x^2 + 2 y^2 - x)^2,$$ then we can visualize the ...
12
votes
6answers
847 views

Generating Random Real numbers with certain numbers not included

I'm writing a program that i need 1000 real number between -3 and 6. the code that I used for generating and saving them was l = RandomReal[{-3, 6}, 1000] But I ...
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 ...
0
votes
0answers
65 views

Finding double inverse Laplace transform numerically

Edit: I asked Prof. Valko, he was so nice to point out where the mistake is. The problem is solved ! Thank you for your attention ! Recall the the double Laplace transform of a function $f(x,t)$ is ...
2
votes
4answers
117 views

How to obtain the gradient of a function as a function?

The Grad function allows me to get the gradient of a function like this: ...
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. ...
2
votes
1answer
84 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 ...
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
0answers
431 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: ...
6
votes
2answers
197 views

Using MovingMap to calculate percentage changes

Bug introduced in 10.0 and fixed in 10.1 MovingMap (new in version 10) applies a function to discrete data over a moving window. This is very convenient for ...
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 ...
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 ...
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 ...
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. ...
0
votes
0answers
45 views

How to tweak a symbolic RowReduce?

B = {{-1, 1, 0, a}, {-1, 1, 0, a}, {-1, 1, 0, b}}; MatrixForm[B] RowReduce[B] // MatrixForm Mathematica is indeed giving ...
2
votes
1answer
113 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 ...
4
votes
3answers
1k views

ArcTan[z] and ArcTan[x,y], Restriction and Conversion

In Mathematica there are two different forms for the arctangent (inverse tangent), namely ArcTan[x,y] which gives the arc tangent of $y/x$, taking into account ...
-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 ...
8
votes
2answers
631 views

Function Interpolation with Automatic / Algorithmic Values Mesh

I have an underlying function f(x,y,z) that is computationally intensive, but is smooth and continuous. I'm needing to find the function values along a line in xyz. Currently, I'm calculating f at ...
1
vote
0answers
40 views
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, ...
4
votes
1answer
765 views

Circular membrane vibration simulation

I'm new in Mathematica and I'm trying to simulate the vibration of a circular membrane for math project but I don't even know how to start. The wave equation describes the displacement of the ...
1
vote
1answer
154 views

DownValues when using Set and SetDelayed

It is known from several questions asked in SE that one of the basic differences between Set and SetDelayed is that the former ...
2
votes
1answer
413 views

Understanding the difference between matrix indices and image coordinates in context of ListDensityPlot

In Mathematica help it's written that: ListDensityPlot[array] -> generates a smooth density plot from an array of values. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
2
votes
0answers
51 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 ...