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

learn more… | top users | synonyms

-1
votes
0answers
52 views

Swing of the pendulum - question update

I would like to visualize a swing of the pendulum. I want to write a function springmass[z, nzigzag], which will draw the spring (line) and the swinging weight ...
3
votes
2answers
53 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 ...
-3
votes
0answers
21 views

physics - swing of the pendulum [duplicate]

I should visualize a swing of the pendulum. I should write a function springmass[z, nzigzag], which visualize the spring (line) and the swinging weight (rectangle) ...
1
vote
1answer
44 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
343 views
5
votes
3answers
102 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
93 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
170 views

Converting multi variable expression into a function

So I have this rather complicated looking expression ...
-2
votes
0answers
17 views

How many workers each company have? [closed]

If total there are 90 workers between 2 companies and one company have 16 more workers then the other. How many each company have?
0
votes
0answers
50 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
157 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
88 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
25 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 ...
0
votes
0answers
18 views

Need help with a hyperbola/parabola equation solving for an assignment [migrated]

Hi so i was given my Math C assignment today and the moment i looked at question 1 i knew i had no idea what to do. This is the graph i was given (http://imgur.com/nRXOlJy). I was asked to provide an ...
13
votes
1answer
274 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
27 views

How to refine the approximate solution of an implicit function? [closed]

I have an equation of the form exp(A(C-x))-1-exp(x-B(C-x)^(2/3))=0 Here A,B and C are constants, x is the unknown, I want to find, but approximate value of x is known. so, the problem is how to get ...
0
votes
0answers
41 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
73 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. ...
10
votes
0answers
138 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
34 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
79 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
60 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 ...
12
votes
0answers
167 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
74 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
226 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
70 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
81 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
99 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
223 views
0
votes
1answer
53 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
50 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
125 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
61 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
64 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
80 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
65 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
89 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
76 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
27 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
99 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
62 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
105 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
26 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
60 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
105 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
52 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. ...