creating functions from the result of Solve[]
- To: mathgroup at smc.vnet.net
- Subject: [mg41826] creating functions from the result of Solve[]
- From: kroosu at tref.nl (Okke)
- Date: Fri, 6 Jun 2003 09:50:58 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
hello,
i have an equation and i want to make a function from the result of
Solve[].
for example:
IN: Solve[3y[n - 2] + 6y[n - 1] - 2y[n] == 0, y[n]]
OUT: {{y[n] -> (3*y[-2 + n] + 6*y[-1 + n])/2}}
and now i'd like to have the function
y[n_/;n>=0] := (3*y[-2 + n] + 6*y[-1 + n])/2
y[n]/.Flatten[Solve[eqn==0,y[n]]] is possible, but
y[n_]:=y[n]/.Flatten[Solve[eqn==0,y[n]]] isn't
is there anybody who could help me get this to work?
--
Okke
Experience is that marvelous thing that enables you to recognize a
mistake when you make it again.
-- F. P. Jones
- Follow-Ups:
- Re: creating functions from the result of Solve[]
- From: Tomas Garza <tgarza01@prodigy.net.mx>
- Re: creating functions from the result of Solve[]