All Questions
Tagged with expression-construction function-construction
10
questions
1
vote
2
answers
73
views
How to exclude singularities for `NMinimize`
I have an messy expression and want to apply NMinimize to it, have no idea how to force NMinimize to ignore the singularities it ...
0
votes
1
answer
55
views
Generating a 2 variables polynomial with constraints
I would like to generate automatically a polynomial in two variables $(s,t)$ which is symmetric under the exchange of those variables. There are three kinds of terms; at order $k$, we have
$$(s+t)^k, \...
0
votes
2
answers
63
views
How to turn FindFit result into function within a Module context
I'm trying to construct a 'normal' function (with formal parameter) from the FindFit result within a Module context.
While this works on a global level:
In :=
...
4
votes
1
answer
127
views
Alternatives in pure function construction
When I declare a function f in the following form:
f[a|b] := 1
then I can use it like:
...
0
votes
0
answers
50
views
How to generate nested expression?
I've found some related questions, but nothing has really helped me to do what I want to do.
Given a list of variables L and a parameter ...
0
votes
1
answer
1k
views
Convert string to function with an argument
I am trying to build an expression by first writing it out as a string and then using ToExpression to convert it to an expression. However, I cannot figure out how to make expression recognize x as an ...
1
vote
3
answers
226
views
How do I make a definition/function/method as I would in Java/MATLAB/Python
I've been trying to figure this out for a few hours now and it's driving me nuts. I am trying to confirm that, after transforming a Schrodinger equation, that the new wavefunctions satisfy the new ...
1
vote
2
answers
79
views
Subsituting expressions for expressions
I'm trying to define functions using other functions, like so:
f[a_, b_] := a/b;
a[c_] := c;
b[d_] := d;
Now what I want to be able to do is two things:
...
1
vote
0
answers
94
views
6
votes
2
answers
363
views
How can I create a class of matrices programmatically?
I am trying to figure out how to create a function that can create the matrix pattern below, where:
f[1] returns {{1}}
...