微分方程表示

时间:2019-04-13 06:46:50

标签: python sympy

我正在尝试使用sympy处理微分方程系统:

from sympy import symbols, Function
t = symbols('t')

x_2 = Function('x_2')
x_3 = Function('x_3')

eq = x_3(t).diff(t) + x_2(t).diff(t)
eq1 = eq.subs(x_2(t), x_3(t) + x_3(t).diff(t))

答案是:

enter image description here

但我需要采用以下形式的结果:

enter image description here

我尝试使用

eq1.simplify()

但结果相同。

我如何得到这个?谢谢。

1 个答案:

答案 0 :(得分:0)

您可以使用doit:

ArrayList<APICallDetails> apiCallDetailsArray = new ArrayList<>();
APICallDetails apiCallDetails = new APICallDetails();
for (count= 1; count <= callsCount; count++){
        try{
            apiCallDetails = new APICallDetails();
            apiCallDetails.setName(property.getPropertyReader(callName+"_"+count+"_Name", propsFile));
            apiCallDetails.setHost(marketConfigs.getRawJson().get(property.getPropertyReader(callName+"_"+count+"_Host", propsFile)).toString().replaceAll("\"", ""));
            apiCallDetails.setPath(property.getPropertyReader(callName+"_"+count+"_Path", propsFile));
            apiCallDetails.setMethod(property.getPropertyReader(callName+"_"+count+"_Method", propsFile));
            apiCallDetails.setBody(property.getPropertyReader(callName+"_"+count+"_Body", propsFile));

            apiCallDetails = sendAPIRequest.mwRequestWithoutBody(apiCallDetails, marketConfigs);
            BufferedWriter out = null;
            try {
                out = new BufferedWriter ( new FileWriter ( "C:\\file"+count+".html"));
                    out.write("something");
                    out.close();
                } catch (IOException e) {
                    e.printStackTrace();
                    logger.error(new Date()+" - Error in "+getClass()+".apiCallRequester() flow: "+e.toString());
                }

            apiCallDetailsArray.add(apiCallDetails);

        }catch(NullPointerException e){
            e.printStackTrace();
            logger.error(new Date()+" - Error in "+getClass()+".apiCallRequester() flow: "+e.toString());
        }
    }