Questions tagged [functions]

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

Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

Change the function-defined solution domain to fit NDSolve original Interpellation domain

Given a system of coupled non-linear equations, I used NDSolve to solve it in the domain of: $$ -10^{50} \le r \le 10^{50} $$ ...
Daniel Vainshtein's user avatar
0 votes
1 answer
36 views

Creating function with array input with desired coefficient and evaluate it

I had asked the same question before here Creating a list of functions with desired coefficients but did not get the desired answer, may be I was not clear in my question. I have defined this function ...
Learner's user avatar
  • 219
2 votes
2 answers
106 views

Simplify inverse of function

This would be a noob question, but I need help simplifying the inverse of an expression ...
Zain Ahmad's user avatar
2 votes
1 answer
88 views

Creating a list of functions with desired coefficients

I have defined this function to results some list of functions, however its not returning what I want ...
Learner's user avatar
  • 219
4 votes
3 answers
364 views

How to fit function with data?

I have ...
Sale Gauss's user avatar
3 votes
1 answer
125 views

Pattern matching vs. condition in a function

I'm trying to learn stuff from pattern matching but I found sometimes pattern matching does not work as I expected. Could anyone explain why the below outputs are not same? Thank you. And could anyone ...
Josh's user avatar
  • 31
0 votes
0 answers
49 views

NyquistPlot creates misleading connections with some plot range

This Nyquist plot depicts a plot range aiming to cover all crucial curve characteristics. ...
internet's user avatar
  • 495
2 votes
2 answers
123 views

Can I write a function that describes a hysteron?

Is there a way to write a "function", or as the answer below refers it better as a memory, that has the following output: k=0 if the last time x was outside the range (a,b), it was x<a. ...
juv95's user avatar
  • 197
0 votes
2 answers
73 views

Same code behaves differently as a pure function and a function, and insider another function

I have a rule-transformer that takes a list of rules (and a list generator = {σ[z], σ[-1], σ[1]}) ...
Lelouch's user avatar
  • 513
2 votes
2 answers
89 views

Plotting root locus - how to display 'k' values on the curve?

I'm trying to plot the root locus for the function below. Is there any way to make it display the value of 'k' when I move the cursor along the curve, similar to a tooltip? ...
internet's user avatar
  • 495
0 votes
0 answers
31 views

Defining a function for FunctionCompile[]

Lets say that I have the definition EQN4 that is determined from some calculation. If I run it in a cell, I get the following output: ...
Bajablaster's user avatar
2 votes
3 answers
619 views

How to draw an image similar to a periodic function (f [x+1]=2 f [x])?

The definition domain of function f [x] is R, satisfying that f[x+1]=2f[x], and when x belongs to (0, 1], f [x]=x(x-1). If for any x belongs to (-[Infinity], m], there is f [x]>=-8/9, find the ...
csn899's user avatar
  • 2,879
2 votes
1 answer
51 views

Is it possible to ask Mathematica to give/find this largest (absolute value) argument of $\cosh$ in the expression?

I have the expression exp in terms of Cosh functions: ...
MsMath's user avatar
  • 137
4 votes
6 answers
511 views

Stopping mathematica from rearranging elements in a list

I have the following list set1={-(1/x), -(1/x) + x/2 - 2 Log[x] - Log[x]/x, 1} How when I am doing Complement[set1, {-1/x}] ...
Tanmoy Pati's user avatar
2 votes
3 answers
69 views

Define function to test arguments and set value to 0 (application 0 Log [0] = 0)

I have an expression that has the form f1[a, b, c] Log[ f2[a, b, c] ] Now if f1[a,b,c] and ...
Sid's user avatar
  • 977
0 votes
1 answer
64 views

To draw a function within an interval [closed]

I need to draw this function: z=f(x), where z=tanh(y) and y=sin(x), within a range of x(-2Pi,2Pi)? Should I use "Plot" function or some other built-in functions? Thank you
Jeremy Acai's user avatar
0 votes
0 answers
51 views

How to make a function that returns a function?

I have this function that returns another function Hs but the only way to use the function is to use Hs[t][[1]]. Is this going to slow down my code and is there a way to write this so that I can ...
Luca's user avatar
  • 83
3 votes
1 answer
120 views

How can I zoom in on a specific region?

I made this plot with Mathematica but it's hard to see the region around the cirtial point -1 + 0j. Is there any way to zoom the region? ...
internet's user avatar
  • 495
0 votes
1 answer
76 views

Trying to plot the Fourier transform solution to the heat equation on Mathematica [closed]

I have gotten the solution of the heat equation as where f(y) is the initial heat distribution which I have been given as f(x) = e^([Sigma]x^2). I am supposed to plot this at the value of sigma 1, 2 ...
yen's user avatar
  • 1
1 vote
2 answers
70 views

Listable (on certain level) custom function

I wish to make custom listable function (for 2D points) with the next behaviour: ...
lesobrod's user avatar
  • 1,187
1 vote
3 answers
188 views

How to implement tridiagonal matrix algorithm?

I have created the tridiagonal matrix below: ...
Mule's user avatar
  • 43
1 vote
3 answers
137 views

Finding the minimum

I am trying to find the minimum R and its corresponding k, but for some reason (which I am not able to figure it out) I am getting an error that the function value is not a real number at k=1. ...
Math_student's user avatar
0 votes
1 answer
71 views

How to make a polynomial output be used as function for input?

I basically made a code interpolating a set of data that gives me the polynomial for the interpolation. Here's the sample interpolation I did. ...
Mule's user avatar
  • 43
2 votes
1 answer
85 views

How to create a plot like this one? I think I am having issues with implementing a logarithmic axis

I am having trouble creating a type of contour plot. I have an example of what I am trying to make which is this: and this: I know that for the first example above, the plot was not all made in the ...
Joseph Romo's user avatar
1 vote
2 answers
140 views

Making the timestep of Euler method integration a variable

I am fairly new to Mathematica, and I've been trying to implement the Euler method of integration for a fluid velocity field. I can't work out how to make the timestep a variable of my Euler method ...
Feneb's user avatar
  • 13
0 votes
1 answer
45 views

Cross function not working for time dependent variables [closed]

I have two 1x3 matrices both containing time derivatives: OwC = {{a'[t]}, {b'[t]+c'[t]}, {0}} EwB= {{0},{b'[t]},{0}} But when I do Cross[OwC,EwB] I get: Cross::nonn1: The arguments are expected to be ...
Trihexia's user avatar
0 votes
1 answer
78 views

How can I apply Residue in a functional-style way? [closed]

Let me suppose that I have got some expression, for example f_{1}(x)+f_{2}(x) and also a list of a form: {1,2} How can I apply ...
George's user avatar
  • 69
0 votes
0 answers
25 views

Adding constrains in a SYM function "Classicalsymmetries"

Please help me add constrains on my code. The function runs perfectly fine without the constrains but it gives me 7 cases and I only need one where all the constrains I have hold. This is the code ...
Ms Me's user avatar
  • 1
1 vote
1 answer
116 views

How to invert this function when the argument e is small?

I need to find an analytical solution the following equation for e in terms of n and p ...
Dotman's user avatar
  • 414
1 vote
1 answer
74 views

Finding out derivative of variables from an expression

I have the following expression gh=(G^(0,0,1))[0,1,x]+G[1,x]; Where G^(0,0,1)[0,1,x]=D[G[0,1,x],x]. This is a model expression. ...
Tanmoy Pati's user avatar
1 vote
1 answer
61 views

Replace rule inside mathematical operations

This is probably very trivial question. I want to replace D[G[0,2,1,x],x] where $D(0,2,1,x)$ is anything but the number of arguments may change keeping $x$ fixed, ...
Tanmoy Pati's user avatar
1 vote
2 answers
252 views

How to interpolate an implicit function?

chi(t) is implicit function. The implicit function can be plotted by ContourPlot. Is it possible to obtain chi(t) explicitly using function interpolation? ...
Mam Mam's user avatar
  • 1,753
1 vote
0 answers
108 views

Why ResidueSum returns 2 different values?

I want to calculate the sum of the residues of the function $$ \frac{\sin(\theta)\tanh(\alpha x)}{-\cos(2xL)+\cos(\theta)}, $$ for $|x| \leq1$. The function has singularities at the points $x_n^\pm = \...
Jean's user avatar
  • 11
1 vote
2 answers
133 views

How to calculate the depth of the lake in mathematica?

I want to calculate mean depth of Goose lake (mean depth=4.6 m), I use bellow command for this operation, But this command is not automatic and we have to create the coordinates manually, and on the ...
Erfan's user avatar
  • 159
1 vote
1 answer
58 views

Keywords included in most sentences in a paragraph?

I created a few functions that will retrieve some text from certain medical articles. However, not all articles are useful or even match the keywords I provide. Is there a way to "grade" ...
Sam B's user avatar
  • 159
1 vote
3 answers
117 views

Find the point with the largest slope change

I have a list of x-y data: ...
Mr.2023's user avatar
  • 189
4 votes
2 answers
565 views

How to calculate equivalent resistance for a network of same-value resistors?

Let's assume I have n identical resistors. I can connect them either in series or in parallel (let's disregard bridge connections for now). Now, I want to list all ...
emnha's user avatar
  • 2,411
1 vote
1 answer
60 views

How to remove terms with negligible constant from expression? [closed]

I'm working on a Notebook that requires the integration of multiple expressions (sometimes numeric, sometimes analytic). These expressions are normally of the form: ...
Pedro Hablespanyos's user avatar
3 votes
0 answers
120 views

How to estimate Lake area and volume in Mathematica?

I have a satellite image of the lake and I want to estimate its area and volume. Actual volume:1.49*10e8 m^3 Actual Area:36.9 km^2 I did the following command to find the volume, but it is not very ...
Erfan's user avatar
  • 159
2 votes
1 answer
221 views

Is there an easy way to hide output function arguments?

I'm working with a bunch of funtions with multiple aguments, say f[x,y,z], g[x,y,z], etc. I want to do operations with them like derivatives and products, and I want to read the result easily, without ...
Gianni Boschetti's user avatar
0 votes
0 answers
72 views

How do we convert the minimum of two values into its actual result?

I am writing a code in Mathematica where the entries of the matrix depends on the minimum function, which is a function of the position in the matrix. However, when I compile it, the entries appear as ...
user1234's user avatar
  • 109
2 votes
1 answer
117 views

Visualizing the zeros of a function of three variables

I have a function f[x_, y_, z_] := (x - y) (z^2 - x*y) of three variables x, y and ...
Mike's user avatar
  • 471
0 votes
0 answers
59 views

Automatic evaluation of a function for variable values defined from different data tables in the attachments

I want to evaluate a function whose variable values are defined in different data files. I want to know that how can I write code such that when the function's evaluation is exhausted for one table, ...
SciJewel's user avatar
  • 331
1 vote
0 answers
33 views

Separate definition of custom options and passed options in function definition

Why do these codes do not work? ...
azerbajdzan's user avatar
  • 9,568
0 votes
0 answers
57 views

How to extract shape from image in the Mathematica?

I have some satellite images for the lakes. How to extract the shape of the lake with maximum accuracy from the image?
Erfan's user avatar
  • 159
1 vote
2 answers
112 views

How to determine the shape of real quadric surfaces? Use discriminants?

Let $a x^2+2 b x y+c y^2+2 d x+2 e y+f=0$ be the implicit equation that defines a conic section , where $a,b,c,d,e,f$ are real numbers. I have known from wikipedia how to use 2 discriminants to ...
138 Aspen's user avatar
  • 857
3 votes
0 answers
71 views

How can I calculate P-Value for a custom distribution?

I used DistributionFitTest but it works only with a defined distribution. This is the distribution that I used: ...
A Day's user avatar
  • 59
1 vote
2 answers
105 views

Are these tacit functions? [closed]

I am new to Mathematica and am reading the primer document by Peter Young. Early on, before even introducing functions, he introduces constructions like ...
EE18's user avatar
  • 111
1 vote
1 answer
79 views

Why Mathematica gives complex number in this case?

Here is my code ...
happyle's user avatar
  • 13
1 vote
2 answers
128 views

How to do edge detection in Mathematica?

I have some pictures of water level and I want to do edge detection, I used the following command, but this command is vertical edge detection and I want horizontal edge detection and water level. ...
Erfan's user avatar
  • 159

1
2 3 4 5
74