# Tagged Questions

For questions on writing functions (pure or using Set/SetDelayed) for any purpose, including the features that may be incorporated in those functions, such as options, patterns and conditions.

13 views

### Taylor series representation function?

Is there a built in Taylor series representation function in Wolfram Mathematica? For Example: ...
29 views

### Generating a list of random numbers that follows a pattern

I'm a beginner to Mathematica. I'm writing a code to design a 4-bar linkage mechanism that traces a path in 2D space. I got the modelling done right, now I'm writing my own implementation of a genetic ...
29 views

Downstream of a long process I got the following function: $\begin{cases} 0 & x < 0 \, \vee \, x > \frac{307}{400} \\ 14.27-7.44\,x & 0 < x < \frac{307}{400} \\ \text{... 0answers 22 views ### Compiling a function while dealing with symmetries I have the following function that I would like to compile: ... 2answers 120 views ### Build nested function By running the following code: ... 2answers 240 views ### Defining Associated Stirling Numbers of the Second Kind First, I'm new to Mathematica. I spent my undergraduate programming with Maple, and my computer crashed and I lost it. Fortunately, my university offers free Mathematica downloads to students, so ... 6answers 399 views ### Create a polynomial of a given degree In Mathematica, how can I create a polynomial function in given variables of a given degree with unknown coefficents? That is, I am looking for a function ... 1answer 51 views ### Evaluating a list of randomly sampled triplets with a function of three variables I'm new to Mathematica. I need to generate a list of 1000 triplets of random numbers {r, p, t}, so that 0 < r < 1, ... 1answer 68 views ### Apply If function to FoldList [closed] I have defined the following function: cpdz[c0_, m_,s_, r_, t_, n_] := If[c0 > 0, c0*(m*c0\s - (m - 1)*Exp[r*t/n]), c0*Exp[r*t/n]] for s I have a set of ... 1answer 69 views ### How to plot a function containing$\pm$and unlimited solutions$n$? [duplicate] I have $$y=n\pi\pm\arcsin(\sin(x)), n\in\mathbb{Z}$$ How can one define and plot such a function in Mathematica for multuple$n$at the same time? 1answer 27 views ### Using set of lists in if function? [closed] I have the following function: a3[m_, C_, St_, Stt_] := If[C > 0, (m*C)/St*Stt, 0] now my input for C, St and Stt are different set of lists. So I tried to ... 0answers 27 views ### Pass list title as argument? [duplicate] I have a function that works with a list and outputs it. Is it possible to also get the name of the list as an argument? Right now my code is ... 2answers 84 views ### Defining the Hirota operator The Hirota$D$-operator (derivative) is mathematically defined as follows: $$D_x^n f\cdot g=\left.\frac{\partial^n}{\partial s ^n} f(x+s)g(x-s)\right|_{s=0}$$ An example of this operator acting on ... 2answers 95 views ### Recursion: How can i program this expression? i have the following expression: Vt[EA_, V0_, Cm_, B_] := EA + (V0 - Cm)*B For EA and Cm ... 1answer 1k views ### Stereographic Projection Say I want to represent points of the complex plane in the sphere$\Bbb S^2$using stereographic projection. That is, the Riemann sphere: Specifically, it would be nice to be able to: Given the ... 2answers 76 views ### Local modification of built-in command via UpValue I have a computationally intense function f that returns a matrix. Sometimes only the diagonal is needed, which is faster to compute, thus there's a syntax for f to ... 0answers 35 views ### Can you define “| |” to be the same as “Abs[ ]”? [duplicate] When calculating the modulus of a complex number in Mathematica, the standard (and probably least-ugly) way of doing it is by using the Abs[ ] function. When doing ... 1answer 103 views ### How to make a custom function as inbuilt I have a custom function like following: ... 2answers 610 views ### How do I get Mathematica to return a function call unevaluated? How do I get Mathematica to return a function call (conditionally) unevaluated? I expect this may use the slightly-mysterious Hold function. As a toy example, ... 0answers 113 views ### Obtaining a Previously Constructed Function as Desired Output I was playing around with some Generalized Trigonometric Functions defined as follows; ... 2answers 69 views ### Using Solve[ ] inside a Module I want to use Solve[] inside a Module. If I make the variables solved for local to the module, they are treated differently than ... 1answer 40 views ### Defining a function when the variables do not appear explicitly in the definition of the function I am trying to take the curl of a vector field which is the a product of a scalar field (Psi) and a coordinate vector, {r,Theta,Phi}. After taking the curl I want to calculate the magnitude of the ... 2answers 152 views ### How to save the caching produced in processing As my this previous post.I get a custom function which can help me got some function contain a certain option.And I have put it in my "init.m" file. ... 2answers 159 views ### How do I get Series[] as a functional, rather than as an expression (i.e. to avoid the dummy variable)? How can I write an equivalent to Series that doesn't require a dummy variable? Note that the series should be constructed before the evaluation point is supplied, ... 2answers 71 views ### Grouping/precedence for “/@” operator This returns errors: {#[[1]],#[[3]]} & /@ {#[[1]],#[[2]],#[[3]]} & /@ {{"A","B","C"},{1,2,3}} Part::partd: Part specification A[[1]] is longer than ... 1answer 286 views ### How to split text without spaces into list of words? [duplicate] What is the best approach to a problem like this in Mathematica? I can only manage this: ... 1answer 45 views ### Function with declaration of variables [closed] Is it possible to create a function with declaration of variables inside. For instance ... 3answers 303 views ### How to check the validity of an option value I have a user-defined function, func, which takes the following form: func[arg1, arg2, options] Here is the actual code ... 0answers 15 views ### Define a function as an evaluated integral [duplicate] I have the following integral which I evaluate analitically ... 1answer 38 views ### Set a minimum threshold value for a function I have defined the following function in Mathematica al[z_] := (a/((1 + a*(b/(2 Pi))*Log[z/Mz]))) (a and ... 0answers 51 views ### Line-crossing Algorithm Implementation (pt. 2) [closed] This is a continuation of the problem I posted earlier with the line-crossing algorithm that I tried to implement in Mathematica. I took Kuba's suggestion, removing the underscore on everything ... 1answer 71 views ### Defined a function but it doesn't seem to work I'm trying to implement the line-crossing algorithm on Mathematica and I seem to be having trouble getting it to work. More specifically, I would like to know what is causing the function to not ... 2answers 81 views ### Finding zero of nonlinear simultaneous equations [closed] I'm trying to find the zero of nonlinear simultaneous equations defined in myfun1 and myfun2: ... 5answers 369 views ### Distributing function arguments with function compositions. How to compute$(f + g^2)(x) = f(x) + g(x)^2$? Suppose I have two functions f and g. To compute$f + g$evaluated at a point$x$, I know that one can use ... 0answers 57 views ### Defining a function that depends on the length of a number and the$n$-th digit I have defined the functions F[i][x] for i={1, 2, 3}.. I want to write a number that has only the characters 1, 2, 3, and I want ... 1answer 57 views ### How to make the$ModuleNumber dynamic in a string

This code can run normally ...
135 views

### Function just gets mapped without any evaluation [closed]

Variable definitions are as follows: eBEG=0.; epBEG=0.; aNEXT = 0; eNEXT=0.; actStrain=0.; epTRIAL=0.; sigTRIAL=Range[0]; sigEND=Range[0]; Constant definitions ...
224 views