Tagged Questions

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

432 views

Defining indefinitely many functions

Is it possible to define a class of indefinitely many functions f1, f2, f3, ... such that ...
75 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 ...
52 views

Select from a list using another list of limits

Given a list of values list1 = {2.4, 3.4, 5.9, 1.2, 9.5, 7.5} and a another list containing theoretical maximum values ...
83 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: ...
39 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)? ...
134 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: ...
60 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 ...
63 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 ...
111 views

Approximate UnitStep for use in Enterprise CDF

The following Manipulate code displays the VectorPlot for all functions. (This code is a subset of a more extensive notebook which is based on the structure you see below. Consequently, I need to ...
23 views

How to solve Tag Function is Protected error? [closed]

I am trying to generating a very simple function basing on a known expression: f = x + y; Function[y, g] = Integrate[f, {x, -1, 1}] However, I received this ...
37 views

Problem with Apply [duplicate]

I have am trying to obtain the average of the distance from the mean radius for each shot in a group of shots at a target. I am having problems with the very last line. The output of the last line ...
168 views

Why is this evaluation halved when adding units?

Why does this strange behavior occur when dealing with units and quantities? ...
78 views

Why does FromDigits transpose its argument (sometimes)?

FromDigits /@ Transpose@{{1, 2}, {3, 4}, {5, 6}} == FromDigits @ {{1, 2}, {3, 4}, {5, 6}} (* True *) The only "strange" syntax I've found in the docs is ...
69 views

Express function derivative in terms of the function itself

I'm working on a minimization problem that involves the standard logistic function $f(x) = \frac{1}{1+e^{-x}}$ along with its simple derivative $f'(x) = f(x) \cdot (1 - f(x))$ The correctness of ...
134 views

An argument pattern that my function can treat as Times[constant, variable]

I want to define a function of two variables, func[f_, g_], such that when it sees a general constant multiplying one of the variables, say ...
55 views

Why can't I use OmegaPrime to find the Limit of Prime[n]? [duplicate]

I've looked at these links already; What are the limits of the Prime-functions? What is so special about Prime? which gave an answer for earlier versions of Mathematica. Yet when I try to input ...
237 views

How does Rescale[] handle infinities?

Rescale appears to be a simple function. It just does a simple linear $y = a x + b$ type rescaling of the values: ...
339 views

Position function not always returning an answer even with no apparent problems

I'm having some problems with Position. Sometimes it will give an empty list instead of the actual position of the element I am looking for when that element is ...
405 views

How can I separate two parts of power of Exponential functions?

How can I separate two parts of power of exponential functions in Mathematica? I have an expression similar to this one: a*b*Exp[u+v]+c*Exp[u] I want to set ...
83 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 ...
151 views

Convert FullForm to XML Structure and back

How might I create a function that converts between FullForm and a XML structuce? Ultimately I'm ideally looking to use CSS and JS to edited the XML structure. ...
122 views

Restrict domain of a function?

I have a function f[x,y,...,z] and I want to restrict its range to positive numbers only, f > 0. ...
120 views

How would one return from a place of a pure function's body using Return?

From previous answers, replies and discussions it is known, while not formally documented (even in the most recent Wolfram Language Documentation Center), that Return can be used in a two-argument ...
112 views

How to correctly scale the x axis?

I am not absolutely sure how to formulate my question but here is my first attempt: I have 25 rods with lengths in cm ...
90 views

what is the means of (0 -> 1) of series expansion [closed]

I use mathematica 8 to take a taylor expansion.In the Output, the expression (0->1) appears in the second term and all higher order term, and this expression is multiplied with other coefficient and ...
21 views

Laplace transform and inverse transform question [migrated]

Appreciate advice on the above equation. I got the answer showed in the snapshot, but not sure whether it is correct or not.
190 views

Undocumented fourth parameter of Collect; how long has it been there?

While tinkering with How to get a list of monomials of a polynomial without coefficients? on a whim I tried a fourth argument in Collect and found: ...
322 views

In 10.1.0 BenchmarkPlot doesn't work?

Bug introduced in 10.1 and fixed in 10.2.0 In Mathematica 10.1.0 BenchmarkPlot from the GeneralUtilities package doesn't work; copying Taliesin Beynon's initial ...
134 views

What kind of creature is h[c] for definition h[c_][x_] := (* function of x and c *)

To implement "Hero's Method" for approximating $\sqrt{c}$, one iterates the function (x + c/x)/2 for a given number c (e.g., ...
71 views

Optimization of recursive functions by using the //. operator

In some cases, recursion in Mathematica (without storing values) is not very efficient. For example, the recursive implementation of Fibonacci numbers (version which doesn't store the values) : ...
89 views

How to create a vertical (smooth) Histogram on the y-axis of a function graph for an uncertain x?

This is my first time posting a question in StackExchange. I have encountered a certain problem and I can't seem too find a solution. Just a word of caution, I am kind of an amateur when it comes to ...
109 views

Complement[] changes order of elements?

Consider this example: Complement[{a, y, c, d, e}, {a, c}, {d}] (*{e, y}*) However, I was expecting the result to be: ...
210 views

Built in function without Attributes Listable works as if it has Attributes Listable

Can Built-in function works as if it has Attributes Listable even if it doesn't have that ...
372 views

Why is an Identity function needed?

Today I came across the function Identity[x] in Mathematica (documentation). The example given in the documentation uses it in ...
283 views

Where is the old option TraceInternal->True?

Already at least in version 2 (I think), the function Solve calls the function Roots. At that time, I had a rather dirty trick, that still works, to verify this: ...
129 views

Help with functions in Mathematica

I'd like to make a function that has many parts. Doing this in something such as Java, which I am familiar with, would be simple. In Mathematica I have these "pieces", which I want to put into a ...
94 views

Mathematica Lattice Reduce Command

I'm going through a very old copy of "Mathematica: A System for Doing Mathematics by Computer" for self practice. I'm on chapter 3, and ran into the LatticeReduce ...
54 views

RootReduce-Part of Solve

I have given the following expression in $M$ and $z$: a = \frac{-4 M^2+M (-3 z-5)+\frac{1.1875 z}{\sqrt{\frac{0.015625 z}{M+1}-1.5625} \sqrt{\frac{0.765625 ...
220 views

Pattern and Orderless function

I'm a Mathematica beginner. I am exploring the use of patterns and (only for fun) am trying to implement a permutations function. My (dirty) code is: ...
182 views

Distributing function arguments with function compositions. How to compute $(f + g^2)(x) = f(x) + g(x)^2$?

Suppose I have two functions f and g. To compute $f + g$ evaluated at a point $x$, I know that one can use ...
227 views

More Ticks::ticks errors in AbsoluteOptions in v10

Bug introduced in 7.0 or earlier and persisting through 10.2 or later While the specific bug affecting Plot described in AbsoluteOptions prints error messages in ...
66 views

Table generation with SetDelayed function [closed]

I would like to understand why the following two outputs differ: Let us define the following data set: ...
84 views

Working with CDF Deployment

I've been working with FreeCDFs in Mathematica 10 and it has been going fine as long as I do not pull from a database or access local files. I recently purchased the Mathematica 10.2 Enterprise ...
2k views

Series expansion in terms of Hermite polynomials

I am trying to expand a polynomial in terms of orthogonal polynomials (in my case, Hermite). Maple has a nice built-in function for this, ChangeBasis. Is there a ...
65 views

Working with functionals [closed]

I am trying to work with functionals in Mathematica, this means that I want to define a function of a function. I defined my function of a function as: ...
202 views

Strange behavior with Cases and Position with SetDelayed

I feel like I must be missing something simple and obvious here, but this has me scratching my head. This works as expected: ...
40 views

Why does the same function defined by Set and SetDelayed look different? [duplicate]

I start with the following input: f[n_] = Sum[(1+x)^j, {j,1,n}]; g[n_] := Sum[(1+x)^j, {j,1,n}] When I try to evaluate the code above I get: ...
56 views

Why is the evaluation of f different using rules and using arguments to it as a function? [closed]

I will provide all the code I used at the end of the question. I was trying to evaluate a function f with the following signature (which I'll give the details at ...