Message Boards Message Boards

0
|
6161 Views
|
5 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to input an equation with implicit variables?

Posted 11 years ago
I want to input an equation, to be solved later in combination with many other equations, that reads f(q,t) == g(1/t, 1/q), where f and g are some functions of q and t to be determined precisely by the other equations.  The problem is, I don't know how to input this equation: if I just use variables f and g and then write something like f/.{t->q, q->t} == g, then the replacement rule evaluates immediately and the equation to be solved becomes f==g, which is not what I want.  How should I input this equation into Mathematica?  Sorry if this question is obvious--I'm a Mathematica novice.
POSTED BY: Tom Rudelius
5 Replies
I am not sure if this is what you are looking for, but perhaps this will help?
 gExample1[q_, t_] := t Sin[q]
 fExample1[q_, t_] := q + t
 
 gExample2[q_, t_] := q Cos[t]
 fExample2[q_, t_] := q - t
 
 
 myEquation[f_, g_, q_, t_] := f[q, t] == g[1/t, 1/q]
 
myEquation[fExample1, gExample1, x, y]
myEquation[fExample2, gExample2, x, y]
Kind Regards, WCC
POSTED BY: W. Craig Carter
Posted 11 years ago
Thanks WCC, but unfortunately this doesn't solve my problem.  The example you gave shows how to solve for t and q given some fixed functions f(t,q), g(t,q).  Rather, what I want is to solve the equations to find f and g as functions of variables t and q to be solved later.  So for a toy example, I want to input:

(1 + t )f  - (1 + 1/q)g == 0
f(t,q) == g(1/q, 1/t)

and solve for f and g.  Of course, the above example is trivial because the solutions are f -> 1 + 1/q, g -> 1+t, but the point is that I need a way to input the second equation above to make it possible for Mathematica to solve when the first question is more complicated.
POSTED BY: Tom Rudelius
Posted 11 years ago
I realize you probably haven't considered looking at your problem from this perspective,
but DSolve can sometimes find unknown functions given some information about them.
Is there any possibility you might be able to turn your problem into a differential equation problem?
Even if you don't really care about the derivatives if it is able to find a solution?
But with those reciprocals I'm not certain DSolve will be able to find any solutions.
POSTED BY: Bill Simpson
Hello Tom, Perhaps I am still not getting it.  I am guessing that you are using parenthesis above for two different things (grouping and functions; functions use a square bracket notation) But, doesn't this little experiment suggest that you will not get a unique solution?

Combining both of your equations:
eq[g_, t_, q_] := (1 + t) g[t, q]  == (1 + 1/q) g[1/q, 1/t]


Example arbitrary function of two variables:
 ftest1[x_, y_] := (y^2/x)
 ftest2[x_, y_] := (x^2/y)
 
 eq[ftest1, t, q]
 eq[ftest2, t, q]
 eq[ArcTan, t , q]
 
 With[
  {equation1 = eq[ftest1, t, q], equation2 = eq[ArcTan, t , q], 
  equation3 = eq[ftest2, t, q]},
ContourPlot[{equation1, equation2, equation3}, {t, -10, 10}, {q, -10,
    10}, ContourStyle -> {{Red, Thickness[0.02], Dashed}, {Blue, 
     Thickness[0.01]}, {Green}}]
]
Seems to show that there common values of t and q are satisfied simultaneously by three different functions.
POSTED BY: W. Craig Carter
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract