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

learn more… | top users | synonyms

1
vote
1answer
4 views

How do I create an array by applying a function to the index of each element?

I am looking for something like matrix(m, n, f), but for Mathematica rather than MuPAD, and for arrays rather than matrices. That is, I'm looking for a(n ...
0
votes
0answers
14 views

How to string Replace?

I Tried StringReplace[#, "0." -> "0"] & /@ aaa["Path"].But doesn't worked. aaais ...
0
votes
1answer
40 views

need help to price a european option using finite difference method [on hold]

I am writing a function to price European option using backward induction finite difference method. The function is expected to price a European option taking Stock (stock_), age (time_), volatility ...
2
votes
0answers
39 views
0
votes
2answers
89 views

FindShortestTour to solve Traveling Salesman Problem

I'm trying to write my own code to find the shortest route but I'm lost on how or where to start. Does anyone have any idea how the FindShortestTour function works? What type of algorithm or structure ...
1
vote
0answers
35 views

Optional arguments with lists as function parameter

I'm developing a function to process 3D data volumes which is very similar to ImageTake and should support the same optional arguments. ...
39
votes
2answers
4k views

What is so special about Prime?

When we try to evaluate Prime on big numbers (e.g. 10^13) we encounter the following issue : ...
0
votes
1answer
79 views

Can we say that “all functions in Mathematica are some kind of pattern-matching-and-replacement procedures”? [duplicate]

Currently I am studying Mathematica programming, and when I study pattern matching and replacement, I find it is quite similar to functions. So can we say "all functions in Mathematica are some kind ...
0
votes
1answer
51 views

How to export Time Series Data? [on hold]

I can't simply convert it to a list Normal аnd to export. I tried many times. But not successfull.
0
votes
0answers
69 views

How can I use L.Shifrin s code formatter package better

in the document of HoldAllComplete, it says: Evaluate cannot be used to override HoldAllComplete.. for example, when I'm ...
0
votes
1answer
33 views

Creating a stream plot of nonliner diff equations [on hold]

How would I create a stream plot (of eccentric closed curves) out of the following two equations ...
0
votes
0answers
42 views

Optimal placement of points in 2D system [on hold]

I woluld like to ask, how to arbitrarly place i.e. deploy (points) in 2D system, in such way to be with the nearest distance to previusly defined paths? Thanks!
0
votes
1answer
34 views

How to have default case in Which? [on hold]

Saying we have a function: a[x_] := Which[x === 1, "AAA", x === 2, "BBB", _, $Failed] How can I make this function to be equal to ...
0
votes
0answers
27 views

Why does the following NDSolve command not work [on hold]

I am trying to use the following NDSolve command however it does not work and I do not know why. The command is ...
-1
votes
1answer
38 views

How can I define a function to make symbols? [duplicate]

I want to define a function that makes symbols like this: L[1] A1 L[2] ...
1
vote
1answer
61 views

Why is the Spherical Bessel Function acting strangely at this point?

I'm doing some computation that requires the use of Spherical Bessel Functions of the 1st kind, at high orders and values. So, I managed to find this, while running it over a wide range of values. I ...
22
votes
1answer
417 views

Why does list assignment with a packed array result in unpacked values?

Bug introduced in 5.2 or earlier and fixed in 10.1.0 This is another question on the design choices in Mathematica. I understand that without direct reply from the developers it may not be ...
-1
votes
0answers
35 views

A moving point on a parametric curve [on hold]

When trying to draw a moving point on my parametric curve I did that: ...
7
votes
2answers
101 views

How to create a dynamic expanding DisplayForm's styled like the ones in v10?

The display forms for objects like ClassifierFunction are nice clickable boxes I like this, and now I'm trying to create my a custom version of this for my ...
1
vote
1answer
94 views

How to fill a Marshal buffer with whitespace using NETLink

Further to Todd Gayley's answer on string handling in a DLL function, I have the following code: ...
1
vote
1answer
56 views

Computational Complexity of HyperGeometricPFQ

What is the computational complexity of HypergeometricPFQ? I got a result of a product of a multinomial and HypergeometricPFQ and I was wondering if that would be considered a closed form solution ...
11
votes
1answer
169 views

Compability between Graphics coordinates and shifted projections in GeoGraphics

Edit 27.01: Confirmed bug. V. 10.0.0 - V. 10.1.0 I'd expect GeoGraphics to handle positions of points since they are provided ...
3
votes
1answer
56 views

LineScaledCoordinate problem for exact coordinates

Edit: Confirmed bug. CASE:2326540. Still the case in V 10.1. Solution: Wait and use N meanwhile. I've faced this problem ...
0
votes
1answer
68 views
0
votes
1answer
193 views

mathematica apply list of functions to the same arguments [closed]

EDIT: "Through" is partial solution, because it cannot be used in expressions, where these functions are used without arguments. How can I apply list of functions to the same arguments? e.g. ...
0
votes
1answer
55 views

Calculating functions of sounds

I've seen that it is possible to create a sound from functions: Sound[{Play[Sin[1000 t (1 + t^2)], {t, 0, .2}], Play[Sin[500 t (1 + t^3)], {t, 0, .5}]}] Is is ...
6
votes
2answers
59 views

Maximise output issue

When I execute the following command, I get a numerical output as follows: ...
1
vote
1answer
136 views

Manipulate - Evaluating Value of Function

I would like to visualize the properties of a threshold, which is a value of a function. Unfortunately, the value is expressed as scientific value (an approximation with 3-5 decimals would be fine) ...
10
votes
4answers
3k views

How can I differentiate Numerically?

Mathematica has two ways to integrate: Integrate and NIntegrate. But what about D? ...
1
vote
3answers
139 views

How to calculate time period?

I have the starting and ending dates and times. And I need to calculate the night time in this period (from 10 pm (22) to 6 am (6)). Example: starting date and time is {2015, 1, 4, 3, 10} ending date ...
6
votes
4answers
204 views

What is shorthand way of Reap list that may be empty because of zero Sow

Sometimes because of conditionals, you cannot guarantee that Sow will be called at least once. Reap[Sow[1]][[2,1]] results in ...
0
votes
0answers
39 views

Procedure argument value change [duplicate]

I'm trying to create my own hamiltonian cycle algorithm using Mathematica for school, and I'm stuck on a syntax issue. I get the following error: ...
0
votes
0answers
43 views

Passing integration constants to self defined function

I would like to evaluate an integral I am taking in cylindrical coordinates, in which the integrand contains a previously defined function. I need to pass the r and phi integrand values to this ...
0
votes
0answers
38 views

codes for random rational function [closed]

I am in the extension of getting the expected real roots of random algebraic polynomials, and I'm wondering if I can apply this concept to a rational function. My problem is about the codes. What ...
0
votes
0answers
50 views

Improving RationalInterpolation Result

The following code produces a {4,4} rational interpolation approximation accurate to 10^-6 or better over the range ...
0
votes
3answers
37 views

Define a function of a vector without fully specifying the components of the vector [duplicate]

I have a vector $A=\{1,2,3,4,5,6\}$, and I want to define a function of $A$ as f[A_]:=A.X where $X$ is another vector. I want to define this function without ...
1
vote
2answers
58 views

How to make function accept list of rules as an argument?

Considering the list of rules: r= {"a" -> "1", "b" -> "2", "c" -> 3, d -> 231, "e" -> 1.25}; I want to have a function ...
0
votes
0answers
46 views

How to make Piecewise continuous [duplicate]

I have a function defined by its slope in a continuous sequence of intervals, e.g. ...
11
votes
0answers
133 views

Default behaviour of Hash[expr] and hashing in different versions of Mathematica

In different versions of Mathematica, Wolfram silently changed the behaviour of Hash when the algorithm is not specified explicitly ...
7
votes
0answers
123 views

More Ticks::ticks errors in AbsoluteOptions in v10

Bug introduced in 10.0.0 . Bug remains as of 10.1 While the specific bug affecting Plot described in AbsoluteOptions prints error messages in V10 has been fixed ...
0
votes
1answer
67 views

Codes for the derivative of a random polynomials

Good day! Please, I need some help here, I used this codes ...
1
vote
3answers
125 views

Simplify a composition of functions

How do I make Mathematica simplify, for example, (1-#&)@*(1-#&) into #&? ...
1
vote
2answers
119 views

Minimizing the largest difference between two functions

I have two functions defined on the same domain, $f(x)$ and $g(x)$ where $x$ is in $(0,1)$: f[x_] := (-1 + x) Log[1 - x] - x Log[x] g[x_] := Log[1 + 2 (-1 + x) x] ...
0
votes
3answers
118 views

How to define a function

How can I define a function which depends on a function of x? Something like this f[u[x]_,u[x]']= u[x]' + a [x] u[x] +b[x] I think I wasn't enaugh clear. If I ...
3
votes
2answers
126 views

What's real analogue for FromDigits?

FromDigits only works for integer strings. What's its real-number analogue?
2
votes
2answers
57 views

How to apply list of values to a list of functions

I have the following: first= {1+a,2+a,3+a,4+a} and a list t={0,1,2,3} I want to evaluate the first element of "first" at ...
1
vote
1answer
33 views

Calculate the partial vapor pressures of a variable at xB = 0.75 based on the interpolation functions of the data

I'm having troubles in solving an exercise for an assignment in my Chemistry course. Talking about interpolations, I've already have a graph but I need to:(c) Calculate the partial vapor pressures of ...
0
votes
3answers
78 views

Using Solve to obtain a constant so that f(x) is continuous at x=2

I need to solve for c such that the function is continuous at x=2. How do I do this automatically? I have expressions for ...
2
votes
1answer
69 views

How to package a function for export?

I often post code for functions on Stack-Exchange, and then later find that they are unexecutable - that people can't use them because I mistakenly omitted some private functions or values that are ...
5
votes
1answer
67 views

Using a progress bar in a functional expression

If we have a procedural construct like a Do loop or Table, it is straightforward to make a progress bar to indicate the percent ...