如何在Mathematica中绘制不同范围的图

时间:2019-06-25 07:53:25

标签: plot wolfram-mathematica piecewise

我是mathematica的新手,如何消除mathematica绘图中的错误,我附加了mathematica代码,我想针对delta2的不同值绘制图表,而delta1从0.02到0.1不等

    ClearAll;
    d1 = 0.2; d2 = 0.7; B = 1; B1 = 0.7; \[Beta] = 0.01; R1 = 
     exp (\[Beta]*B^2 (z - B1)); m = 1; k = 0.1;

    f[z_][\[Delta]2_] = 
      Piecewise[{{1, 
         0 <= z <= 
          d1}, {1 - (\[Delta]1/2)*(1 + Cos[2*(Pi/0.2)*(z - d1 - 0.1)]), 
         d1 <= z <= d1 + 0.2}, {1, 
         d1 + 0.2 <= z <= 
          B1 - 0.1}, {1 - (\[Delta]2/2)*(1 + Cos[2*(Pi/0.2)*(z - B1)]), 
         B1 - 0.1 <= z <= 
          B1}, {R1 - (\[Delta]2/2)*(1 + Cos[2*(Pi/0.2)*(z - B1)]), 
         B1 <= z <= B1 + 0.1}, {R1, B1 + 0.1 <= z <= B}}];
    A = -(m^2/4) - (1/4 k);
    S1[z_] = (f[z]^2/4*A) - ((1 + f[z]^2)/4*A)*Log[(A*f[z]^2) + 1];
    L22[\[Delta]2_] = Sum[(((-f[z]^6)/(6912*A)))/S1[z]*0.001, {z, 0, 1}];

    L2[\[Delta]2_] = L22[\[Delta]2]
    DP[\[Delta]1_, \[Delta]2_] = L2[\[Delta]2];
    Plot[{Dp[\[Delta]1, 0], Dp[\[Delta]1, 0.02], 
      Dp[\[Delta]1, 0.04]}, {\[Delta]2, 0, 1}, Frame -> True, 
     LabelStyle -> Directive[Black, Bold]]

0 个答案:

没有答案