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

learn more… | top users | synonyms

2
votes
1answer
81 views

How do I download and export data from many weather stations?

I tried this code, which downloads data from several weather stations. ...
1
vote
0answers
18 views

Import names into notebook namespace

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 value (e.g. 0) so I could execute in ...
0
votes
0answers
35 views

About the derivation of vector [on hold]

We know that the derivation of the function in the attached picture is aij. But how to use Mathematica to calculate this? I am new in Mathematica, thanks so much for your response!
0
votes
1answer
44 views

How can I use nonlinear model fit with multiple variables? [on hold]

I have a data set with four entries. the first three entries correspond to variables in the fit x,y, & z. The fourth entry corresponds to the function value. I am trying to fit this data to a rate ...
0
votes
1answer
39 views

How to properly use conditionals inside NDSolve

Currently I am working with Mathematica to learn the program, and I'm confused what exactly is wrong with this code. ...
4
votes
2answers
175 views

How do I plot my country map with weather data stations?

I've tried this code, but I can't plot the coordinates in my country map. ...
0
votes
0answers
43 views

StringLength function [duplicate]

allWeatherStations = WeatherData[]; fullformStations = FullForm /@ allWeatherStations; Tally[StringLength /@ fullformStations[[All, 1, 2]]]. This code not working. ...
-1
votes
1answer
111 views

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

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 ...
18
votes
5answers
1k views

Moving maximum function?

How can I construct a moving maximum function? For example, if I have a list of 12 values: { 5, 6, 9, 3, 2, 6, 7, 8, 1, 1, 4, 7 } and I want to maximize over 3 ...
0
votes
1answer
38 views

Replace element of matrix based on rule which invloves other element of same matrix

I am trying to replace 1s row of matrix d iteratively from right by multiplying last element in 1st row with (1-int*dt) to generate 2nd last element. The replacement continues till I reach the 1st ...
4
votes
2answers
105 views

Coarse-graining in numerical integrations

I have been working recently in a coarse-graining problem I found when using NIntegrate: I am trying to evaluate the function $$f(a)=\int_0^{\infty}x\,e^{-(a^2+b^2)x^2}\text{d}x$$ numerically as a ...
0
votes
0answers
47 views

How to replace a part of array based on certain rules which involves usage of other array

I am trying to replace outermost column of array "fd" in below code. fd is matrix of dimension (nas1,nts) which is initially filled with 1. I want to replace outermost column of fd with result of Max ...
0
votes
1answer
53 views
0
votes
0answers
48 views

to determine asymptotic value of function when N->infinity [closed]

To determine the asymptotic value of function for large value of N, given 'm' is much less than N i.e. in the limit N->infinity and m/N->0 $f(m,N)=\sum_{a=1}^{\lfloor N/2 \rfloor} \binom{N}{S} ...
2
votes
0answers
40 views

What is the difference between GenerateDocument and TemplateApply[NotebookTemplate[

Abstract GenerateDocument[ _NotebookObject ] seems to do the same what TemplateApply[ NotebookTemplate @ _NotebookObject ] ...
0
votes
1answer
78 views

Defining Solutions to FindRoot a functions of parameters-Part II

Here's a similar question as the the preceding question with the same title, but this time with vectors, which I need to use. I followed the suggestion in the answer the the previous question, but it ...
4
votes
0answers
82 views

Using an external Pattern breaks Format

I noted while writing this answer that using an external Pattern on Format doesn't work: ...
1
vote
2answers
136 views

How can I create function which contains an ODE system and its numeric solution?

I have created a function like the following, which contains an ODE system. And I want to know the effect of different parameters. ...
0
votes
2answers
155 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 ...
9
votes
1answer
295 views

solve ODE with divergencies

The solutions of the second order differential equation $$\frac{1}{\eta}\frac{d}{d\eta}\left(\eta \frac{df}{d\eta}\right)+\left(1-\frac{s^2}{\eta^2}\right)f-f^3=0$$ is shown in Fig. 5.2 below, for ...
1
vote
1answer
44 views

Imaginary terms in the derivative of Jacobi theta function (2) on the real line

I am trying to calculate/plot the derivative of the second Jacobi theta function $d\theta_2(0, e^{-\pi t} )/dt$. Calculating or plotting the function itself works fine: ...
15
votes
6answers
1k views

Will Version 9 functions all work in Version 10?

Having developed a substantial code base in Mathematica 9, leads me to ask these important questions prior to downloading and installing Mathematica 10. Will any Mathematica functions from the ...
7
votes
2answers
184 views

What does IndexBy do and how exactly does it work?

I just saw the function IndexBy in the autocomplete suggestions and I was curious to know exactly how it works. Unfortunately, there's no trace of it in the ...
21
votes
3answers
791 views

DeleteDuplicatesBy is not performing as I'd hoped. Am I missing something?

Déjà vu: a new-in-v10 function should provide a better solution to an old problem, but my enthusiasm is curbed when I run timings. This time the function is ...
1
vote
1answer
63 views

How to Reap data from a ScheduledTask?

Here is an amusing little function mapped over a range just to iterate it. It ignores its argument and works entirely by side-effecting a global variable: ...
3
votes
1answer
153 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
34 views

How to string Replace? [closed]

I Tried StringReplace[#, "0." -> "0"] & /@ aaa["Path"].But doesn't worked. aaais ...
2
votes
0answers
42 views
1
vote
0answers
36 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
82 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
0answers
70 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
35 views

How to have default case in Which? [closed]

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 ...
-1
votes
0answers
40 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
64 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
422 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 ...
7
votes
2answers
105 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
58 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
69 views
0
votes
1answer
200 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
59 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
63 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
141 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
207 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: ...