acer

32378 Reputation

29 Badges

19 years, 334 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are answers submitted by acer

Your simplification example is straightforward enough to be handled by several different commands.

Those commands can act differently on more involved examples. Ie,

restart;

ee := (x^2 - 2)/(x - sqrt(2));

(x^2-2)/(x-2^(1/2))

radnormal(ee);

x+2^(1/2)

evala(ee);

x+2^(1/2)

rationalize(ee);

x+2^(1/2)

factor(ee);

x+2^(1/2)

ff := (x^3 - 5*x^2 - 2*x + 10)/(x - sqrt(2));

(x^3-5*x^2-2*x+10)/(x-2^(1/2))

radnormal(ff);

x^2-5*x+x*2^(1/2)-5*2^(1/2)

evala(ff);

x^2-5*x+x*2^(1/2)-5*2^(1/2)

simplify(radnormal(ff));

(x-5)*(x+2^(1/2))

rationalize(ff);

(x-5)*(x+2^(1/2))

factor(ff);

(x-5)*(x+2^(1/2))

Download rad_ex.mw

It is worthwhile familiarizing yourself with these commands.

Here are a few ways, using an interpolating function of your data which can then be used with several plotting commands. 

You did not originally show how you wanted it colored/shaded. So I illustrate a few. Let me know if you really need the restricted/reversed hue-shading (particular color gradient scheme) as shown in your followup reply to Carl.

I used Maple 17, which you've indicated. In later releases there are several easier and more flexible techniques, eg. the `colorscheme` option.

The colorbar is also easier in later versions. I might find a moment to retrofit some mechanisms. I just don't have the 20 minutes right now, to construct all the pieces in Maple 17.

I have not really bothered to optimize for speed.

restart;

x := [0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4]:

y := [0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4]:

z := [0, 0, 0, 0, 0,
      0, .689376362, 1.378752724, 2.068129087, 2.757505449,
      0, 1.02920355, 2.0584071, 3.087610649, 4.116814199,
      0, 1.216469264, 2.432938529, 3.649407793, 4.865877057,
      0, 1.325720912, 2.651441823, 3.977162735, 5.302883646]:

interfunc:=subs(__M=Matrix(Matrix(5,5,z),datatype=float[8]),
                (x,y)->CurveFitting:-ArrayInterpolation([[0,1,2,3,4],[0,1,2,3,4]],
                                                   __M,[[x],[y]],
                                                   method=cubic)[1,1]):

Pdens:=plots:-densityplot(interfunc,0..4,0..4,
                          colorstyle=HUE,style=patchnogrid):
Pdens;

 

 

plots:-contourplot(interfunc,0..4,0..4,coloring=["Orange","Blue"],filled);

 

 

Pcont:=plots:-contourplot(interfunc,0..4,0..4,grid=[51,51],color=black):

plots:-display(Pdens,Pcont);

 

 

 

Download listcontdens_M17.mw

Here are a few ways, using fsolve. I don't know whether it is fast enough for you, or if you need it much faster.

I used Maple 2019.2.

restart;

Digits:=15:

eq[1] := d[0] = 1:
eq[2] := d[0] + d[1] + d[2] + d[3] + d[4] + d[5] + d[6] + d[7] = 0:
eq[3] := b[0] = 1:
eq[4] := b[0] + b[1] + b[2] + b[3] + b[4] + b[5] + b[6] + b[7] = 0:
eq[5] := a[0] = -0.5:
eq[6] := d[1] = 1 + 1.0*a[2]:
eq[7] := a[0] + a[1] + a[2] + a[3] + a[4] + a[5] + a[6] + a[7] + a[8] + a[9] = 0.5:
eq[8] := d[1] + 2*d[2] + 3*d[3] + 4*d[4] + 5*d[5] + 6*d[6] + 7*d[7] = 1.0*a[2] + 3.0*a[3] + 6.0*a[4] + 10.0*a[5] + 15.0*a[6] + 21.0*a[7] + 28.0*a[8] + 36.0*a[9]:
eq[9] := 24*a[4] - 2.104513094*a[1]*a[2] + 6.313539282*a[0]*a[3] + 5.165076420*b[1] + 5.261282735*d[1] = 0:
eq[10] := -88.3895499*a[7]^2 - 191.5106915*a[7]*a[8] - 176.7790999*a[7]*a[9] - 117.8527333*a[8]^2 - 252.5415715*a[8]*a[9] - 151.5249428*a[9]^2 + 25.25415713*a[0]*a[4] + 63.13539282*a[0]*a[5] + 126.2707856*a[0]*a[6] + 220.9738749*a[0]*a[7] + 353.5581998*a[0]*a[8] + 530.3372997*a[0]*a[9] + 12.62707857*a[1]*a[4] + 42.09026188*a[1]*a[5] + 94.70308919*a[1]*a[6] + 176.7790999*a[1]*a[7] + 294.6318332*a[1]*a[8] + 454.5748283*a[1]*a[9] - 4.209026188*a[2]^2 - 12.62707857*a[2]*a[3] - 8.41805237*a[2]*a[4] + 10.52256547*a[2]*a[5] + 50.50831422*a[2]*a[6] + 117.8527333*a[2]*a[7] + 218.8693618*a[2]*a[8] + 359.8717391*a[2]*a[9] - 12.62707857*a[3]^2 - 31.56769641*a[3]*a[4] - 25.25415713*a[3]*a[5] + 50.5083143*a[3]*a[7] + 132.5843249*a[3]*a[8] + 252.5415713*a[3]*a[9] - 25.25415713*a[4]^2 - 58.92636665*a[4]*a[5] - 50.5083142*a[4]*a[6] - 18.9406178*a[4]*a[7] + 42.0902619*a[4]*a[8] + 138.8978642*a[4]*a[9] - 42.09026188*a[5]^2 - 94.7030892*a[5]*a[6] - 84.1805237*a[5]*a[7] - 46.2992881*a[5]*a[8] + 25.2541571*a[5]*a[9] - 63.1353929*a[6]^2 - 138.8978642*a[6]*a[7] - 126.2707857*a[6]*a[8] - 82.0760107*a[6]*a[9] - 2.104513094*a[1]*a[2] + 6.313539282*a[0]*a[3] + 26.30641368*d[5] + 31.56769641*d[6] + 36.82897914*d[7] + 15.78384820*d[3] + 21.04513094*d[4] + 5.261282735*d[1] + 10.52256547*d[2] + 36.15553494*b[7] + 25.82538210*b[5] + 30.99045852*b[6] + 10.33015284*b[2] + 15.49522926*b[3] + 20.66030568*b[4] + 5.165076420*b[1] + 3024.*a[9] + 360.*a[6] + 840.*a[7] + 1680.*a[8] + 24.*a[4] + 120.*a[5] = 0:
eq[11] := 120.*a[5] - 4.209026188*a[2]^2 + 25.25415713*a[0]*a[4] + 10.33015284*b[2] + 10.52256547*d[2] = 0:
eq[12] := -972.2850495*a[7]^2 - 2298.128299*a[7]*a[8] - 2298.128298*a[7]*a[9] - 1532.085532*a[8]^2 - 3535.581998*a[8]*a[9] - 2272.874142*a[9]^2 + 25.25415713*a[0]*a[4] + 126.2707856*a[0]*a[5] + 378.8123569*a[0]*a[6] + 883.8954995*a[0]*a[7] + 1767.790999*a[0]*a[8] + 3182.023798*a[0]*a[9] + 25.25415713*a[1]*a[4] + 126.2707856*a[1]*a[5] + 378.8123569*a[1]*a[6] + 883.8954995*a[1]*a[7] + 1767.790999*a[1]*a[8] + 3182.023798*a[1]*a[9] - 4.209026188*a[2]^2 - 25.25415713*a[2]*a[3] - 25.25415713*a[2]*a[4] + 42.09026184*a[2]*a[5] + 252.5415713*a[2]*a[6] + 707.1163996*a[2]*a[7] + 1532.085532*a[2]*a[8] + 2878.973912*a[2]*a[9] - 37.88123569*a[3]^2 - 126.2707857*a[3]*a[4] - 126.2707857*a[3]*a[5] + 353.5581998*a[3]*a[7] + 1060.674599*a[3]*a[8] + 2272.874141*a[3]*a[9] - 126.2707857*a[4]^2 - 353.5581998*a[4]*a[5] - 353.5581998*a[4]*a[6] - 151.5249424*a[4]*a[7] + 378.812357*a[4]*a[8] + 1388.978642*a[4]*a[9] - 294.6318332*a[5]^2 - 757.6247134*a[5]*a[6] - 757.624714*a[5]*a[7] - 462.992880*a[5]*a[8] + 277.795729*a[5]*a[9] - 568.2185354*a[6]^2 - 1388.978642*a[6]*a[7] - 1388.978642*a[6]*a[8] - 984.912128*a[6]*a[9] + 105.2256547*d[5] + 157.8384820*d[6] + 220.9738748*d[7] + 31.56769640*d[3] + 63.13539282*d[4] + 10.52256547*d[2] + 216.9332096*b[7] + 103.3015284*b[5] + 154.9522926*b[6] + 10.33015284*b[2] + 30.99045852*b[3] + 61.98091704*b[4] + 15120.*a[9] + 720.*a[6] + 2520.*a[7] + 6720.*a[8] + 120.*a[5] = 0:
eq[13] := 720.*a[6] - 25.25415713*a[2]*a[3] + 25.25415713*a[1]*a[4] + 126.2707856*a[0]*a[5] + 30.99045852*b[3] + 31.56769640*d[3] = 0:
eq[14] := -9722.850492*a[7]^2 - 25279.41129*a[7]*a[8] - 27577.53959*a[7]*a[9] - 18385.02639*a[8]^2 - 45962.56593*a[8]*a[9] - 31820.23799*a[9]^2 + 126.2707856*a[0]*a[5] + 757.6247138*a[0]*a[6] + 2651.686498*a[0]*a[7] + 7071.163996*a[0]*a[8] + 15910.11899*a[0]*a[9] + 25.25415713*a[1]*a[4] + 252.5415712*a[1]*a[5] + 1136.437071*a[1]*a[6] + 3535.581998*a[1]*a[7] + 8838.954995*a[1]*a[8] + 19092.14279*a[1]*a[9] - 25.25415713*a[2]*a[3] - 50.50831424*a[2]*a[4] + 126.2707856*a[2]*a[5] + 1010.166285*a[2]*a[6] + 3535.581998*a[2]*a[7] + 9192.513195*a[2]*a[8] + 20152.81739*a[2]*a[9] - 75.76247138*a[3]^2 - 378.8123569*a[3]*a[4] - 505.0831425*a[3]*a[5] + 2121.349198*a[3]*a[7] + 7424.722196*a[3]*a[8] + 18182.99313*a[3]*a[9] - 505.0831426*a[4]^2 - 1767.790999*a[4]*a[5] - 2121.349199*a[4]*a[6] - 1060.674600*a[4]*a[7] + 3030.498859*a[4]*a[8] + 12500.80778*a[4]*a[9] - 1767.790999*a[5]^2 - 5303.372998*a[5]*a[6] - 6060.997709*a[5]*a[7] - 4166.935929*a[5]*a[8] + 2777.95729*a[5]*a[9] - 4545.748282*a[6]^2 - 12500.80779*a[6]*a[7] - 13889.78642*a[6]*a[8] - 10834.03341*a[6]*a[9] + 315.6769641*d[5] + 631.3539280*d[6] + 1104.869374*d[7] + 31.56769640*d[3] + 126.2707856*d[4] + 1084.666048*b[7] + 309.9045852*b[5] + 619.8091704*b[6] + 30.99045852*b[3] + 123.9618341*b[4] + 60480.*a[9] + 720.*a[6] + 5040.*a[7] + 20160.*a[8] - 2.*10^(-7)*a[3]*a[6] = 0:
eq[15] := 2.*d[2] + 5.261282735*a[0]*d[1] - 2.630641368*d[0] = 0:
eq[16] := 17.36935863*d[5] + 27.36935863*d[6] + 39.36935863*d[7] + 3.369358632*d[3] + 9.369358632*d[4] - 2.630641368*d[0] - 2.630641368*d[1] - 0.630641368*d[2] + 36.82897914*a[6]*d[7] + 5.261282735*a[7]*d[1] + 10.52256547*a[7]*d[2] + 15.78384820*a[7]*d[3] + 21.04513094*a[7]*d[4] + 26.30641368*a[7]*d[5] + 31.56769641*a[7]*d[6] + 36.82897914*a[7]*d[7] + 5.261282735*a[8]*d[1] + 10.52256547*a[8]*d[2] + 15.78384820*a[8]*d[3] + 21.04513094*a[8]*d[4] + 26.30641368*a[8]*d[5] + 31.56769641*a[8]*d[6] + 36.82897914*a[8]*d[7] + 5.261282735*a[9]*d[1] + 10.52256547*a[9]*d[2] + 15.78384820*a[9]*d[3] + 21.04513094*a[9]*d[4] + 26.30641368*a[9]*d[5] + 31.56769641*a[9]*d[6] + 36.82897914*a[9]*d[7] + 10.52256547*a[0]*d[2] + 15.78384820*a[0]*d[3] + 21.04513094*a[0]*d[4] + 26.30641368*a[0]*d[5] + 31.56769641*a[0]*d[6] + 36.82897914*a[0]*d[7] + 5.261282735*a[1]*d[1] + 10.52256547*a[1]*d[2] + 15.78384820*a[1]*d[3] + 21.04513094*a[1]*d[4] + 26.30641368*a[1]*d[5] + 31.56769641*a[1]*d[6] + 36.82897914*a[1]*d[7] + 5.261282735*a[2]*d[1] + 10.52256547*a[2]*d[2] + 15.78384820*a[2]*d[3] + 21.04513094*a[2]*d[4] + 26.30641368*a[2]*d[5] + 31.56769641*a[2]*d[6] + 36.82897914*a[2]*d[7] + 5.261282735*a[3]*d[1] + 10.52256547*a[3]*d[2] + 15.78384820*a[3]*d[3] + 21.04513094*a[3]*d[4] + 26.30641368*a[3]*d[5] + 31.56769641*a[3]*d[6] + 36.82897914*a[3]*d[7] + 5.261282735*a[4]*d[1] + 10.52256547*a[4]*d[2] + 15.78384820*a[4]*d[3] + 21.04513094*a[4]*d[4] + 26.30641368*a[4]*d[5] + 31.56769641*a[4]*d[6] + 36.82897914*a[4]*d[7] + 5.261282735*a[5]*d[1] + 10.52256547*a[5]*d[2] + 15.78384820*a[5]*d[3] + 21.04513094*a[5]*d[4] + 26.30641368*a[5]*d[5] + 31.56769641*a[5]*d[6] + 36.82897914*a[5]*d[7] + 5.261282735*a[6]*d[1] + 10.52256547*a[6]*d[2] + 15.78384820*a[6]*d[3] + 21.04513094*a[6]*d[4] + 26.30641368*a[6]*d[5] + 31.56769641*a[6]*d[6] + 5.261282735*a[0]*d[1] = 0:
eq[17] := 6.*d[3] + 5.261282735*a[1]*d[1] + 10.52256547*a[0]*d[2] - 2.630641368*d[1] = 0:
eq[18] := 46.84679316*d[5] + 104.2161518*d[6] + 191.5855104*d[7] - 1.891924104*d[3] + 13.47743453*d[4] - 2.630641368*d[1] - 5.261282736*d[2] + 441.9477498*a[6]*d[7] + 36.82897914*a[7]*d[1] + 84.18052376*a[7]*d[2] + 142.0546338*a[7]*d[3] + 210.4513094*a[7]*d[4] + 289.3705504*a[7]*d[5] + 378.8123569*a[7]*d[6] + 478.7767289*a[7]*d[7] + 42.09026188*a[8]*d[1] + 94.70308923*a[8]*d[2] + 157.8384820*a[8]*d[3] + 231.4964403*a[8]*d[4] + 315.6769641*a[8]*d[5] + 410.3800533*a[8]*d[6] + 515.6057081*a[8]*d[7] + 47.35154462*a[9]*d[1] + 105.2256547*a[9]*d[2] + 173.6223302*a[9]*d[3] + 252.5415713*a[9]*d[4] + 341.9833778*a[9]*d[5] + 441.9477497*a[9]*d[6] + 552.4346872*a[9]*d[7] + 10.52256547*a[0]*d[2] + 31.56769641*a[0]*d[3] + 63.13539282*a[0]*d[4] + 105.2256547*a[0]*d[5] + 157.8384820*a[0]*d[6] + 220.9738749*a[0]*d[7] + 5.261282735*a[1]*d[1] + 21.04513094*a[1]*d[2] + 47.35154461*a[1]*d[3] + 84.18052376*a[1]*d[4] + 131.5320684*a[1]*d[5] + 189.4061784*a[1]*d[6] + 257.8028540*a[1]*d[7] + 10.52256547*a[2]*d[1] + 31.56769641*a[2]*d[2] + 63.13539282*a[2]*d[3] + 105.2256547*a[2]*d[4] + 157.8384820*a[2]*d[5] + 220.9738748*a[2]*d[6] + 294.6318332*a[2]*d[7] + 15.78384820*a[3]*d[1] + 42.09026188*a[3]*d[2] + 78.91924103*a[3]*d[3] + 126.2707856*a[3]*d[4] + 184.1448957*a[3]*d[5] + 252.5415712*a[3]*d[6] + 331.4608123*a[3]*d[7] + 21.04513094*a[4]*d[1] + 52.61282735*a[4]*d[2] + 94.70308923*a[4]*d[3] + 147.3159166*a[4]*d[4] + 210.4513094*a[4]*d[5] + 284.1092676*a[4]*d[6] + 368.2897915*a[4]*d[7] + 26.30641368*a[5]*d[1] + 63.13539282*a[5]*d[2] + 110.4869374*a[5]*d[3] + 168.3610475*a[5]*d[4] + 236.7577231*a[5]*d[5] + 315.6769640*a[5]*d[6] + 405.1187706*a[5]*d[7] + 31.56769641*a[6]*d[1] + 73.65795829*a[6]*d[2] + 126.2707856*a[6]*d[3] + 189.4061784*a[6]*d[4] + 263.0641367*a[6]*d[5] + 347.2446605*a[6]*d[6] = 0:
eq[19] := 24.*d[4] + 10.52256547*a[2]*d[1] + 21.04513094*a[1]*d[2] + 31.56769641*a[0]*d[3] - 5.261282736*d[2] = 0:
eq[20] := 67.38717264*d[5] + 281.0807590*d[6] + 729.5130625*d[7] - 15.78384821*d[3] - 7.56769641*d[4] - 5.261282736*d[2] + 4861.425246*a[6]*d[7] + 220.9738749*a[7]*d[1] + 589.2636663*a[7]*d[2] + 1136.437070*a[7]*d[3] + 1894.061785*a[7]*d[4] + 2893.705504*a[7]*d[5] + 4166.935926*a[7]*d[6] + 5745.320746*a[7]*d[7] + 294.6318332*a[8]*d[1] + 757.6247138*a[8]*d[2] + 1420.546338*a[8]*d[3] + 2314.964404*a[8]*d[4] + 3472.446605*a[8]*d[5] + 4924.560640*a[8]*d[6] + 6702.874204*a[8]*d[7] + 378.8123569*a[9]*d[1] + 947.0308923*a[9]*d[2] + 1736.223302*a[9]*d[3] + 2777.957285*a[9]*d[4] + 4103.800534*a[9]*d[5] + 5745.320747*a[9]*d[6] + 7734.085620*a[9]*d[7] + 31.56769641*a[0]*d[3] + 126.2707856*a[0]*d[4] + 315.6769641*a[0]*d[5] + 631.3539282*a[0]*d[6] + 1104.869374*a[0]*d[7] + 21.04513094*a[1]*d[2] + 94.70308923*a[1]*d[3] + 252.5415712*a[1]*d[4] + 526.1282735*a[1]*d[5] + 947.0308923*a[1]*d[6] + 1546.817124*a[1]*d[7] + 10.52256547*a[2]*d[1] + 63.13539282*a[2]*d[2] + 189.4061784*a[2]*d[3] + 420.9026188*a[2]*d[4] + 789.1924103*a[2]*d[5] + 1325.843249*a[2]*d[6] + 2062.422832*a[2]*d[7] + 31.56769641*a[3]*d[1] + 126.2707856*a[3]*d[2] + 315.6769641*a[3]*d[3] + 631.3539281*a[3]*d[4] + 1104.869374*a[3]*d[5] + 1767.790999*a[3]*d[6] + 2651.686498*a[3]*d[7] + 63.13539282*a[4]*d[1] + 210.4513094*a[4]*d[2] + 473.5154462*a[4]*d[3] + 883.8954995*a[4]*d[4] + 1473.159166*a[4]*d[5] + 2272.874141*a[4]*d[6] + 3314.608123*a[4]*d[7] + 105.2256547*a[5]*d[1] + 315.6769641*a[5]*d[2] + 662.9216246*a[5]*d[3] + 1178.527333*a[5]*d[4] + 1894.061784*a[5]*d[5] + 2841.092676*a[5]*d[6] + 4051.187706*a[5]*d[7] + 157.8384820*a[6]*d[1] + 441.9477497*a[6]*d[2] + 883.8954995*a[6]*d[3] + 1515.249428*a[6]*d[4] + 2367.577230*a[6]*d[5] + 3472.446605*a[6]*d[6] = 0:
eq[21] := 2.119408818*b[2] + 6.176017503*a[0]*b[1] + 42.07215928*a[2] + 0.5*d[0] = 0:
eq[22] := 0.5*d[5] + 0.5*d[6] + 0.5*d[7] + 0.5*d[3] + 0.5*d[4] + 0.5*d[0] + 0.5*d[1] + 0.5*d[2] + 44.50758518*b[7] + 21.19408818*b[5] + 31.79113227*b[6] + 2.119408818*b[2] + 6.358226454*b[3] + 12.71645291*b[4] + 1514.597734*a[9] + 631.0823892*a[6] + 883.5153448*a[7] + 1178.020460*a[8] + 126.2164778*a[3] + 252.4329557*a[4] + 420.7215928*a[5] + 42.07215928*a[2] + 12.35203501*a[0]*b[2] + 18.52805251*a[0]*b[3] + 24.70407001*a[0]*b[4] + 30.88008752*a[0]*b[5] + 37.05610502*a[0]*b[6] + 43.23212252*a[0]*b[7] + 6.176017503*a[1]*b[1] + 12.35203501*a[1]*b[2] + 18.52805251*a[1]*b[3] + 24.70407001*a[1]*b[4] + 30.88008752*a[1]*b[5] + 37.05610502*a[1]*b[6] + 43.23212252*a[1]*b[7] + 6.176017503*a[2]*b[1] + 12.35203501*a[2]*b[2] + 18.52805251*a[2]*b[3] + 24.70407001*a[2]*b[4] + 30.88008752*a[2]*b[5] + 37.05610502*a[2]*b[6] + 43.23212252*a[2]*b[7] + 6.176017503*a[3]*b[1] + 12.35203501*a[3]*b[2] + 18.52805251*a[3]*b[3] + 24.70407001*a[3]*b[4] + 30.88008752*a[3]*b[5] + 37.05610502*a[3]*b[6] + 43.23212252*a[3]*b[7] + 6.176017503*a[4]*b[1] + 12.35203501*a[4]*b[2] + 18.52805251*a[4]*b[3] + 24.70407001*a[4]*b[4] + 30.88008752*a[4]*b[5] + 37.05610502*a[4]*b[6] + 43.23212252*a[4]*b[7] + 6.176017503*a[5]*b[1] + 12.35203501*a[5]*b[2] + 18.52805251*a[5]*b[3] + 24.70407001*a[5]*b[4] + 30.88008752*a[5]*b[5] + 37.05610502*a[5]*b[6] + 43.23212252*a[5]*b[7] + 6.176017503*a[6]*b[1] + 12.35203501*a[6]*b[2] + 18.52805251*a[6]*b[3] + 24.70407001*a[6]*b[4] + 30.88008752*a[6]*b[5] + 37.05610502*a[6]*b[6] + 43.23212252*a[6]*b[7] + 6.176017503*a[7]*b[1] + 12.35203501*a[7]*b[2] + 18.52805251*a[7]*b[3] + 24.70407001*a[7]*b[4] + 30.88008752*a[7]*b[5] + 37.05610502*a[7]*b[6] + 43.23212252*a[7]*b[7] + 6.176017503*a[8]*b[1] + 12.35203501*a[8]*b[2] + 18.52805251*a[8]*b[3] + 24.70407001*a[8]*b[4] + 30.88008752*a[8]*b[5] + 37.05610502*a[8]*b[6] + 43.23212252*a[8]*b[7] + 6.176017503*a[9]*b[1] + 12.35203501*a[9]*b[2] + 18.52805251*a[9]*b[3] + 24.70407001*a[9]*b[4] + 30.88008752*a[9]*b[5] + 37.05610502*a[9]*b[6] + 43.23212252*a[9]*b[7] + 6.176017503*a[0]*b[1] = 0:
eq[23] := 6.358226454*b[3] + 6.176017503*a[1]*b[1] + 12.35203501*a[0]*b[2] + 126.2164778*a[3] + 0.5*d[1] = 0:
eq[24] := 2.5*d[5] + 3.0*d[6] + 3.5*d[7] + 1.5*d[3] + 2.0*d[4] + 0.5*d[1] + d[2] + 222.5379259*b[7] + 63.58226454*b[5] + 127.1645291*b[6] + 6.358226454*b[3] + 25.43290582*b[4] + 10602.18414*a[9] + 2524.329557*a[6] + 4417.576724*a[7] + 7068.122760*a[8] + 126.2164778*a[3] + 504.8659114*a[4] + 1262.164778*a[5] + 12.35203501*a[0]*b[2] + 37.05610502*a[0]*b[3] + 74.11221004*a[0]*b[4] + 123.5203501*a[0]*b[5] + 185.2805251*a[0]*b[6] + 259.3927351*a[0]*b[7] + 6.176017503*a[1]*b[1] + 24.70407002*a[1]*b[2] + 55.58415753*a[1]*b[3] + 98.81628005*a[1]*b[4] + 154.4004376*a[1]*b[5] + 222.3366301*a[1]*b[6] + 302.6248576*a[1]*b[7] + 12.35203501*a[2]*b[1] + 37.05610502*a[2]*b[2] + 74.11221004*a[2]*b[3] + 123.5203501*a[2]*b[4] + 185.2805251*a[2]*b[5] + 259.3927351*a[2]*b[6] + 345.8569801*a[2]*b[7] + 18.52805251*a[3]*b[1] + 49.40814003*a[3]*b[2] + 92.64026255*a[3]*b[3] + 148.2244201*a[3]*b[4] + 216.1606126*a[3]*b[5] + 296.4488402*a[3]*b[6] + 389.0891027*a[3]*b[7] + 24.70407001*a[4]*b[1] + 61.76017503*a[4]*b[2] + 111.1683151*a[4]*b[3] + 172.9284901*a[4]*b[4] + 247.0407002*a[4]*b[5] + 333.5049452*a[4]*b[6] + 432.3212252*a[4]*b[7] + 30.88008752*a[5]*b[1] + 74.11221004*a[5]*b[2] + 129.6963676*a[5]*b[3] + 197.6325601*a[5]*b[4] + 277.9207877*a[5]*b[5] + 370.5610502*a[5]*b[6] + 475.5533477*a[5]*b[7] + 37.05610502*a[6]*b[1] + 86.46424505*a[6]*b[2] + 148.2244201*a[6]*b[3] + 222.3366301*a[6]*b[4] + 308.8008752*a[6]*b[5] + 407.6171552*a[6]*b[6] + 518.7854702*a[6]*b[7] + 43.23212252*a[7]*b[1] + 98.81628005*a[7]*b[2] + 166.7524726*a[7]*b[3] + 247.0407001*a[7]*b[4] + 339.6809627*a[7]*b[5] + 444.6732602*a[7]*b[6] + 562.0175927*a[7]*b[7] + 49.40814002*a[8]*b[1] + 111.1683151*a[8]*b[2] + 185.2805251*a[8]*b[3] + 271.7447701*a[8]*b[4] + 370.5610502*a[8]*b[5] + 481.7293652*a[8]*b[6] + 605.2497153*a[8]*b[7] + 55.58415753*a[9]*b[1] + 123.5203501*a[9]*b[2] + 203.8085776*a[9]*b[3] + 296.4488401*a[9]*b[4] + 401.4411377*a[9]*b[5] + 518.7854703*a[9]*b[6] + 648.4818378*a[9]*b[7] = 0:
eq[25] := 25.43290582*b[4] + 12.35203501*a[2]*b[1] + 24.70407002*a[1]*b[2] + 37.05610502*a[0]*b[3] + 504.8659114*a[4] + d[2] = 0:
eq[26] := 10.0*d[5] + 15.0*d[6] + 21.0*d[7] + 3.0*d[3] + 6.0*d[4] + d[2] + 890.1517036*b[7] + 127.1645291*b[5] + 381.4935873*b[6] + 25.43290582*b[4] + 63613.10484*a[9] + 7572.988671*a[6] + 17670.30690*a[7] + 35340.61380*a[8] + 504.8659114*a[4] + 2524.329556*a[5] + 37.05610502*a[0]*b[3] + 148.2244201*a[0]*b[4] + 370.5610502*a[0]*b[5] + 741.1221004*a[0]*b[6] + 1296.963676*a[0]*b[7] + 24.70407002*a[1]*b[2] + 111.1683151*a[1]*b[3] + 296.4488402*a[1]*b[4] + 617.6017504*a[1]*b[5] + 1111.683151*a[1]*b[6] + 1815.749146*a[1]*b[7] + 12.35203501*a[2]*b[1] + 74.11221005*a[2]*b[2] + 222.3366301*a[2]*b[3] + 494.0814003*a[2]*b[4] + 926.4026256*a[2]*b[5] + 1556.356411*a[2]*b[6] + 2420.998862*a[2]*b[7] + 37.05610502*a[3]*b[1] + 148.2244201*a[3]*b[2] + 370.5610503*a[3]*b[3] + 741.1221006*a[3]*b[4] + 1296.963676*a[3]*b[5] + 2075.141881*a[3]*b[6] + 3112.712822*a[3]*b[7] + 74.11221004*a[4]*b[1] + 247.0407002*a[4]*b[2] + 555.8415753*a[4]*b[3] + 1037.570941*a[4]*b[4] + 1729.284901*a[4]*b[5] + 2668.039561*a[4]*b[6] + 3890.891028*a[4]*b[7] + 123.5203501*a[5]*b[1] + 370.5610502*a[5]*b[2] + 778.1782055*a[5]*b[3] + 1383.427921*a[5]*b[4] + 2223.366301*a[5]*b[5] + 3335.049452*a[5]*b[6] + 4755.533478*a[5]*b[7] + 185.2805251*a[6]*b[1] + 518.7854703*a[6]*b[2] + 1037.570941*a[6]*b[3] + 1778.693041*a[6]*b[4] + 2779.207876*a[6]*b[5] + 4076.171553*a[6]*b[6] + 5706.640175*a[6]*b[7] + 259.3927351*a[7]*b[1] + 691.7139604*a[7]*b[2] + 1334.019781*a[7]*b[3] + 2223.366302*a[7]*b[4] + 3396.809627*a[7]*b[5] + 4891.405863*a[7]*b[6] + 6744.211115*a[7]*b[7] + 345.8569802*a[8]*b[1] + 889.3465205*a[8]*b[2] + 1667.524727*a[8]*b[3] + 2717.447702*a[8]*b[4] + 4076.171553*a[8]*b[5] + 5780.752383*a[8]*b[6] + 7868.246300*a[8]*b[7] + 444.6732602*a[9]*b[1] + 1111.683151*a[9]*b[2] + 2038.085777*a[9]*b[3] + 3260.937242*a[9]*b[4] + 4817.293653*a[9]*b[5] + 6744.211114*a[9]*b[6] + 9078.745732*a[9]*b[7] = 0:

ans1:=CodeTools:-Usage(
   fsolve([seq(eval(eq[i],[eq[1],eq[3],eq[5]]), i = {$1..26} minus {1,3,5})],
          {seq(a[i], i = 1 .. 9),seq(b[i], i = 1 .. 7),seq(d[i], i = 1 .. 7)})
):
% union eval({eq[1],eq[3],eq[5]},%);
max(abs~([seq(evalf[5](evalf[50](eval((rhs-lhs)(eq[i]),%))),i=1..26)]));

memory used=101.54MiB, alloc change=36.00MiB, cpu time=748.00ms, real time=749.00ms, gc time=69.62ms

{a[0] = -.5, a[1] = 4.32375717286124, a[2] = -10.3916808893481, a[3] = -4.37793022080622, a[4] = 20.9848616428886, a[5] = 2.88811154030335, a[6] = -27.7320234280139, a[7] = 18.9496346647742, a[8] = -3.37842933403158, a[9] = -.266301148627605, b[0] = 1, b[1] = -108.924352850057, b[2] = 47.3439092349469, b[3] = 591.097526763819, b[4] = -734.087769795466, b[5] = -7.21902282081380, b[6] = 312.721961795463, b[7] = -101.932252327892, d[0] = 1, d[1] = -9.39168088934813, d[2] = -11.0377514449392, d[3] = 21.8113102540731, d[4] = 10.9837400537900, d[5] = .274415898348425, d[6] = -25.2503779587453, d[7] = 11.6103440868212}

0.31195e-8

ans2:=CodeTools:-Usage(
   fsolve([seq(eval(eq[i],[eq[1],eq[3],eq[5]]), i = {$1..26} minus {1,3,5})],
          {seq(a[i], i = 1 .. 9),seq(b[i], i = 1 .. 7),seq(d[i], i = 1 .. 7)},
   avoid={ans1})
):
% union eval({eq[1],eq[3],eq[5]},%);
max(abs~([seq(evalf[5](evalf[50](eval((rhs-lhs)(eq[i]),%))),i=1..26)]));

memory used=1.47GiB, alloc change=16.00MiB, cpu time=13.64s, real time=12.38s, gc time=2.64s

{a[0] = -.5, a[1] = 473.614434960278, a[2] = -1.21088206676893, a[3] = -814.465012328412, a[4] = -162.479922733996, a[5] = -22.1634383721724, a[6] = 2499.68873209887, a[7] = -3483.73233012660, a[8] = 1889.85415576583, a[9] = -378.105737197022, b[0] = 1, b[1] = 23.7420373170795, b[2] = 58.3936620178671, b[3] = 5302.26159219180, b[4] = -19761.5068929739, b[5] = 26397.3280786320, b[6] = -15175.8506105258, b[7] = 3154.63213334095, d[0] = 1, d[1] = -.210882066768931, d[2] = 1.03794313974688, d[3] = 88.3976988001500, d[4] = -372.809908888624, d[5] = 560.251387803974, d[6] = -366.530299437831, d[7] = 88.8640606493531}

0.49749e-5

CodeTools:-Usage(
   fsolve([seq(eval(eq[i],[eq[1],eq[3],eq[5]]), i = {$1..26} minus {1,3,5})],
          {seq(a[i], i = 1 .. 9),seq(b[i], i = 1 .. 7),seq(d[i], i = 1 .. 7)},
   avoid={ans1, ans2})
):
% union eval({eq[1],eq[3],eq[5]},%);
max(abs~([seq(evalf[5](evalf[50](eval((rhs-lhs)(eq[i]),%))),i=1..26)]));

memory used=1.57GiB, alloc change=-4.00MiB, cpu time=14.71s, real time=13.49s, gc time=2.53s

{a[0] = -.5, a[1] = -1.47913389976148, a[2] = -10.0135460083299, a[3] = 25.0840073123551, a[4] = -3.07976713388045, a[5] = -18.6004959448165, a[6] = -1.91533710533566, a[7] = 16.1443983642844, a[8] = -5.17425515311063, a[9] = 0.341295685951660e-1, b[0] = 1, b[1] = 44.8574953217569, b[2] = 263.899930958965, b[3] = -176.445025694700, b[4] = 530.321442269004, b[5] = -1781.68764750668, b[6] = 1434.90149310926, b[7] = -316.847688457609, d[0] = 1, d[1] = -9.01354600832993, d[2] = -10.5403828146886, d[3] = -24.8853388211367, d[4] = -71.9204338581995, d[5] = 384.191239090326, d[6] = -380.703374127638, d[7] = 111.871836539667}

0.19993e-7

small:={seq(eq[i],i=1..8)}:
foo:=eliminate(small,{a[0],b[0],d[0],a[1],b[1],d[1],a[2],b[2],d[2]}):

alt1:=CodeTools:-Usage(
   fsolve([seq(eval(eq[i],foo[1]), i = {$9..26})],
          {seq(a[i], i = 3 .. 9),seq(b[i], i = 2 .. 7),seq(d[i], i = 3 .. 7)})
):
% union eval(foo[1],%);
max(abs~([seq(evalf[5](evalf[50](eval((rhs-lhs)(eq[i]),%))),i=1..26)]));

memory used=76.70MiB, alloc change=0 bytes, cpu time=698.00ms, real time=592.00ms, gc time=221.39ms

{58.3936620178671 = 58.3936620178671, a[0] = -.500000000000000, a[1] = 473.61443496043, a[2] = -1.210882066767, a[3] = -814.465012328412, a[4] = -162.479922733996, a[5] = -22.1634383721724, a[6] = 2499.68873209887, a[7] = -3483.73233012660, a[8] = 1889.85415576583, a[9] = -378.105737197022, b[0] = 1, b[1] = 23.74203731705, b[2] = 58.3936620178671, b[3] = 5302.26159219180, b[4] = -19761.5068929739, b[5] = 26397.3280786320, b[6] = -15175.8506105258, b[7] = 3154.63213334095, d[0] = 1, d[1] = -.210882066767, d[2] = 1.037943139737, d[3] = 88.3976988001500, d[4] = -372.809908888624, d[5] = 560.251387803974, d[6] = -366.530299437831, d[7] = 88.8640606493531}

0.14028e-4

alt2:=CodeTools:-Usage(
   fsolve([seq(eval(eq[i],foo[1]), i = {$9..26})],
          {seq(a[i], i = 3 .. 9),seq(b[i], i = 2 .. 7),seq(d[i], i = 3 .. 7)},
           avoid={alt1})
):
% union eval(foo[1],%);
max(abs~([seq(evalf[5](evalf[50](eval((rhs-lhs)(eq[i]),%))),i=1..26)]));

memory used=328.98MiB, alloc change=0 bytes, cpu time=2.61s, real time=2.35s, gc time=531.75ms

{33.6836392815204 = 33.6836392815204, a[0] = -.500000000000000, a[1] = -564.3391522566, a[2] = -1.239554618808, a[3] = 435.240596218131, a[4] = 117.265319932553, a[5] = 9.40586196156122, a[6] = 2527.90909984453, a[7] = -5405.84246231077, a[8] = 3783.96364953286, a[9] = -901.363358303432, b[0] = 1, b[1] = 6.39203588489, b[2] = 33.6836392815204, b[3] = -5103.27594542278, b[4] = 12422.4664804907, b[5] = -7331.36147713295, b[6] = -2436.22948761474, b[7] = 2407.32475451336, d[0] = 1, d[1] = -.239554618808, d[2] = 1.000229538753, d[3] = -117.773461803074, d[4] = 417.605706594865, d[5] = -573.430608689689, d[6] = 354.595274441364, d[7] = -82.7575854634121}

0.88648e-5

alt3:=CodeTools:-Usage(
   fsolve([seq(eval(eq[i],foo[1]), i = {$9..26})],
          {seq(a[i], i = 3 .. 9),seq(b[i], i = 2 .. 7),seq(d[i], i = 3 .. 7)},
           avoid={alt1,alt2})
):
% union eval(foo[1],%);
max(abs~([seq(evalf[5](evalf[50](eval((rhs-lhs)(eq[i]),%))),i=1..26)]));

memory used=1.26GiB, alloc change=0 bytes, cpu time=11.10s, real time=9.94s, gc time=2.38s

{47.3439092349469 = 47.3439092349469, a[0] = -.500000000000000, a[1] = 4.32375717286122, a[2] = -10.3916808893474, a[3] = -4.37793022080622, a[4] = 20.9848616428886, a[5] = 2.88811154030335, a[6] = -27.7320234280139, a[7] = 18.9496346647742, a[8] = -3.37842933403158, a[9] = -.266301148627605, b[0] = 1, b[1] = -108.924352850057, b[2] = 47.3439092349469, b[3] = 591.097526763819, b[4] = -734.087769795466, b[5] = -7.21902282081380, b[6] = 312.721961795463, b[7] = -101.932252327892, d[0] = 1, d[1] = -9.3916808893474, d[2] = -11.0377514449400, d[3] = 21.8113102540731, d[4] = 10.9837400537900, d[5] = .274415898348425, d[6] = -25.2503779587453, d[7] = 11.6103440868212}

0.58610e-8

 

Download fsolve_sys_pared.mw

Here are some alternatives.

You could choose which of the three flavours you prefer.

The results assigned to Nstep are used to apply seven single steps of Newton's method, to get an approximate root (for both examples).

You might prefer to apply Nstep in a loop, so that you could bail out early is adequate convergence to a root were discovered. (What you don't want to do is redo the differentiation inside a loop. It's only needed once, before the loop, ie. to create Nstep.)

restart

"f(x) := x^2"

proc (x) options operator, arrow, function_assign; x^2 end proc

unapply(diff(f(x), x), x)

proc (x) options operator, arrow; 2*x end proc

D(f)

proc (x) options operator, arrow, function_assign; 2*x end proc

unapply(diff(f(x), x), x)

proc (x) options operator, arrow; 2*x end proc

unapply(x-f(x)/(diff(f(x), x)), x)

proc (x) options operator, arrow; (1/2)*x end proc

unapply(x-f(x)/(D(f))(x), x)

proc (x) options operator, arrow; (1/2)*x end proc

Nstep := unapply(x-f(x)/(diff(f(x), x)), x)

proc (x) options operator, arrow; (1/2)*x end proc

(Nstep@@7)(3.0); f(%)

0.2343750000e-1

0.5493164062e-3

restart

f := proc (x) options operator, arrow; 5*x^3+x-7 end proc

proc (x) options operator, arrow; 5*x^3+x-7 end proc

unapply(diff(f(x), x), x)

proc (x) options operator, arrow; 15*x^2+1 end proc

D(f)

proc (x) options operator, arrow; 15*x^2+1 end proc

unapply(diff(f(x), x), x)

proc (x) options operator, arrow; 15*x^2+1 end proc

unapply(x-f(x)/(diff(f(x), x)), x)

proc (x) options operator, arrow; x-(5*x^3+x-7)/(15*x^2+1) end proc

unapply(x-f(x)/(D(f))(x), x)

proc (x) options operator, arrow; x-(5*x^3+x-7)/(15*x^2+1) end proc

Nstep := unapply(x-f(x)/(diff(f(x), x)), x)

proc (x) options operator, arrow; x-(5*x^3+x-7)/(15*x^2+1) end proc

(Nstep@@7)(3.0); f(%)

1.059154735

-0.5e-8

 

Download diff_variants.mw

Perhaps you have been instructed to do something like this, using the given f:

f:=n->n/(n+1);

proc (n) options operator, arrow; n/(n+1) end proc

seq(f(2*n), n=0..4);

0, 2/3, 4/5, 6/7, 8/9

seq(f(7*n-5), n=1..3);

2/3, 9/10, 16/17

seq(f(2*n-1)^2, n=1..4);

1/4, 9/16, 25/36, 49/64

seq(f(n^2-1), n=1..6);

0, 3/4, 8/9, 15/16, 24/25, 35/36

Download seq_fun.mw

Is it possible that you mis-copied the last example, and inadvertantly omitted the term 15/16?

You could just use rad (or radian) in the place where you would normally specify some other unit name.

Compare also with  arcdeg  as unit name (supported by Maple, not sure about Flow).

Here is one way:

ee := xxtt;

xxtt

parse~(StringTools:-Explode(ee))[];

x, x, t, t

You appear to be defining N__2 as N__1 where x=200. And so your N__2 doesn't depend on x.

So what then do you intend by eval(N__2, x = x - 200) as appearing in your piecewise?!

That aspect aside, you can evaluate as follows (and, naturally, this changes if you make some correction related to my query):

restart;

N__1 := dsolve([diff(y(x), x, x) + 3*diff(y(x), x) + 2*y(x) = x^2 + 5,
                y(0) = 1, D(y)(0)], y(x));

y(x) = (7/4)*exp(-2*x)+17/4-(3/2)*x+(1/2)*x^2-5*exp(-x)

NN__1 := eval(y(x), N__1);

(7/4)*exp(-2*x)+17/4-(3/2)*x+(1/2)*x^2-5*exp(-x)

NN__2 := eval(NN__1, x=200);

(7/4)*exp(-400)+78817/4-5*exp(-200)

N := piecewise(0 <= x and x <= 200, NN__1,
               200 <= x and x <= 1000, eval(NN__2, x = x - 200));

N := piecewise(0 <= x and x <= 200, 7*exp(-2*x)*(1/4)+17/4-3*x*(1/2)+(1/2)*x^2-5*exp(-x), 200 <= x and x <= 1000, 7*exp(-400)*(1/4)+78817/4-5*exp(-200))

plot(N, x = 0 .. 1000);

Download ThomasBH_2.mw

You could call rsolve on the system, after converting floats to exact rationals. This produces an explicit solution.

You could then utilize the explicit result, eg. applying evalf to the result formulas, or applying evalf after using values for t.  See each of ansE, andF, and ansFF below. Of those, offhand I would suggest the first scheme with ansE, substituting values of t into the exact formulas and then applying evalf as a last step. Your mileage may vary.

You could experiment with higher Digits, when evaluating and evalf'ing at concrete values of t.

restart

eqns := {x(t+1) = (1+10^(-6)*(0.4e-2-0.6e-2)/(0.1e-3))*x(t)+0.7e-1*10^(-6)*y(t), y(t+1) = 0.6e-2*10^(-6)*x(t)/(0.1e-3)+(1-0.7e-1*10^(-6))*y(t)};

{x(t+1) = .9999800000*x(t)+0.7000000000e-7*y(t), y(t+1) = 0.6000000000e-4*x(t)+.9999999300*y(t)}

(1)

ics := x(0) = 1, y(0) = 0.6e-2/(0.1e-3*0.7e-1);

x(0) = 1, y(0) = 857.1428571

(2)

exactsys := convert(`union`(eqns, {ics}), rational, exact);

{x(0) = 1, x(t+1) = (49999/50000)*x(t)+(7/100000000)*y(t), y(0) = 8571428571/10000000, y(t+1) = (3/50000)*x(t)+(99999993/100000000)*y(t)}

(3)

ansE := rsolve(exactsys, {x(t), y(t)}):

seq(evalf(eval([x(t), y(t)], ansE)), t = 0 .. 10);

[1.000000000, 857.1428571], [1.000040000, 857.1428578], [1.000079998, 857.1428571], [1.000119996, 857.1428571], [1.000159995, 857.1428578], [1.000199991, 857.1428571], [1.000239985, 857.1428578], [1.000279982, 857.1428571], [1.000319976, 857.1428571], [1.000359969, 857.1428564], [1.000399962, 857.1428571]

(4)

ansF := evalf(simplify(evala(ansE)))

{x(t) = 2.959071540*1.000000139^t-1.959071540*.9999797914^t, y(t) = 851.3060785*1.000000139^t+5.836778856*.9999797914^t}

(5)

seq(eval([x(t), y(t)], ansF), t = 0 .. 10);

[1.000000000, 857.1428574], [1.000040001, 857.1428577], [1.000080002, 857.1428582], [1.000120002, 857.1428585], [1.000160001, 857.1428589], [1.000199999, 857.1428593], [1.000239997, 857.1428597], [1.000279993, 857.1428600], [1.000319988, 857.1428605], [1.000359984, 857.1428609], [1.000399978, 857.1428612]

(6)

ansFF := simplify(ansF);

{x(t) = 2.959071540*exp(0.1389999903e-6*t)-1.959071540*exp(-0.2020880420e-4*t), y(t) = 851.3060785*exp(0.1389999903e-6*t)+5.836778856*exp(-0.2020880420e-4*t)}

(7)

seq(eval([x(t), y(t)], ansFF), t = 0 .. 10);

[1.000000000, 857.1428574], [1.000040001, 857.1428577], [1.000080002, 857.1428582], [1.000120002, 857.1428585], [1.000160000, 857.1428589], [1.000199999, 857.1428593], [1.000239997, 857.1428597], [1.000279993, 857.1428600], [1.000319988, 857.1428605], [1.000359984, 857.1428609], [1.000399978, 857.1428612]

(8)

``NULL

Download SystemRecursive_ac.mw

You could compare results with those from a recursive procedure such as Kitonum supplied. Don't expect both to agree to all decimal places.

The following attachment demonstrates re-using the "preconditioned" information (eg. column switching to minimize fill-in, etc), given that the new Matrix has the exact same sparsity pattern as the original.

sparse_direct_symb8.mw

The next attachment replaces my SLU procedure from my previous code, as an edit to your revision of the original worksheet. It implements the previous SLU's actions but in a finer set of steps, allowing the "symbolic precontioninging" to be reused for subsequent calls.

Phasefield2DBaseCodeParametricMay02_ac1.mw

It gets some timing improvement over my previous. But I have not had time to replace the Jac1 procedure with an efficient scheme of generating the sparse matrix's triple-of-vectors (neither compressed nor uncompressed row-column index vectors). As the problem size grew that Jac1 incurred a significant portion of the time cost.

As bonus, UMFPACK's Control array is here directly available, and you could even try tweaking certain parameters of the solver. (Earlier I had mistakenly presumed that array was a struct, so it was easier than I'd imagined.)

Perhaps you could utilize this (slightly modified, accordingly) alongside your code that efficiently produces the sparse Matrix directly in a triple-vector format.

[edit] For anyone else reading this, the goal here is to remove the need for calling umfpack_dl_symbolic following the first sparse linear solve. This is remove duplicated effort in constructing the preconditioning -- given that the sparsity pattern of the lhs matrix remains the same for all linear solves.

The goal here is not to provide functionality to allow different rhs B in repeated linear solving. In fact since I didn't provide a way to undefine the module's Sym and Num locals then at present it can only be used for a single sparsity pattern per restart. And it also doesn't have functionlity to "free" memory associate with those handles.

You can use the eval command for this, to evaluate expressions using substitutions for x.

These eval calls can each be passed directly as the first argument in calls to the plot command.

V1 := -x:
V2:= -2*x + 4.95:
V3:= -x + 1.665:

l_1:=1.665: l_2:=4.95:

eval(V2, x=x-l_1);

        -2 x + 8.280

eval(V3, x=x-l_1-l_2);

         -x + 8.280

There are several variants on all that. Here is one such, in which l_1 and l_2 do not need to actually be assigned.

restart;
V1 := -x:
V2:= -2*x + 4.95:
V3:= -x + 1.665:

params := [ l_1=1.665, l_2=4.95 ]:

eval(V2, x=eval(x-l_1, params));

        -2 x + 8.280

eval(V3, x=eval(x-l_1-l_2, params));

         -x + 8.280

kernelopts(version);

`Maple 18.02, X86 64 LINUX, Oct 20 2014, Build ID 991181`

A:= {{a, b, c}, {a, b, d}};

{{a, b, c}, {a, b, d}}

`+`(op((`+`@op)~(A)));

2*a+2*b+c+d

add(add(xx,xx=x),x=A);

2*a+2*b+c+d

Download add_map_sets.mw

The following uses RootFinding:-NextZero (internally):

   fsolve(cos(x)=x^2/1000,x=-40..40,maxsols=infinity);

On my Maple 2022.0 (and 2018.2, which is what the OP seems to have used) that returns 22 roots.

This is a common mistake.

One way to deal with it is to construct the operator (procedure) G by using the unapply command.

Another way is to use expressions instead of operators for g and G.

restart;

g := x -> 1;

proc (x) options operator, arrow; 1 end proc

G := unapply(int(g(x),x),x);

proc (x) options operator, arrow; x end proc

G(x);

x

G(5);

5

restart;

g := 1;

1

G := int(g, x);

x

eval(G, x=5);

5

Download expr_vs_operators.mw

f:=(x,y)->piecewise(x<>0 or y<>0,(y^2+x^2)^x,1):

DX,DY:=D[1](f),D[2](f):

DX(1,1),DY(1,1);

               2 ln(2) + 2, 2
First 68 69 70 71 72 73 74 Last Page 70 of 336