Questions tagged [functions]

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

235 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
79 views

Plotting Asymptotic Series

I apologise for being always here asking for the same questions, but I need to learn. I have to plot this series $$\frac{\pi}{2} - \frac{\cos x}{x}\left(\sum_{k = 0}^{+\infty} (-1)^k \frac{(2k)!}{x^...
1
vote
0answers
47 views

Extracting elements with a certain criteria from a pre existing list

Here I take just a random list of triples of size 10 ...
1
vote
0answers
104 views

ListDensityPlot erroneously showing flat regions (NOT plot range issue)

I have a dataset (listed below). I'm trying to plot the dataset using ListDensity plot; ...
1
vote
0answers
308 views

Defining a piecewise function where the conditions are points

I am trying to define the following function in Mathematica: $$pw=\begin{cases} x y \cos \left(\frac{1}{x^2+y^2}\right) & (x,y)\neq(0,0) \\ 0 & (x,y)=(0,0) \end{cases}$$ I want to use this ...
1
vote
0answers
224 views

An array of functions

I need to define an array which every entry is a function. To be more specific, I want to solve the equation: $$\frac{d \rho}{dt} = -i[H, \rho] + L[\rho]$$ in which $\rho$ is a matrix. This is a ...
1
vote
0answers
70 views

The wire frame from a Plot3D gives a jumbled mess for a wire frame

Some time ago I found a post that turned the triangles of a mesh into polygons. I have spent 2 hours looking for that post and can not find it. The problem: Plotting ...
1
vote
0answers
231 views

How to get user input using FormPage

I am designing a user interface for a word-ladder game using CloudDeploy, CloudExpression and FormPage and I am having trouble with receiving the user input from the form. What I basically need is a ...
1
vote
0answers
55 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: ...
1
vote
0answers
38 views

Function with many lines that takes image as parameter not returning same result as if I run the same lines of code

Running the exact same lines of code in a function produces just a return of the original image without any points identified, whereas when I run the exact body of the function line by line it works ...
1
vote
0answers
80 views

Finding correct combination of functions

I am trying to write code where I have an array $S$ or numbers in any order [5,4,2,1,....] Then I have a specific set of functions that I can write. ...
1
vote
0answers
191 views

Help with calculating a complicated integral

Edit: The question is solved : )) Thank you for your attention ! I am sorry for mass questions, but the question bothers me a lot. So I would like to ask this question here. This problem arises when ...
1
vote
0answers
51 views

When evaluating this integral Mathematica returns two different answers

When evaluating this integral in Mathematica 10.3 Student Edition: ...
1
vote
0answers
46 views

Defining an object which is function in some variables and tensor in some other indices

I am trying to define an object which function in some variable and tensor in other indices. My attempt at it was: ...
1
vote
0answers
102 views

DiracDelta of a function

If I have, for instance, FunctionExpand[DiracDelta[x^2+x-3]] it evaluates to ...
1
vote
0answers
85 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 ...
1
vote
0answers
239 views

How to simplify an expression with a radical sign nesting in a radical sign

Is there a function can simplify an expression with a radical sign nesting in a radical sign in Mathematica? I use V9. RatDenmon is a function that can ...
1
vote
0answers
68 views

Input `Reduce[Mod[a + x, l] == 0, x]' and output `x == -a + kl`?

Reduce[a + x == k l && k > 0, x] (* k > 0 && x == -a + k l *) I think a + x == k l and ...
1
vote
0answers
99 views

What are the differences between these functions when used for NMaximize?

In short, the question is how to construct the function you want to optimize? ...
1
vote
0answers
95 views

Improving RationalInterpolation Result

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

Crosscorrelation for nonperiodic signals

I want to detect patterns (of an absorption spectrum which is nonperiodic) with Mathematica automaticly. I have found CorrelationFuncion but as far as I understand, ...
1
vote
0answers
221 views

RowReduce doesn't work for this matrix?

I have this matrix A={{0,1,1,w},{1,0,1,x},{-1,0,1,y},{0,1,1,z}} where w, x, y, z are arbitrary constants. This matrix should be row reduced to the form ...
1
vote
0answers
61 views

Is it possible to calculate with declarations only?

simple Example: maximize $u(x), x$ solution would show constraints: $\frac{\partial u(x)}{\partial x} = 0$ $\frac{\partial^2 u(x)}{\partial x} < 0$ etc... or do I always have to explicitly ...
1
vote
0answers
417 views

Expression for evaluating multiple functions?

I am constructing 3D data points for a plot and corresponding to specific conditions "manually". I define the values of five parameters [these I always have to define myself]. From those, I evaluate ...
1
vote
0answers
82 views

Distinction between 2 NETTypeInfo answers

In a NETLink application I checked all the types offered by LoadedNETTypes[] according to the following: ...
1
vote
0answers
95 views

Decapitating “explicit” and “implicit” heads

This is a follow up to this question. So far, I named "explicit" heads to those that appear explicitly in the expression. For example, f[x] has an explicit head. I ...
1
vote
0answers
202 views

parameter NDSolve

the question I need to solve is: t x'[t] == -x[t] + y[t], t y'[t] == -5 t^2/x[t]^2 + x[t] - y[t], x[1] == 4, x[b] == 1 in order to solve the coupled ...
1
vote
0answers
165 views

CDF with numerous independent manipulate objects

I have been working on my senior project that involves the creation of a CDF with multiple Manipulateexpressions. I need to protect my code so I have been trying to ...
1
vote
0answers
164 views

Does Graphics`Mesh`SimplePolygonQ[] work for you?

Graphics`Mesh`SimplePolygonQ is an undocumented function. I'm using Mathematica 7, and when I try: ...
1
vote
0answers
110 views

Solving for vector elements in a function to which the vectors are not passed explicitly

I want to define a function which takes in two integers (indicating the lengths of 2 vectors), and solves a simple set of expressions at a set of points to find all the values in both the vectors. so ...
0
votes
0answers
50 views

Simplifying polynomial fractions with same `DiracDelta` function in both denominator and numerator

I am trying to simplify an expression with multiple Diracdelta functions in both numerator and denominator. For example, ...
0
votes
0answers
35 views

Defining a function and order of operations

I feel I have a profound misunderstanding of how Mathematica works. Here's an example that confuses me: Say that for a matrix $A$ I want to extract the first $\mathrm{Tr}(A)$ normalized eigenvectors (...
0
votes
0answers
43 views

Delayed Rule right-hand-side mis-evaluation

Outline I am trying to create a rule that will give me a minus sign if the number of times A is applied on X is odd where A is some οperator and X a random quantity. Some of the configurations of ...
0
votes
0answers
27 views

Creating a special product function

I am having trouble working with lists inside functions with Mathematica. Basically, I have a list of numbers and a special way to multiply them. I want to have a function that is able to create a ...
0
votes
0answers
37 views

Get R^2 value between interpolating functions and a list of points

I am looking to compare the degree of accuracy of a theoretical model by comparing my theoretical curve to my experimental data points. My theoretical curve is an interpolating function generated ...
0
votes
0answers
45 views

Define a function including two solve solutions

I'm trying to combine the solutions coming from two NSolves and define a new function that I've to integrate. Basically I've defined two ...
0
votes
0answers
19 views

InverseFunction cannot evaluate negative arguments

I have difficulty figuring out where my code fails. I want to obtain $\textbf{ry}$ which is the inverse function of rho (see below). When I input positive values for its argument, there's no problem. ...
0
votes
0answers
28 views

Easiest way to simultaneously keep track of two values in a list

I have a bunch of functions a,b,c,... that all take in a list of images and return a list consisting of a list of transformed images, and a number (let's call it ...
0
votes
0answers
76 views

NSolve not solving my transcendental equation

Would be grateful for your help in tackling this complex polynomial where I am trying to solve for x. When I run the code below, I get the message: value x of ...
0
votes
0answers
24 views

Factor[p(x), a, b] not working in Galois theory package

I have downloaded Galois theory package from http://library.wolfram.com/infocenter/Articles/2872/ and I currently have Mathematica v 12.0. When I loaded the module (I needed to delete the blue stuff ...
0
votes
0answers
35 views

Define the partial derivatives of a multivariable function

I have some vector $K = [K_1, K_2,...K_n]$ which is a function of variables $(x,y)$ i.e. $K = K(x,y)$ I want to symbolically calculate the partial derivatives e.g. $\partial_x K$, $\partial_x \...
0
votes
0answers
49 views

How to turn an algorithm into a function

I have written a script to help me find the several local minima of a dataset. It takes two arguments: the dataset list and an x-coordinate value that tells the script from where to start looking for ...
0
votes
1answer
98 views

Automating a large operation by making a function

I would like to automate the following operation. To be transparent I shall put my code into separate chunks and explain the process. Suppose I have the following: ...
0
votes
0answers
34 views

How to define a function in an implicit form

Know the 2-variables function $F(x,y)$. How can I define the function $x\to f(x)$ s.t. $F(x,f(x))=0$?
0
votes
2answers
80 views

Array of polynomials

So I have a big list of 75 polynomials which I need to apply a sequence of operations to. My original program (an extract of which is below) worked fine: ...
0
votes
0answers
47 views

Function works outside For loop but not inside, and loop fails spectacularly

I'm building two lists, each to carry a different representation of the same set of objects. One list, list2, is constructed first; then the second list, ...
0
votes
0answers
65 views

How to list all the possible functions of given structure?

I can run this command : Tuples[{ Tuples[{x, y, z}, 2], {a, b, c}}] to list all combinations that looks like: ...
0
votes
0answers
39 views

Function iteration

I wrote a function in Mathematica that applies certain construction steps on the "incidence matrix" of a graph in order to obtain a new graph with certain properties. These construction steps can be ...
0
votes
0answers
87 views

Problem with fitting

So I have a very simple question related to a simple topic, but also directly related to a fitting problem. I see that my question is related to this question but I don't manage to make the bridge ...
0
votes
0answers
40 views

Obtaining the equation type of an interpolated function

I used InterpolatingFunction on a set of points. How can I know the type of that equation ? (polynomial, sinusoidal, logarithmic,etc...). I am looking for a general case answer. Here is an example ...
0
votes
2answers
59 views

Problems with creating a matrix with functions

I have a function which gives me all the coordinates of a certain bloc in a lattice (with the help of another function for rows and columns): ...