0
|
7813 Views
|
7 Replies
|
1 Total Likes
View groups...
Share
GROUPS:

# How to define a homogeneous function?

Posted 11 years ago
 Does anybody have any idea on how to define a linearly homogeneous function?The only solution I have come up with involves using rules and 'ReplaceAll'. This solution is not adequate, as it requires a lot of fine tuning.An example:Evaluating the following code, for a suitably defined function f (linearly homogeneous) should return 'True'f[tau x,tau y]==tau f[x,y]Alternatively, evaluatingIn:= f[mu x1,mu x2]should return Out:= mu f[x1,x2]Optionaly, it would really be an added bonus if somehow the definitions would persist, in the following sense:The derivative of a linearly homogeneous function should be a homogeneous function of degree 0, i.e.evaluatingIn:= Derivative[1,0][f][k x,k y]should returnOut:= Derivative[1,0][f][x,y]I would be really gratefull if someone could offer a hint towards the right direction
7 Replies
Sort By:
Posted 11 years ago
 Thanks Sander HuismanIt seems it produces the expected output for this set of inputs I think the part(s)SetAttributes[f, Orderless](*...*)f[?_, ?_ y_] := ? f[1, y]did the trick, or so it seems...I'll try to verify it with some more diverse input... but it looks promisningIt even seems to 'propagate' the required behaviour to the derivativesthanks for taking the time!
Posted 11 years ago
 What should happen with f[x,x]?Should it return x f[1,1] ?if so, than add another rule:f[\[Tau]_, \[Tau]_ ] := \[Tau] f[1, 1]Regards.
Posted 11 years ago
 yes,evaluatingIn:= f[x,x]should produceOut:= x f[1,1]so I did make use of your later suggestion (i.e. f[t_,t_]:= t f[1,1])I also replaced the 'Orderless' attribute with the definitionf[t_ x_,t_]:= t f[x,1]because, for the context which these definitions are made,f[a,1] == f[1,a]does not hold always.So far and for a limited but sensible range of inputs it seems to be working as it should *Unfortunately, the behavior for the derivatives so far seems not the desired one (which makes perfect sense since no defitions involve the derivatives).D[f[x , y], x] /. {x -> a x, y -> a y}evaluates toDerivative[1,0][f][a x,a y]when it would be desirable to evaluate toDerivative[1,0][f][x,y]
Posted 11 years ago
 Hi Jarque,I think the problem with the derivate ist just that D[f[x , y], x] /. {x -> a x, y -> a y}expands to the somewhat strange expression: D[f[a x , a y], a x]What you probably really want is:D[f[a x , a y], x]So use instead:D[f[x, y] /. {x -> a x, y -> a y}, x]and you get a*Derivative[1,0][f][x,y]as expected.
Posted 11 years ago
 In the case of f[X, a Y] /. {X -> x a W/z, Y -> W/z}orf[x a W/z , a W/z]What should be the outcome?Do you want it to return: (a W f[1, x])/z?If so try:ClearAll[f]SetAttributes[f, Orderless]f[\[Tau]_ x_, \[Tau]_ y_] := \[Tau] f[x, y]f[\[Tau]_, \[Tau]_ y_] := \[Tau] f[1, y]f[X, a Y] /. {X -> x a W/z, Y -> W/z}Returns:(a W f[1, x])/z
Posted 11 years ago
 IN: ClearAll[f] f[\[Tau]_ x_, \[Tau]_ y_]:=\[Tau] f[x,y]  f[a,b] f[3a,3b] f[e t,e r] f[tau x,tau y]==tau f[x,y] OUT:f[a,b]3 f[a,b]e f[t,r]TrueThis definition simplifies any definition to a simpeler one.
Posted 11 years ago
 Thank you Sander Huisman for the reply!The proposed solution does not work 'all the way' i.e.f[X, a Y] /. {X -> x a W/z, Y -> W/z}would produce a f[x W, W]/zwhich is not the required result.Also, this solution does not 'propagate' to the derivatives of the function i.e.assuming f is a linearly homogeneous function, then evaluatingf'[x W, W](deriv. wrt x) should evaluate to W f'[x,1] (I think...)which doesn't, in this case.