已知公式如下:
U=1.25*(1+R2/R1)
求随便给了两个知数的公式写法。
如果是要把三个未知数都算了来的话,我会了。
如求U。则算U=1.25*(1+R2/R1)
如求R2则算 R2=1.25/((U-1.25)*R1)
如求R1则算 R1=1.25R2/(V-1.25)
这样算我很晕。DELPHI能不能一个公式就自动套出三个公式来呢? 高手请回头~~

解决方案 »

  1.   

    比较笨的办法,写一个主函数,三个计算函数(对应三个计算公式)。根据主函数中传的参数值来判断调用那一个计算函数.如:function Main(U, R1, R2:Integer):Integer
    begin
      if (U <> nil)and(R1 <> nil)and(R2 = nil) then
        Result := Sub1(U, R1)
      else if (U = nil)and(R1 <> nil)and(R2 <> nil) then
        Result := Sub2(R1, R2)
      else if (U <> nil)and(R1 = nil) and(R2 <> nil) then
        Result := Sub3(U, R2)
      else
        ShowMessage("错误的参数值");
    end;
      

  2.   

    楼主的意思是在Edit中输入
    U=1.25*(1+R2/R1)
    然后计算出
    U=1.25*(1+R2/R1)
    R2=1.25/((U-1.25)*R1)
    R1=1.25R2/(V-1.25)
    这3个等式?
      

  3.   

    没人回答先结,有兴趣继续参考http://bbs.csdn.net/topics/390399937