Questions tagged [functions]

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

234 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
50 views

How to exclude some methods?

Can I exclude one or several methods from methods tried by a function? When we use some 'algorithm-intensive' function, we can often specify whether we want to proceed according to the chosen method ...
0
votes
0answers
52 views

How to handle exceptions and failures in Mathematica?

In python I can write fallback values like: ...
0
votes
0answers
56 views

Plot BV functions with singular derivatives in multiple space dimension

In 1-dimensional setting, two key examples of $BV$ functions (of bounded variation) $u: \mathbb R \to \mathbb R$ are the Heaviside function, whose derivative is the Dirac delta concentrated at $0$. It ...
0
votes
0answers
56 views

Problem with arc length

...
0
votes
0answers
47 views

Discrete convolution power

In my previous question we have discussed the posibility of various definition of convolution of power function within Mathematica. Now the question is "How to define convolution power in Mathematica ?...
0
votes
0answers
22 views

Acquire a single-variable function by slicing a 3d graph along a given line

Consider my Calculus 2 math problem: Given a function f[x,y]=x^2-3xy and two vectors a = {1,2} and b = {1,1}. Spanning a linear ...
0
votes
0answers
31 views

To assign an array to a function

// Pre-defined parameter kS = 2*(\[Pi]*NefS)/LambdaSS; Here, NefS is a function of LambdaSS. The matrix m (i,j) defined corresponding value of NefS (jth ...
0
votes
0answers
26 views

How attribute a restrition for a variable inside a function

I have a function like this way: f[x_] := x + 2; In[148]:= f[b + 2] Out[148]= 4 + b How to impose a condition that the variable ...
0
votes
0answers
42 views

Imposing conditions on argument for a function definition

Suppose that I wish to use "Piecewise" to merge two different interpolating functions (obtained via a NDSolve of some ODE), defined over negative and positive arguments respectively, like: ...
0
votes
0answers
31 views

How to automatically see user defined function arguments list?

Having typed a user-created function's name I would like to be able to see either the concise syntax dropdown available for inbuilt functions (shown below left) or alternatively to be able to see the ...
0
votes
0answers
73 views

How to copy a function/list/array without reference

I have code that runs in a loop to generate a function that has values assigned every multiple of a user-supplied step size. I want to copy the final function "value-wise" to a different function so ...
0
votes
0answers
42 views

Defining a derivative as a function does not work

I have a fairly complicated function VIcase1L[b_,\[Epsilon]_, d_] := ....... All I wanted to to was to derive it this function with respect to b and define it. ...
0
votes
0answers
27 views

Minimum of explicit functions in vector form

For fun, related to this question about minimizing implicit functions, how can I find the minimum of an explicit one expressed as a vector? For instance, an ellipse: ...
0
votes
0answers
38 views

Function that once called “erase” every other definition of my notebook

I encounter a really weird effect in Mathematica and I don't know what the wrong thing is nor how to correct it. I work with vectors of four components and I have a minimal set of definitions that I ...
0
votes
0answers
74 views

Find the maximum of a function involved with Floor function

My function is $$ f(H,p) = \left\lfloor \dfrac{\lfloor H/p\rfloor + 3 - \sqrt{(\lfloor H/p\rfloor + 1)^2 - 4H}}{2} \right\rfloor $$ The constraints are $ H \geq p(4p-1) $, $ p $ is prime although ...
0
votes
0answers
43 views

Create a color function from dynamic panel

I would like to generate a color function from the dynamic panel code and use it as I want...instead of using Copy to Clip Board and then past in myTM.... Any idea ?...
0
votes
0answers
24 views

Trouble restricting function images

I am following this book https://www.amazon.com/exec/obidos/ASIN/1558606378/ref=nosim/ericstreasuretro with mathematica and I'm having some trouble on my way: 1) Consider the function ...
0
votes
0answers
105 views

DSolve inverse function

I trying to solve a differential equation DSolve[{D[r[a], a] == 3 r[a]/a (w - (g *(1 + w)*(1 + r[a]))/(1 + g*r[a])),r[1] == r0}, r, a] But the solution is a ...
0
votes
0answers
40 views

Removing numerical instability in plots of functions over large domains

suppose you have a large domain you wish to plot a function over, which depends on numerical values usually around or above you machine precision e.g. ...
0
votes
0answers
43 views

Finding the functions that Mathematica plots while using BodePlot

I've the following Mathematica-code: ...
0
votes
0answers
32 views

How do I combine `InterpolatingPolynomial` and `Integrate`?

I want to find a real-valued polynomial (or trig) function f[x] that yields 0 at x=-a, and ...
0
votes
0answers
55 views

Representing an interpolating function

I just want to figure out how to "represent" or to inject an interpolating function into a numerical calculation. So, suppose i have an interpolating function $int$ and then i want to use NDSolve or ...
0
votes
0answers
55 views

Constructing a user function with an integral

Maybe this is a basic task to perform but I haven't found any literature. I am performing a convolution of two functions: ...
0
votes
0answers
60 views

How to find ranges of values where specific conditions are true?

I'm trying to get Mathematica to solve a particular inequality in terms of the variables (and constants) of interest to find where the inequality holds as true. Specifically, I have three functions of ...
0
votes
0answers
54 views

How to accelerate NDSolve for PDE with user defined functions?

I would like to solve the following 2D+1 PDE $\partial_t \mathcal{P}(t,\theta,\omega)=-\partial_{\theta}( \omega\mathcal{P})+\partial_{\omega}\left[(\tau_i n\cos(n\theta)-\tau_m(\theta))\mathcal{P}\...
0
votes
0answers
42 views

Editing the function argument

I'd like to construct a function, that changes its own input. The code ...
0
votes
0answers
30 views

How to change the formulae of FeatureExtraction?

I have a feature extraction function fe, which gives me n/0.816497 as the output of fe[{1}]:- ...
0
votes
0answers
52 views

Functions definitions with variable arguments

How do you define a variable amount of functions with a variable amount of arguments? I don't get the reference at all : ...
0
votes
0answers
96 views

Help! SystemException[“MemoryAllocationFailure”]

I am trying to run this code: ...
0
votes
0answers
60 views

Is there a way to Connect a function ''normally'' through its Pole?

Basicaly I have this function: ...
0
votes
0answers
88 views

How to give a function multiple variables in a mapped and nested list?

I come from python (not advanced tho), and have been learning mathematica. I'm currently struggling with the following code: This is a basic version of what i wanted to implement: ...
0
votes
0answers
76 views

HannWindow implementation and discretization speed

I would like to discretize a series of HannWindows, but two issues arise. First, my manual implementation of HannWindow seems to ...
0
votes
0answers
38 views

Having Trouble with CountryData [EDITED]

I have a list which I call by countryExportPartners = Table[l = CountryData[][[n]]; {l, CountryData[l, "ExportPartners"]}, {n, 1, Length[CountryData[]]}] I ...
0
votes
0answers
68 views

Iterating a Module

I have a Module that can act on other Modules, which is given as Kk[EE,p,z1,z2,z3,K_func] and I am trying to iterate it, such that ...
0
votes
0answers
45 views

Plotting smoothly inverse squared force fields

I would like to plot a DensityPlot of two 1/r^2 functions on a 2D plane (this is supposed to visualize the inverse squared force field law between two points). If I plot the code below I get only two ...
0
votes
0answers
49 views

Function that Generates all Normal Subgroups of a Group

I am trying to create a function which, given a group structure, generates a list of all the normal subgroups contained within it. But I am not sure how to proceed. For now, I have the following: <...
0
votes
0answers
38 views

How to can write the simplest form

I am trying to find the simplest form of a function that contains many different Sign to a function without the Sign function: <...
0
votes
0answers
59 views

Vector from Matlab to Mathematica as a function

I have a 400x1 vector T in Matlab which is a function of another 400x1 vector E. I have these two vectors. I had a few questions : How do I transfer these two vectors to Mathematica I want to write T ...
0
votes
0answers
34 views

Defining functions with pattern as argument

I want to define a function such that f[18/17 h[y][z]] = 18/17 z for any function h[y][z]. I first tried with ...
0
votes
0answers
59 views

Integrate a multivariate function similar to a delta function

I am doing a code in Mathematica. I have the following function: ...
0
votes
0answers
45 views

paraconjugate of polynomial

I'm trying to obtain the paraconjugate of a polynomial with the following code, ...
0
votes
0answers
73 views

How to change ellipse function format?

I already has ellipse function as below: −3.06274x^2−y^2+1192.22x+152.71y+1.829648xy −196494==0 but I want to get the function like: ...
0
votes
0answers
78 views

how to override the derivative of a function ?

i have the following equation : ...
0
votes
0answers
99 views

Array Plot Custom Color Function Black Magic

Sorry, lots of code here, somebody explain this to me: ...
0
votes
0answers
38 views

How can I store interim results from FindMinimum?

I wrote a mathematica function which uses external programs. The external programs read numerical datas from mathematica. The mathematica function need x-parameter in the next round of FindMininimum-...
0
votes
0answers
29 views

Factoring a multi-variable function into single-variable terms

Suppose I have an arbitrary function $f$ of $n$ variables. For simplicity, let's assume that $n=3$. Suppose that I have its explicit form, $f(x,y,z)$ and I want to expand it into a sum of terms, each ...
0
votes
0answers
374 views

How can I define my own ColorFunction?

Suppose I want to define a color function to use more than one graph. I'd prefer not to type it out every time. I know that I can set ColorData like this: ...
0
votes
0answers
38 views

MMA Function is not recognizing an input parameter to PrependTo Statement

I am getting an error in the following code? What is the error telling me? How to fix? ...
0
votes
0answers
72 views

Retrieving values from InterpolatingFunction

I have code for finding the flight of a golf ball and I would like to retrieve the values of horizontal displacement x[t] and at the time when the golf ball hits the ground (y[t]=0, when t=tmax) <...
0
votes
0answers
52 views

Why Plot is not a listable function but still take input as a list?

By using Attributes I can see that the function Plot is not a Listable function. ...