Trying to use Solve - temp1a.nb (0/1)
- To: mathgroup at smc.vnet.net
- Subject: [mg8199] Trying to use Solve - temp1a.nb (0/1)
- From: sstadler at holadayinc.com (Steve Stadler)
- Date: Mon, 18 Aug 1997 23:24:48 -0400
- Organization: Goldengate Internet Services, Inc.
- Sender: owner-wri-mathgroup at wolfram.com
I am trying to write a program that converts power in milliwatts per
centimeter squared to current in Amps per Meter squared or voltage in
volts
per meter squared.
I would like to have it so that if I know the voltage, I can display
the
calculated power and current and voltage, and if I know the current, I
would
still display the calculated power and current and voltage, and if I
know the
power, I would still display the calculated power and current and
voltage.
I tried using Solve, but when I solve for all the variables, the
solution
lists only two solutions in terms of the other two variables.
I can force the solution by running solve three times and asking for
the
solution of two of the variables, but I think that I shouldn't have to
do
that.
Do you have any suggestions?
Thanks
In[22]:=
convert={power==10voltageWcurrent,voltage==rWcurrent};
Reduce[convert,{power,voltage,current,r}];
temp=Solve[convert,{power,voltage,current,r}]
temp/.{current\[Rule]0.0728357,r\[Rule]377}//N
Solve::"svars":
"Equations may not give solutions for all \"solve\" variables."
Out[22]=
\!\({{power \[Rule] 10\ current\ voltage, r \[Rule]
voltage\/current}}\)
Out[23]=
{{power\[Rule]0.728357 voltage,377.\[Rule]13.7295 voltage}}
In[18]:=
convert={power==10voltageWcurrent,voltage==rWcurrent};
Reduce[convert,{power,voltage,current,r}];
temp=Solve[convert,{power,voltage}];
temp/.{current\[Rule]0.0728357,r\[Rule]377}//N
temp=Solve[convert,{power,current}];
temp/.{voltage\[Rule]27.4591,r\[Rule]377}//N
temp=Solve[convert,{voltage,current}];
temp/.{power\[Rule]20,r\[Rule]377}//N
Out[18]=
{{power\[Rule]20.,voltage\[Rule]27.4591}}
Out[19]=
{{power\[Rule]20.0001,current\[Rule]0.0728358}}
Out[20]=
{{voltage\[Rule]-27.4591,current\[Rule]-0.0728357},{voltage\[Rule]27.4591,
current\[Rule]0.0728357}}