zlelik

145 Reputation

4 Badges

16 years, 153 days

MaplePrimes Activity


These are answers submitted by zlelik

I need only floating-point numeric result.

My exact sample (but very big):

 

w := (z,g) -> .1469061274e-2*(1/Im((piecewise(z < .1950000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.1950000000-z)+.8050000000+.8050000000*z*(-2+2*g)+z],[-2.+2*g,(-2.+2*g)*(.1950000000-z)-.6100000000+1.610000000*g]]),piecewise(z < .2050000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.2050000000-z)+.7950000000+.7950000000*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.2050000000-z)-.5900000000+1.590000000*g]]),piecewise(z < .5,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.5-z)+.5+.5*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.5-z)+1.0*g]]),Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(1-z)+z],[-2.+2.*g,(-2.+2.*g)*(1-z)+1.]]))))[2,2]-piecewise(z < .1950000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.1950000000-z)+.8050000000+.8050000000*z*(-2+2*g)+z],[-2.+2*g,(-2.+2*g)*(.1950000000-z)-.6100000000+1.610000000*g]]),piecewise(z < .2050000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.2050000000-z)+.7950000000+.7950000000*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.2050000000-z)-.5900000000+1.590000000*g]]),piecewise(z < .5,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.5-z)+.5+.5*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.5-z)+1.0*g]]),Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(1-z)+z],[-2.+2.*g,(-2.+2.*g)*(1-z)+1.]]))))[1,1])/piecewise(z < .1950000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.1950000000-z)+.8050000000+.8050000000*z*(-2+2*g)+z],[-2.+2*g,(-2.+2*g)*(.1950000000-z)-.6100000000+1.610000000*g]]),piecewise(z < .2050000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.2050000000-z)+.7950000000+.7950000000*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.2050000000-z)-.5900000000+1.590000000*g]]),piecewise(z < .5,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.5-z)+.5+.5*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.5-z)+1.0*g]]),Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(1-z)+z],[-2.+2.*g,(-2.+2.*g)*(1-z)+1.]]))))[1,2]+2*I*((1-(1/2*piecewise(z < .1950000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.1950000000-z)+.8050000000+.8050000000*z*(-2+2*g)+z],[-2.+2*g,(-2.+2*g)*(.1950000000-z)-.6100000000+1.610000000*g]]),piecewise(z < .2050000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.2050000000-z)+.7950000000+.7950000000*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.2050000000-z)-.5900000000+1.590000000*g]]),piecewise(z < .5,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.5-z)+.5+.5*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.5-z)+1.0*g]]),Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(1-z)+z],[-2.+2.*g,(-2.+2.*g)*(1-z)+1.]]))))[2,2]+1/2*piecewise(z < .1950000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.1950000000-z)+.8050000000+.8050000000*z*(-2+2*g)+z],[-2.+2*g,(-2.+2*g)*(.1950000000-z)-.6100000000+1.610000000*g]]),piecewise(z < .2050000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.2050000000-z)+.7950000000+.7950000000*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.2050000000-z)-.5900000000+1.590000000*g]]),piecewise(z < .5,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.5-z)+.5+.5*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.5-z)+1.0*g]]),Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(1-z)+z],[-2.+2.*g,(-2.+2.*g)*(1-z)+1.]]))))[1,1])^2)/piecewise(z < .1950000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.1950000000-z)+.8050000000+.8050000000*z*(-2+2*g)+z],[-2.+2*g,(-2.+2*g)*(.1950000000-z)-.6100000000+1.610000000*g]]),piecewise(z < .2050000000,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.2050000000-z)+.7950000000+.7950000000*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.2050000000-z)-.5900000000+1.590000000*g]]),piecewise(z < .5,Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(.5-z)+.5+.5*z*(-2+2*g)+z],[-2.+2.*g,(-2.+2.*g)*(.5-z)+1.0*g]]),Matrix(2, 2, [[1.+z*(-2+2*g),(1.+z*(-2+2*g))*(1-z)+z],[-2.+2.*g,(-2.+2.*g)*(1-z)+1.]]))))[1,2]^2)^(1/2)))^(1/2);

 

w(0.1, 0.3);

result is float number 0.0009943065054

evalf(Int(w(z, 0.3), z=0.0..0.1));

result is float number 0.0001028041641

evalf(Int(w(z, 0.3), z=0.0..0.2));

result is very big symbolic equation

for getting float number I try the next

evalf(evalf(Int(w(z, 0.3), z=0.0..0.2)));

and get Error, (in signum/main) too many levels of recursion

 

my final task is make 2D-plot of function

f_final := (g) -> evalf(Int(w(z, g), z=0.0..1));

and than make f_final for more complicated function w(z, g)

 

I try to make more simple example and create this

 

f := (z) -> Im(sqrt(z+1*I))*Re(sqrt(1/z-5*I)) / (Im(sqrt(z+1*I))+Re(sqrt(piecewise(z<0.1, 1/z, z*2+1)*1/z-5*I)));


f(1.3);

                                0.2847624150

evalf(Int(f(z), z=0.0..0.1));
                                0.01407929197

evalf(Int(f(z), z=0.0..100000.0));

and here I don't get floating point and get symbolic expression:

 

  /           5 
 | 1.000000 10 
 |             
 |             
 |             
 |             
 |             
 |             
 |             
 0.            
/              

                                        /          (1/2)\                   
                    /          (1/2)\   |/1       \     |                   
                  Im\(z + 1. I)     / Re||- - 5. I|     |                   
                                        \\z       /     /                   
  ------------------------------------------------------------------------ dz
                          /                                         (1/2)\  
                          |/         /         1           \       \     |  
                          ||piecewise|z < 0.1, -, 2. z + 1.|       |     |  
    /          (1/2)\     ||         \         z           /       |     |  
  Im\(z + 1. I)     / + Re||-------------------------------- - 5. I|     |  
                          \\               z                       /     /  
 

Thnk you very much. It works!

1 2 Page 2 of 2