Extracting just the value of the variable from the result of Solve/NDSolve
- To: mathgroup at smc.vnet.net
- Subject: [mg62803] Extracting just the value of the variable from the result of Solve/NDSolve
- From: Pradeep Suresh <pradeep at purdue.edu>
- Date: Mon, 5 Dec 2005 13:41:11 -0500 (EST)
- References: <dmpa43$hl7$1@smc.vnet.net> <200512032352.SAA15963@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi all,
i am facing a peculiar problem with the curly brackets of the output of
Solve and NDsolve commands....the result of Solve/NSolve/DSolve/NDSolve
all are in the form of {{y->a}} format and at best by doing a y/.soln, i
can get it to {a}, but for my purposes of passing this result to
JAVA(using J/Link), i need the value of the variable as just 'a' and not
'{a}'(i hope i am making myself clear).
E.g.
eqn={F==2*T};
T = 300;
sol = Solve[eqn, F]
F /. sol
gives me {600}, as i said earlier i need the answer 600(which is
different in datatype compared to {600} even though for all practical
purposes {600} is the same as 600). When i use J/link to extract value,
the {600} is not considered an integer/string/double/function,...so i
cannnot use getInteger,getString etc.
Can someone plz suggest a solution this problem, however triveal as it
may sound, it is an important problem in using J/Link to talk with
Mathematica.
Thank you very much in advance!!
Regards,
Pradeep
- Follow-Ups:
- Re: Extracting just the value of the variable from the result of Solve/NDSolve
- From: Renan <renan.birck@Gmail.com>
- Re: Extracting just the value of the variable from the result of Solve/NDSolve