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

learn more… | top users | synonyms

1
vote
1answer
44 views

Newton's Method Glitch

I wonder if you can help me with my program - it involves using Newton's Method but my main issue is getting a defined function to return a given value. Essentially, I want to get my function ...
0
votes
0answers
46 views

Restrict range of Functions

I have a function f[x,y,...,z] and I want to restrict its range to positive numbers only, f>0. f[x,y,...,z] is multivalued for some x,y,...,z and I cannot plot it for these values. How can I restrict ...
-3
votes
0answers
36 views

how to write a fortran subroutine in Mathematica and then how to call it in main body of program

I want to convert the same subroutine in Mathematica and then want to call it in main body. Please guide
0
votes
1answer
55 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. ...
18
votes
1answer
310 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 ...
7
votes
1answer
130 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., ...
0
votes
0answers
49 views

Invariant curves of complex functions [on hold]

How to draw automatically the invariant curves of a complex function in the complex plane? And on the Riemann sphere?
2
votes
0answers
62 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) : ...
1
vote
1answer
78 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 ...
0
votes
3answers
103 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: ...
7
votes
2answers
205 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 ...
13
votes
1answer
345 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 ...
17
votes
2answers
278 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: ...
0
votes
1answer
127 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 ...
0
votes
1answer
91 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 ...
-2
votes
0answers
39 views

Define function of two variable like a vector [closed]

I have very repetitive exercises to do and I need to control very fast the result. In order to do this, I need to define some different functions ... First of all, I need to define this ...
2
votes
1answer
54 views

RootReduce-Part of Solve

I have given the following expression in $M$ and $z$: \begin{equation} 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 ...
9
votes
2answers
215 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: ...
12
votes
4answers
169 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 ...
13
votes
0answers
216 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 ...
3
votes
1answer
65 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: ...
3
votes
2answers
77 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 ...
6
votes
6answers
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 ...
0
votes
1answer
61 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: ...
19
votes
1answer
195 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: ...
1
vote
0answers
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: ...
3
votes
0answers
54 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 ...
4
votes
2answers
207 views

Generate the Fibonacci sequence with Accumulate

Is there a way to generate the Fibonacci sequence with the Accumulate function?
1
vote
2answers
101 views

ToExpression and Fortran notation

ToExpression["9.0E-03"] interprets the string as 9*e - 3 instead of what I am expecting: ...
4
votes
2answers
126 views

DeleteMissing issues [duplicate]

Bug introduced in 10.0.0 and fixed in 10.1.0. Has anyone had problems with the DeleteMissing function in Mathematica 10.0.2? I find that it rarely works. Most of ...
0
votes
1answer
167 views

Understanding output of multivariable integration

I'm new to Mathematica and I'm trying to integrate this function: ...
2
votes
1answer
77 views

creating a stacked function that returns the multi varibles

I'm a beginner in Mathematica with little programming background but I'm determined to learn this. I'm trying to make a function that calculates two variables r2 ...
-2
votes
1answer
74 views

Why is my function returning 0 when when I try to give it arguments by replacement? [closed]

I tried running a function f with rules and calling it directly with arguments specified directly but the one with rules returns zero while the one with direct ...
10
votes
4answers
1k views

How to find the domain and range of an implicit function?

For example, we have this curve: $$x^2 + y^2 = 1$$ Is there a function in Mathematica for finding out that the ranges for $x$ and $y$ are both $[-1, 1]$? What about implicit functions of more than ...
4
votes
3answers
474 views

Is there a function for nearest power of 2 in Mathematica like nextpow2 in MATLAB?

I am looking for something like nextpow2 in MATLAB like this: P = nextpow2(A) returns the exponents for the smallest powers ...
8
votes
4answers
233 views

Is it possible to find generating functions of infinite sequences with Mathematica?

I'm trying to find the generating function of a sequence as $(0,1,0,1,0,1,\dots)$ but reading Mathematica's help on FindGeneratingFunction[] seems to tell me that ...
12
votes
2answers
4k views

Pass function or formula as function parameter

I can write either Integrate[x^2, {x,0,3}] or f[x_] = x^2 Integrate[f[x],{x,0,3}] and get the same computation. Suppose I ...
2
votes
2answers
71 views

Replace All using a list

I have a more complicated case however a basic example is; ...
0
votes
0answers
35 views

Input List of Images into a cloud deployed API function

I'm new to APIFunction and CloudDeploy, but essentially, here's my situation: I have a function (let's call it ...
1
vote
1answer
69 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
44 views

Derivative of conjugate multivariate function

I have a problem with Mathematica, taking the derivative of the conjugate of some function. I know that a similar question has been posed before here, but the solution did not work for multivariate ...
7
votes
3answers
187 views

Adding colors to graphic objects made with the new function AnglePath

The MMA 10.2 help gives many examples of AnglePath lines of code but all of them are of the same color and I am quite at a loss to devise a method to add colors ...
2
votes
1answer
153 views
8
votes
3answers
300 views

How to build a matrix from a set of vectors and other matrices using ArrayFlatten

I want to build a 6 by 3 matrix, from the following: one vector is 3 by 1, then a matrix, which is 3 by 2. These will go to the top 3 rows. Now the bottom 3 rows, I'll have 3 vectors each is 3 by 1. ...
0
votes
2answers
69 views

How does one define a function that takes vectors as arguments but also derivatives?

Summary: tldr; I just want to implement a version of the following mathematics function: $$ f(a) = c_1 e^{-(a - t_1)^2} + c_2 e^{-(a - t_2)^2} + c_3 e^{-(a - t_3)^2}$$ in mathematica, and be able ...
25
votes
2answers
567 views

Why is Query so much slower than Part?

Time for another of these(1),(2) as yet another new-in-10 function appears to have poor performance compared to older alternatives. This time: Query appears to be ...
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 ...
4
votes
1answer
104 views

How to apply RootLocusPlot correctly

I have to analyze the complex regions of variable c which is define obtained with InverseLaplace help in the form ...