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

learn more… | top users | synonyms

5
votes
1answer
71 views

Shadowing of optional function arguments?

I am trying to define two different packages that process some information in a different way. These packages have functions into them with optional arguments. The names of the optional arguments ...
1
vote
1answer
60 views

Transposing X and Y on a plot [duplicate]

This question has appeared in many forms online, but none directly apply to my problem. I have a quite complicated, albeit bijective function of the form ...
2
votes
0answers
43 views

Computing an inexact derivative with some terms preserved in exact form

I am beginning to learn Mathematica and have the following question: How can I return a derivative with exact numbers instead of one involving numerical approximations? My original, single variable ...
2
votes
1answer
172 views

Making Mathematica function files like in MATLAB

I'm a MATLAB user trying to get familiar with Mathematica. I have long Mathematica sheet that spits out some matrices at the end after much math. I want to run a loop over couple of different initial ...
3
votes
2answers
66 views

understanding a mathematica equation

I have found the equation below written with Mathematica, I looked at the Mathematica online guide but it is still difficult to understand the equation. Can someone write this (or part of it) in ...
1
vote
1answer
51 views

How to reduce trigonometric expressions under special conditions

For the following problems I used "FullSimplify" and "TrigReduce" but I manage to reduce more ...
4
votes
3answers
370 views
5
votes
3answers
111 views

Encapsulated plot function misbehaves

To insure a collection of plots has identical appearance, the plot command is encapsulated in a function. The results are undesirable. The fiducial plot is ...
2
votes
1answer
97 views

Missing zero in the CoefficientList

The following list has a length only 10 (not 11) CoefficientList[Series[ArcTan[x]/(1-x^2),{x,0,10}],x] {0, 1, 0, 2/3, 0, 13/15, 0, 76/105, 0, 263/315} It should ...
3
votes
5answers
179 views

Converting multi variable expression into a function

So I have this rather complicated looking expression ...
0
votes
0answers
56 views

Which method to use for finding maximum without actually computing optimization function explicitly?

I am new to Mathematica and I am currently working on an optimization problem. The optimization function that I have easy to calculate for some assignment of variable but it is very difficult to ...
3
votes
1answer
166 views

I want to construct a function than the output is “Sequence”

For example if the input is x and x<10 the output is Sequence[x,0],if x>10 the output is Sequence[0,x] but obviously ...
2
votes
1answer
91 views

How can I run a summation numerous times?

I have been working on code for finding the Allan plot of generated white noise, however, I cannot figure out a way to automate it for a different range of numbers. My code is as follows: ...
2
votes
0answers
39 views

Marginal distribution with weight

Given a multi-variate distribution $P(\mathbf{x},\mathbf{y})$, I would like to obtain the marginal distribution $$P_m(\mathbf{x})=\sum\int_{\mathbf{y}}P(\mathbf{x},\mathbf{y})W(\mathbf{y})$$ In my ...
17
votes
1answer
352 views

What are SparseArray Properties? How and when should they be used?

A strange undocumented form of SparseArray is increasingly used in answers on this site: ...
0
votes
0answers
63 views

Polynomial interpolation using Neville's Algorithm

Is there an interpolating function in Mathematica which uses Neville's algorithm? I have written a C++ program to do interpolation using Neville's algorithm and I am getting a small difference ...
4
votes
1answer
86 views

How to create fast functions based on units?

Using units is a good means for rapidly developing code, since it provides some error control. Hovewer, using Mathamatica functions containing units appears to be copmutationally inefficient. ...
14
votes
0answers
211 views

Is FullGraphics an abandoned function? Is there an alternative?

FullGraphics hasn't worked entirely for a long time and the situation appears to be getting worse instead of better. In Mathematica 10.0 and 10.1 a simple usage ...
0
votes
0answers
36 views

Attributes of statistics functions

Do statistics functions have some kind of attribute which ignore non-number (Indeterminate, ComplexInfinity, calculation "errors") elements of a list?
2
votes
1answer
70 views

Computing large nested values

Is it possible to compute a value for n=10^9; Nest[# + Log[#] &, 2., n] for large n? $10^9$ seems to be the max for me - ...
0
votes
3answers
90 views

beginner's question: change a parameter while get variable answers [duplicate]

I'm new to Mathematica from R, since R is not quite good at dealing with the following problem. Say, i want to solve the function a x - 10 = 0. Each time I change the value of a, say, from 1 to 10 by ...
0
votes
0answers
47 views

Errors when changing variables

I have the following function : K[r_, h_] = -(D[h[r], {r, 2}] + D[h[r], r]/r + D[h[r], r]^3/r)/(2 (1 + D[h[r], r]^2)^(3/2)) In order to adimension it, I am ...
0
votes
2answers
70 views

Continuity of function-example

I'd like to examine the continuity of the following function: f[x_] := Limit[(n^x - n^(-x) ) / (n^x + n^(-x) ), n -> Infinity] I know that this function isn't ...
17
votes
0answers
236 views

Performance problems in new Sequence functions

The new-in-10.1 Sequence* family of functions should provide newly optimized methods for handling sequence problems. Happily in some cases they do! For example ...
5
votes
1answer
85 views

Handy dates conversion

I feel like something very basic is missing me, $dateformat = {"Year", "Month", "Day", "Hour"}; date = DateString[$dateformat] DateString["Date"] ...
16
votes
1answer
254 views

In 10.1.0 BenchmarkPlot doesn't work?

In Mathematica 10.1.0 BenchmarkPlot from the GeneralUtilities package doesn't work; copying Taliesin Beynon's initial use of the function on this site: ...
1
vote
1answer
78 views

How to construct a kernel from a function?

I would like to convolve an image with a mathematical function. I understand that I need to have the mathematical function in a matrix form. How can I build it? Thanks
2
votes
2answers
97 views

Creating a Cayley's table of square

I'm interested in creating a Cayley's table of square using Mathematica. I'm not a programmer but occasionally resort to using Mathematica to simplify my work insofar as the programming doesn't take ...
1
vote
1answer
104 views

Understanding `FixedPoint`

I understand that FixedPoint[(# + 2/# )/2 &, 1.] can be written ...
0
votes
0answers
24 views

Fibonacci series up to 300 terms [duplicate]

I tried to generate a list of Fibonacci numbers up to 300 terms and gets a runtime error. f[0]=0; f[1]=1; f[x_]:=f[x-1]+f[x-2]; Table[f[x],{x,1,300}] Is there ...
19
votes
2answers
230 views
0
votes
1answer
68 views

Creating Function with String Input

I am trying to create a function that needs to transform the input into a string. The objective is transforming a latex input into a calculable mathematica expression. ...
0
votes
1answer
52 views

Question about a catalytic equality?

I have a question on math.SE that explains how I came up with these equations. ...
2
votes
3answers
137 views

truncated square wave input

I'm investigating the response of some dynamic system on Mathematica and I want to generate a tailored square input like the one in the following picture: Does anyone know how to generate such input ...
-2
votes
3answers
64 views

Two unrelated questions: 1. Output of Series[] for function, 2. Output conditional answers as if not conditional [closed]

As mentioned in the title, I have two questions. 1. I have code that looks similar to: ...
1
vote
2answers
73 views

How to stop FullSimplify from returning Root objects

I have several expressions in a series, such as 1/4 (-(1/4) + Sqrt[5]/4 + I Sqrt[5/8 + Sqrt[5]/8]) (-1 - Sqrt[5] + 2 Sqrt[7/2 + (5 Sqrt[5])/2]) If I run ...
-3
votes
2answers
83 views

Random Polynom Plot [closed]

I should write a module "RandomPolyPlot[n, amin, amax]" which calculates all roots (nulls) of a n-th degree polynomial function. Then I should illustrate it on the complex plane. I also should ...
3
votes
1answer
72 views

Why minimization does not work with symbolic array as arguments

If I try to minimize with constraints a function of several variables, with Gamma regularized function involved in the constraints it seems to works, as shown below (this is just a dummy example ...
1
vote
2answers
93 views

Get the sum with cases

I have the following list: list = {{1, 2}, {2}, {3, 4, 1}, {5, 4}, {3, 3}, {a, b, c}, {e, f}, {g}, {}, {Sin[a], Cos[b]}}; I should use ...
-3
votes
2answers
84 views

Write a function, write a pattern [closed]

I have the following list: list = {{1, 2, 4}, 6, 7, 8, {8, 2}, {3, 4}, {4, 5}, {1, 2, 3, 1}}; (a) I should write a predicate-function in combination with an ...
0
votes
0answers
28 views

Why don't we use SetDelayed when we use placeholder to declare a function? [duplicate]

On the answer of http://stackoverflow.com/questions/4272067/what-does-mean-in-mathematica Typically when we declare f(x)=x^2 function, it is: f[x_] := x^2 But ...
0
votes
0answers
40 views

How can I put the results of TrigReduce function into a more convenient form? [duplicate]

a1 D11 Cos[n x] + a0 a1 D11 Cos[n x] + 1/2 a1 a3 D11 Cos[n x] + 1/2 a2 a4 D11 Cos[n x] .......for example this expression can be written like ('expression') * ...
2
votes
1answer
106 views

How to run code in a saved file when it is opened

I have a Mathematica file that I saved. In it, I have multiple functions that I've defined and have evaluated a number of the functions with different arguments. I would like to be able to open the ...
1
vote
1answer
67 views

Defining a Function

I've been reading about functions in Mathematica and playing with this for hours, but I'm clearly missing something. The following code correctly calculates "fail", the number of failed scenarios. I ...
1
vote
1answer
161 views

Create a function with Dt[x] as a variable

I have a function (for example F[x_]:=Cos[x]). I want to define a function like Fdot[x_,xdot_]:=Dt[F[x]] where xdot represents Dt[x]. For example, to define Fdot one might naivley try ...
1
vote
0answers
27 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
1answer
84 views

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

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 ...
2
votes
1answer
115 views

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

I tried this code, which downloads data from several weather stations. ...
0
votes
1answer
65 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. ...
0
votes
0answers
44 views

StringLength function [duplicate]

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