Skip to main content

Questions tagged [function-construction]

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.

2 votes
1 answer
128 views

Partial derivative of function with restricted pattern like _List doesn't evaluate

I am having trouble where Mathematica won't evaluate my partial derivatives. I have the function below. ...
EEH's user avatar
  • 21
3 votes
1 answer
94 views

How can I generate unique partitions of a list into sublists of specific sizes (no overlap)?

I need to partition a list of elements into sublists of specific sizes, ensuring: The order of elements within each sublist doesn't matter. There is no overlap between sublists (each element appears ...
internet's user avatar
  • 695
4 votes
0 answers
76 views

Why doesn't NMaximize handle this improper function definition?

First, consider this toy example: expr = (1 - x)/(x^2 + y^2); Clear[f]; f[x_?NumericQ, y_?NumericQ] := expr "Wait, this function definition is wrong! "...
xzczd's user avatar
  • 70.1k
1 vote
6 answers
646 views

How to select a random element from a list without repetition until all elements are used?

I have a list, for example: list = Range[10]; I would like to randomly select one element from this list each time I run the code. However, once an element has ...
internet's user avatar
  • 695
3 votes
2 answers
151 views

Random Password Generator question

How to generate password Re the above post. I am a beginner. I wish to know if I can restrict the random words chosen to a specific length.. for e.g. 6-lettered words. The generated word may look like,...
JHS's user avatar
  • 75
6 votes
3 answers
288 views

How to Reorder Piecewise Function Compositions

I'm conducting compositions of piecewise functions and Mathematica is producing correct output but I want to reorder the output on the interval [0,1]. For example the code below ...
user42700's user avatar
  • 2,017
1 vote
2 answers
151 views

ParametricRegion doesn't recognise BezierFunction as 3D

Problem I'm trying to make a MeshRegion from a bezier surface defined from an array of control points. Consider ...
Adam's user avatar
  • 4,028
5 votes
2 answers
247 views

Complicated nested function construction with two lists of arguments

Given arguments arg1 and arg2 and function f I want the output to be ...
azerbajdzan's user avatar
  • 26.3k
2 votes
2 answers
94 views

How to automatically generate implicit regions from conditional expressions?

I need help writing a function that can automatically convert the following conditional expressions into implicit regions in Mathematica. Given a list of conditional expressions: ...
internet's user avatar
  • 695
0 votes
0 answers
42 views

Needing to efficiently repackage series coefficients into a more complicated formal sum

I have the following simple program: PolyLogarithm[n_, z_, c_] := Sum[r^(-n)*z^r, {r, 1, c}]; ...
Benighted's user avatar
  • 1,337
3 votes
3 answers
420 views

How to Precompute and Simplify Function Definitions?

I'm defining a function in Mathematica as follows: f[x_] := x+x-x //FullSimplify; In this setup, every time f is called, FullSimplify is executed, which can be ...
Jannik Wyss's user avatar
4 votes
8 answers
400 views

Gather on first list, apply to second list

I have two lists. The first list is L1={z,x,y,x,x,y} and the second list is L2={a,b,c,d,e,f} in which all elements are distinct. ...
Paul R.'s user avatar
  • 937
0 votes
2 answers
178 views

Formula to generate a specific sequence

I'm not a mathematician, but lately, I've been watching many math videos on YouTube, and I have an idea I can't find any reference. The problem is: Given that four agents ordered descendants, giving ...
Paulo Aboim Pinto's user avatar
0 votes
1 answer
58 views

Define a function by integrating a solution of NDSolve [duplicate]

...
S. Euler's user avatar
  • 399
1 vote
1 answer
70 views

How to Compute the Hermitian Conjugate of Non-Commutative Products Symbolically in Mathematica?

I am working on symbolic quantum mechanics calculations in Mathematica, where I need to compute the Hermitian conjugate of expressions involving non-commutative operators. For instance, I have ...
travelInrrj jj's user avatar

15 30 50 per page
1
2 3 4 5
168