All Questions

Tagged with
Filter by
Sorted by
Tagged with
3
votes
2answers
81 views

From f[g[x,t]] to f[g]

How can you change f[g[x,t],t] to f[g,t] ? I have differential equations ...
5
votes
3answers
448 views

How to transform a function from f[#1] to f[x]

So I have this function : Sqrt[-1 + Tanh[#1 - #2]^2] & How can I transform it into f[x_,y_]=Sqrt[-1 + Tanh[x - y]^2] ...
0
votes
1answer
62 views

Table and FindRoot of a 2 variable function of x and t : cos(x + 3t)

I am trying implement mathematica commands: Table and FindRoot, of a 2 variable function <...
0
votes
0answers
82 views

Problem with fitting

So I have a very simple question related to a simple topic, but also directly related to a fitting problem. I see that my question is related to this question but I don't manage to make the bridge ...
1
vote
1answer
36 views

How to use a table with two variables as the values for a function with two variables (x and y)? [duplicate]

I'm sorry if this is a dumb question. I am a student and have 0 prior experience with Mathematica or any sort of coding and I have looked at various resources trying to figure it out myself but still ...
1
vote
3answers
34 views

Simple question about variables into functions

Im trying to write a very simple code that will solve an equation. total = 800; side1 = x; side2 = total - 2 x; f[x_] := side1*side2 f[x] f'[x] Solve[f'[x]==0] ...
0
votes
1answer
56 views

Why is ww[[1]] not a valid variable in FindMinValue and Plot [closed]

Why is ww[[1]] not a valid variable when given to FindMinValue and Plot, but is a variable ...
0
votes
0answers
27 views

How can I access the name of a variable inside a function? [duplicate]

How can I access the name of a variable inside a function? For example I have variables mike={some stuff} jenny={other stuff} and want to write a function f giving the following: input> f[mike] ...
2
votes
2answers
95 views

Possible to solve this function?

I have this function: Emax[T_, d_] := -(1/2) + d + d/(-1 + E^(d/T)) - 1/2 Coth[1/(2 T)]; All I want is to transform this Function so I get: ...
0
votes
0answers
30 views

Problem in importing function in NDSolveValue

I have a code for solving a system of 2 differential equations (sol1). Given that what's inside is a bit heavy, I define functions so that I can call them. My issue is that when I write everything ...
2
votes
2answers
117 views

Define a function of a function of an arbitrary variable

I want to define a function called int that takes another function as an argument and yields an integral of that function from 0 to 1 (just for example). So I ...
1
vote
1answer
441 views

How to evaluate user-defined functions with variables?

I have an extremely simple question, but I couldn't find anything anywhere, maybe I didn't know what to search for, so feel free to mark it as duplicate if there is a duplicate. Let's say that I ...
1
vote
1answer
40 views

Numerically solving a system of three nonlinear equations by predefining functions [closed]

I have three functions of three variables, f1(x,y,z),f2(x,y,z), and f3(x,y,z), and I'm ...
0
votes
0answers
29 views

function restorage problem [duplicate]

Code below f[1, 1] = 1; f[1, 2] = 2; f[1] = Min[f[1, 1], f[1, 2]] Outputs 1 However, the desired output is ...
1
vote
2answers
128 views

How to transform a series of scalar variables to a vector variable? [closed]

Say a function is set: a := Sum[b[i], {i, 8}] As can be seen that b[i] is a scalar variable. Now I want to transform the ...
2
votes
2answers
113 views

Returning Sin[t] from package turns into Sin[scope`t] [duplicate]

I have a function in scope that returns an expression with a variable t ...
2
votes
1answer
108 views

Transformation of variables in function in mathematica

How do i change variables of function in mathematica ? for example of f(p,q) = p^3 + q^3, from p,q to x= p-q and y = p+q, so that the function now becomes f(x,y) ?
1
vote
1answer
92 views

How to call a function with an arbitrary list as its arguments inside a functional? [duplicate]

I have the following functional defined (i.e. a function of another function) where variableList contains the variable (arguments if you wish) of the ...
3
votes
1answer
103 views

Checking if input is a function

I would like to write a program to find the leading coefficient of a given polynomial. (Sounds easy, right?) I'd like to be able to handle the format x^2-x+7 (with ...
0
votes
2answers
10k views

How to pass a list as function argument?

I have the following function lFreqPhylo[a_, Q_, b_, p_] := Sum[Log[freqFunction[r[[p]][[i]], L[[p]][[i]], a, Q, b, {i, 1, nbranches[[p]]}]; The objects L, r ...
4
votes
2answers
5k views

Using Array Elements as Function Arguments

Suppose I have an array p = {a,b,c,d} and a function f that takes a variable number of arguments. I want to evaluate ...
2
votes
2answers
178 views

Testing for arbitrary algebraic expression in given variable

I want to test, for example with MatchQ, if the argument of a function is an arbitrary expression in a single or several variables whose names can be assumed to be ...