Tagged Questions

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

2k views

Scan vs. Map vs. Apply

I cannot understand the difference between Apply, Scan, and Map. I have tried to play with ...
98 views

What function superseded SpaceForm?

In older versions of Mathematica you could use SpaceForm to leave a certain amount of spaces when writing to a file. For example, if we have the following data: ...
10k views

List of compilable functions

Is there somewhere a list on the functions that Compile can compile, or the cases in which a particular function can be compiled that I haven't found? I'd be glad ...
106 views

Conjugate[a/b + c/d]

Trying to obtain the result of Conjugate[a/b+c/d] only gives the same result. As such, I use Refine as: ...
16 views

2 functions in a package for CDF, 1 is OK 2nd is not working

I am developing a CDF application to teach me how to create CDF files. In this application I am taking numeric and symbolic integral of a function. I create package with two functions; 1-taking the ...
114 views

What is wrong with my code so it neither produces a correct plot nor an error message?

I am trying to define some initial functions and then using them to define my secondary functions and then plot the secondary functions. I am supposed to get two curves with a finite width ...
40 views

The function I defined is not giving any output [on hold]

Could anyone tell me why the function I have defined is not giving any output? When I run it, gen is not showing any output. Thanks! ...
116 views

Plot two curves and confidence bands representing the uncertainties in their parameters

Here is the plot I want to make using Mathematica 8.0 : ...
44 views

How to apply a function to a list, being able to use a list index inside of the function? [on hold]

In the documentaion I find things like: M = {a, b, c}; kappa[x_, y_, z_] := x PauliMatrix[1] + y PauliMatrix[2] + z PauliMatrix[3] kappa @@ M // MatrixForm But ...
83 views

Defining a function with algebraic parameters [on hold]

I am trying to define and use a function to represent the eigenstates of a Quantum Harmonic Oscillator, which have the general form: \psi_{n}(x) = \frac{1}{\sqrt{2^{n} n!}}\left(\frac{m \omega}{2 ...
37 views

finding list by expresion [on hold]

Well Im new to mathematica. I have list of x which contain {1,23,45,6,43}. And I get expression from g = Fit[t, {1, v, v^2}, v] how can apply list x to g to ...
229 views

Symbolically Expanding One-Variable $q$-hypergeometric Series

In general, how do I get Mathematica to symbolically expand various infinite series to an arbitrary degree of accuracy? I deal with $q$-hypergeometric series quite frequently, and specifically want ...
145 views

Check an inequality if one condition holds

A = Abs[-1 + 1/(1 + β)] + Abs[-((1 + 2 α + Sqrt[1 + 4 α + 4 α β])/(2 α + 2 α β))] Is A <1 if ...
194 views

How to get exact coordinate of a point from a plot?

I am using BodePlot[] to plot the magnitude and phase of a function as below. BodePlot[1000/((1 + s/10^3)*(1 + s/10^6))] ...
65 views

Extended AutoCorrelation Function

Is there a function in Mathematica capable of computing the sample Extended AutoCorrelation Function (EACF)? I know that there's a package in R that does this. I was trying to avoid to having to ...
3k views

Flatten command: matrix as second argument

One thing I could never wrap my head around is how Flatten works when provided with a matrix as the second argument, and the Mathematica help isn't particularly ...
54 views

How to plot a function whose constant parameters have associated uncertainties in Mathematica 8.0?

Let's assume I want to plot the function $f(x)=a + bx+ cx^{2}$, where experimentally known values of parameters $a, b$ and, $c$ are as follows: $a=1.01 \pm 0.18$ $b=0.92 \pm 0.11$ $c=2.2 \pm 0.2$ ...
23 views

Compiled function giving error CompiledFunction::cfct [closed]

I'm trying to compile this function LocalPotential below: ...
63 views

Interpolation of a vector [closed]

How can we use a sample data for interpolation of a function within a domain. But I need all interpolated values at once in a vector format. For instance, below I create a range of values for ...
48 views

Intercept in the ARProcess

In the ARProcess help file I don't understand whether an intercept is included or not. How would I add one? I am using version 9 of Mathematica.
57 views

Can I create a mouseover summary or documentation for a new function?

In Mathematica, when you hover any a built-in function, a small window with 2 symbols appears (as in the third paragraph of this reference page, see picture): clicking on the former one gives you a ...
43 views

Mathematica Empty Plot FourierSinSeries function

I'm trying to get a plot of different order Fourier series of the function x-1, why does Mathematica give me an empty plot? ...
80 views

Trying to create an interactive plot (newbie here)

I'm new at Mathematica so please bear with me. I am trying to create an interactive plot that will end up looking like this: I want to input values for certain variables and then plot a curve. This ...
39 views

FourierSeries command , for arbitrary period T?

ExptoTrig[FourierSeries[Piecewise[{{-Pi,-2Pi<x<=0},{Pi,0<x<=2Pi}}],x,3]] You can see, the function goes from $(-2\pi,2\pi]$ But Wolfram Alpha gives a ...
1k views

Why is there no PositionFunction in Mathematica?

Too often I have seen the programs of inexperienced users greatly slowed by using Position in an iterative fashion, when far faster would have been to compute a ...
237 views

Operations on transfer function model

Suppose I have a transfer function defined via TransferFunctionModel, e.g. tf == TransferFunctionModel[{{1/s}}, s]. How can I ...
51 views

Defining functions as derivatives

I'm working on a model that requires a sum over a function that uses various coefficients. In order to make the sum easier to perform, I am trying to keep things general through the use of a ...
135 views

Defining a matrix with elements acting as operators

This question is directly related with my previous one. I'll try to be more specific here. I have a matrix {{a[x],b},{c,d}}, where ...
52 views

What is this function aimed to do?

Table[Sum[tmatrix[[i, j]], {i, 1, 2}], {j, 1, 2}] apparently creates some sort of a table, and it evidently works on a matrix....although it is hard for me to understand what should it do beyond ...
60 views

Scan over regions of parameters

I have a function f which takes three arguments x, y and z: ...
29 views

Is this definition invalid? [closed]

I would expect this to find the minimum to be 0, while this seems to be thinking that the value is a (for all values? dunno) Plotting the function doesn't work ...
505 views

Problem with FindRoot applied to functions

I am having difficulty with the error "is not a list of numbers with dimensions..." when using FindRoot (and other numerical routines in Mathematica) to solve equations numerically when the argument ...
42 views

Is there any point to using a variable as a function parameter?

Normally one only sees patterns as function parameters: fun1[x_]:=x^2 Is there any point to using a variable in a function definition: ...
105 views

Function does not execute commands and fails to evaluate [closed]

The code I am trying to execute: hh[x_, y_] := x + y; hh[{3, 4}] The expected output: 7 However, on output I get ...
128 views

UI characteristic function [closed]

I have three given points: $\qquad$A$\qquad$(0; 5.9) $\qquad$B$\qquad$(18; 5.56) $\qquad$C$\qquad$(22.32; 0) I don't know how I can create a function like the one in the image below with ...
49 views

How to create a function that can be evaluated for specific values [closed]

I have been trying to create a function to compute a field and perform operations with it, however when I try to define it I have used: ...
103 views

Generalizing LongestCommonSequence to 3 or more arguments?

The function LongestCommonSequence finds a longest common subsequence between 2 lists. Apparently, this built-in function does not accept more than 2 arguments. How ...
36 views

Selecting terms on only one variable from a multiple-variable expression

Say I have a polynomial like $x y^2+15x^2 y+x+3y+10$ and I want to obtain, say, only the coefficient in $x$ alone, namely a 1. Using ...
1k views

How to take the derivative w.r.t. an arbitrary function?

EDIT: The answer posted by @Jens works for built-in functions only. However I'm starting to wonder if this is related to my Mathematica install somehow. I have version 7. Here is an example in the ...
23 views

Help Compiling Vectors using Iterations

So I have a nice code that runs properly, which I include below but, in my naiveté, I'm having issues iterating my procedure. Simply put, I have a function of two real variables $f(x,y)$ and I want ...
38 views

Extra restrictions in best response functions using Manipulate[ ]?

I have two best response functions that I have defined like this: ...
31 views

Parameterize Subset of Complicated Zero Set

I recently asked this question: Evaluating Functions on Zero Sets (of other functions), and got fantastic assistance, but realized that there seems to be an extra issue when you're trying to ...
113 views

Replacing multiplication of matrix elements by application of these elements as functions

I want to realize the following idea in Mathematica. I've got a matrix {{a,b},{c,d}} which is multiplied to a vector {h,k} ...
103 views

Evaluating Functions on Zero Sets (of other functions)

I have a highly non-trivial function, call it $f(x,y)$, in which I want to look at its zero set in the $(x,y)$ plane, and plot/evaluate a different function $g$ precisely along this zero set. I have ...
32 views

ApartSquareFree function

I have a doubt concerning the ApartSquareFree function in Mathematica. Roughly speaking, it is supposed to compute the partial fraction decomposition of a rational function $h/g$ with the denominators ...
110 views

What is ExpectationE and what does it do?

I just found the symbol ExpectationE with autocomplete. Rendered the symbol is Searching the documentation and the internet leads to nothing. Does somebody ...
133 views

Is it better to completely forget about the existence of PowersRepresentations?

I noticed that in several cases the performance of PowersRepresentations is hugely worse than that of IntegerPartitions. (Mma ...
35 views

Which the functions of parameters can use Span [closed]

As I know,ImageValue,PixelValue,ReplaceImageValue,...