[Date Index] [Thread Index] [Author Index]
Re: problem writing a simple equation--urgent!!!
You could use the following definition u[i_, j_] := x[i] + 2 x[j] u[2, 4] x + 2 x Or if you wanted to use different symbols for x... Clear[u] u[x_][i_, j_] := x[i] + 2x[j] u[y][2, 4] y + 2 y I would tend to use SetDelayed, :=, rather than Set, =, for these definitions. David Park djmp at earthlink.net http://home.earthlink.net/~djmp/ From: aysegul [mailto:erkenays at yahoo.com] To: mathgroup at smc.vnet.net Hi all, I have a problem about writing an equation in mathematica. I am writing the following equation: u[x_, y_] = x + 2*y and when I write for example u[2,4] , it gives the result. But the problem that I have is expressing this equation with parameters. That is u[x, x] = x + 2*x but when I ask u[2,4]; it gives u[2,4] result.It doesn't calculate. So, how can I write this equation? Thanks all.