Questions tagged [functions]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
103 views

general replacement

I have 500 terms. and I want replace them with below function ...
0
votes
0answers
23 views

Adaptation of existing code to multivariable system

I am trying to adapt the existing code from "Mathematica package for analysis and control of chaos in nonlinear system" by Gutierrez. This existing code calculates the Lyapunov Exponent by ...
0
votes
0answers
70 views

Can't create matrix function of symbolic functions and assign values to elements

So I have a problem regarding the symbolic matrix value assignment. Say I create a matrix function as: P[t_]:= {{P1[t]}, {P2[t]}, {P3[t]}}; Then I want to assign ...
6
votes
1answer
80 views

unexpected StringCases behaviour inside function module

First, Let use see a = {"wx", "wy", "wz"}; AssociationThread[Flatten[StringCases[a, "w" ~~ d_ :> d]] -> a] gives <...
0
votes
1answer
50 views

Could anyone help me to plot the following function? [closed]

Unfortunately Mathematica is not able to run the following program area[d_]:=Pi*d^2/4 Q=80/1000 v[d_]:=Q/area[d] [Nu]=10^-6 Reynolds[d_]:=v[d]*d/[Nu] [Epsilon]=0.04/1000 CW[[Lambda],d]:=1/Sqrt[[Lambda]...
2
votes
1answer
72 views

How to make an interactive solver function?

I am working on creating a function that takes in any physics equation as a string and converts it to an equation that I will then paste into an interactive interface as asked here: How to make an ...
0
votes
0answers
20 views

(Laplace Coefficents) Integral function definition

TLDR: need help defining two functions involving integrals in the form of "Laplace Coefficents". My intention is to define functions that involve Laplace Coefficents. In particular, if $$b_{...
0
votes
0answers
30 views

Suppressing tensor indices and function labels of a function

I am trying to do some GR calculations, and want to write a code which shows the expressions symbolically using compact indices, rather than write all the quantities in detail. More precisely, ...
0
votes
2answers
55 views

How to use NSolve while specifying the range of one variable

I have an equation that uses three variables that I have defined as follows: b[l_, m_, lt_] := 0.025 * (((1 - m)*l)^(-1/2))*((1 - m)*lt) - 5. After this definition, ...
3
votes
1answer
94 views

What's the meaning of Sign function applied to matrices with MatrixFunction?

I have noticed that Sign function can be very well applied to matrices using MatrixFunction. It even works on some zero divisors,...
0
votes
0answers
75 views

Multivariate Pade approximant

Does Mathematica generate multivariate or just two-variate Pade approximant? If so, what is the generating command?
0
votes
0answers
38 views

Create a function from another by substituting arguments

Suppose I have a function f[x, coeff] ...
2
votes
0answers
36 views

Can't match custom head in function signature [closed]

I have written a financial charting function which has the following signature; ...
0
votes
1answer
34 views

Setting rules for Gamma functions

I have some expressions involving lots of Gamma functions. Now the arguments of the functions sometime go to zero, in which case I want to use the factorial instead of the Gamma function (since it ...
11
votes
1answer
710 views

How to make a haunting ghost?

How to make a harmless ghost (one that looks like a flying bed sheet)? One can always make a Ghost Curve. Or one can define define a clever wiggly function with a random fluctuation. My initial guess ...
3
votes
1answer
39 views

What is the precedence or order of operation for multiple functions applied to a dataset?

This is from the Wolfram Language book section 45 on the planets dataset. This works: ...
2
votes
1answer
63 views

How to manipulate functions?

This is probably a simple question, I have matrix a , and I construct b from a by adding a variable to the first column. b is a function of variable d, and now I need to do mathematical calculation on ...
-3
votes
1answer
50 views

Maximize function problem [closed]

I don't understand why I'm getting no solution with the Maximize function in this case: while it returns the right result when I impose $y\leq0.999$ (or, equivalently, $x\leq0.999$):
1
vote
1answer
50 views

How i can add an element of one sublist to other?

I have list. st = {{1, 2, 3}, {}, {}} It is nessesary to add the first element of any sublist to start of other sublist. In a quick way. Example: from 1 to 2 ...
0
votes
2answers
81 views

NMaximize - global maximum fail - How to?

Problem : Let x,y,z be non-negative real number whose sum is 1. Find maximum of 0.2x + 0.2y + x^2*z + y*z^2 What I did first was reducing variable. ...
0
votes
1answer
55 views

Asymptotic bode plot [closed]

Is it possible to plot an asymptotic bode plot. I am interested in verifying my straight line bode plot approximations done by hand by using mathematica but the bodeplot function generates the curved ...
0
votes
0answers
43 views

How to define the normalized spacing?

I want to write the formula for normalized spacing in Mathematica and I want to use it in rest of the problem. To write the formula $D=(n-i+1)(x_{(i)}-x_{(i-1)})$ I wrote the following function. ...
0
votes
0answers
67 views

Ising Model 1D /Thermodynamics properties

I want to plot the thermodynamics properties of the Ising model like free energy, entropy, magnetization..etc., when h=0 ( no external field ) and when h= finite values For the energy as function of ...
2
votes
1answer
135 views

How to expand a function as a linear combination of other functions?

I would like to be able to expand certain functions as linear combinations of other specified functions when I know that the original function can be represented in such a way e.g. we know that $\sin^{...
1
vote
0answers
63 views

Does Mathematica assume real variables in this case?

When we have a function like $f(x) = x^2-1$ and we expand it in a power series about some $x = x_0$, does Mathematica automatically assume that $x$ is real valued?
2
votes
1answer
74 views

Play two sounds at the same time in mathematica. For example the inventions of Bach NO.8

I use mathematica to play the Inventions No8 by Bach. I want to play the two parts (by right and left hands )at the same time. But I don't know how to do it. Can you help me? Thank you! ...
12
votes
3answers
317 views

Definition of a ResourceFunction

There is a feature called ResourceFunction in Mathematica. For example you can color a string with rainbow style. https://resources.wolframcloud.com/...
1
vote
1answer
106 views

How to apply this function? [closed]

I have defined functions f[x], g[x]. How can I let them act on variable x (I want to put the ...
5
votes
1answer
298 views

Why the first one works fine but not the second one?

Why the first one works fine but not the second one? How can I make it work? Abs[#] Exp[I Arg[#]] &@(1 + I) ...
1
vote
0answers
45 views

Defining a function expression [duplicate]

I'm sure this has been answered before, but imagine I have the following function ...
2
votes
0answers
50 views

Part::partd: Part specification is longer than depth of object (Simple list) [closed]

I know that this question has already been asked (I searched for answers), but in every thread I saw the code was much more complicated than what I'm trying to do, and I can't understand why this ...
0
votes
2answers
60 views

How do you sort a list based on conditions? [closed]

If i have an list that ranges from 1 - 100. How can i sort elements from the list. For example i want elements that has greatest common divisor 1 with the number 24.
2
votes
1answer
93 views

Error when defining a function containing Integrate

...
0
votes
2answers
55 views

Can I save data as a three-column matrix?

I need to store values of a function of x and y defined as f[x_, y_] := Sin[Pi*x/3]*Sin[Pi*y/3] at the following points ...
1
vote
1answer
57 views

How do I make Mathematica to always evaluate Log[0, x] as Power[0, x]?

So, sometimes Mathematica cannot evaluate the base-0 logarithm of certain matrices. But we know that the expressions $0^x$ and $\log_0 x$ are always equivalent. What can I do so that Mathematica ...
0
votes
3answers
161 views

How do I improve this code for hyperbolic numbers so to allow equation-solving?

I have the following code, which allows evaluating expressions with split-complex unity J: ...
0
votes
0answers
68 views

What is the difference between using replace all and using the value of a function?

For a project I'm working on, I'm using some functions that have a Chop[] to get rid of small terms that complicate things numerically. My function is ...
0
votes
0answers
54 views

Is it possible that NSolve gives the roots that the function is not (well-)defined at those points? (an example is given)

I have this function for reals values of $x$ for $2<x<3$. $$f(x)=(3 \pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-...
1
vote
1answer
89 views

Is there any alternative for NSolve or Solve to obtain all the roots of the given function?

I have this function for reals $0<x<\pi$. $$f(x)=(3 \pi -2 x)^2 \sin \left(\frac{1}{2} \left(\csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{\pi -x}\right)}{4 x^2-8 \pi x+5 \pi ^...
2
votes
1answer
136 views

How to replace the arguments of a function?

I have the following type of (very long) expression: $$\ldots + X[1,2,3,5] + X[2,4,5,6] + \ldots \tag{1}$$ where $X[a,b,c,d]$ is some undefined function. I would like to replace all the occurrences of ...
0
votes
1answer
57 views

Basics for recursive functions [duplicate]

I am new to Mathematica and try to define a simple recursive formula which is illustrated as below: ...
1
vote
0answers
61 views

Inverse image of a subset of the codomain of a function

I'm wondering if it's possible to evaluate the inverse image of a subset of the codomain of a function in Mathematica. For example, if I consider $f(x) = x^2: \mathbb{R} \rightarrow \mathbb{R}$ (for ...
0
votes
0answers
44 views

During assignments, separate entity stores are not being created for each new entity type?

The documentation for EntityRegister gives this example: During assignments, separate entity stores are created for each new entity type: ...
5
votes
0answers
75 views

Perform Apply[] to a sum of objects

is there any way to use the Apply[] function to a sum of objects? By this I mean the following. We know that using Apply[] (@@) to an objects gives: f@@{a} f[a] I'...
6
votes
2answers
775 views

Why does Mathematica not give the simple solution of the given equations?

I want to solve this system of two equations for $x$ $$\{ \sin (2\pi x)+\sin (\frac{2\pi}y)=0 \quad , \quad \cos (2\pi x)-\cos (\frac{2\pi}y)=0 \} \qquad (1)$$ I use ...
1
vote
1answer
71 views

FullSimplify fails with simple assumptions

I have a list of relations of the form x[1] x[2] + y[1] y[2] - z[1] z[2] == 0 and I want Mathematica to simplify certain expressions using these relations. I have ...
2
votes
2answers
193 views

How can I make sure that there are real roots for the given function? Can I trust the plot only?

I have this function $$f(x)=(\pi -2 x)^2 \sin \left(\frac{\pi ^2}{2 x-2 \pi }+\frac{1}{2} \csc ^{-1}\left(\frac{4 \pi (\pi -x) \csc \left(\frac{\pi ^2}{x-\pi }\right)}{4 (\pi -x)^2+\pi ^2}\right)\...
5
votes
2answers
290 views

What is this triangle inside an octagon symbol and square bracket notation?

I defined a function in Mathematica online and I get this strange output. What does the triangle inside the octagon mean? Also, what is [n]? Also, why is there a <...
5
votes
1answer
114 views

`VertexColors` seems to blend colours unevenly

VertexColors seems to blend colours unevenly, often with a "stripe" between vertices. Compare: ...

1
2
3 4 5
64