Kitonum

15534 Reputation

24 Badges

12 years, 140 days

MaplePrimes Activity


These are answers submitted by Kitonum

f:=(i,j)->``((x-GaußKnoten[j])/(GaußKnoten[i]-GaußKnoten[j]));
n:=3;
`*`(seq(seq(`if`(i<>j,f(i,j),NULL), j=1..n), i=1..n));

    
Edit. In order to explicitly multiply all this, use the  expand  command (code continuation):

expand(%);

     

Using the  plots:-odeplot  command, we can easily not only plot the curve, but also animate it:

plots:-odeplot(F, [x(t), y(t), z(t)], t = 0 .. 0.7, color = red, thickness = 2, axes = normal, scaling = constrained)

              

plots:-odeplot(F, [x(t), y(t), z(t)], t = 0 .. 0.7, color = red, thickness = 2, axes = normal, scaling = constrained, frames = 15);

                

Maybe the following more detailed form of writing will be clearer:

diff(w(y(t), t), t);
convert(%, diff);

               

 

This is easy to do if you use the plots:-inequal  command and Cartesian coordinates:

with(plots):
P1 := plot([-sin(t), t, t = 0 .. 2*Pi], coords = polar, color = red):
P2 := plot([cos(t), t, t = 0 .. 2*Pi], coords = polar, color = blue):
Shade := inequal({(x-1/2)^2+y^2<1/4,x^2+(y+1/2)^2<1/4}, x=-0.5..1, y=-1..0.5, color=yellow, nolines):
display(P1, P2, Shade, scaling = constrained);

           


Below is another method based on approximating a region on the plane by a polygon: 

with(plots): with(plottools):
P1 := plot(-sin(t), t = 0 .. 2*Pi, coords = polar, color = red):
P2 := plot(cos(t), t = 0 .. 2*Pi, coords = polar, color = blue):
P:=polygon([seq([-sin(t)*cos(t),-sin(t)*sin(t)],t=-evalf(Pi/4)..0,0.1),seq([cos(t)*cos(t),cos(t)*sin(t)],t=-evalf(Pi/2)..-evalf(Pi/4),0.1)],color=yellow,style=surface):
display(P1, P2, P, scaling = constrained);

                            


This method is automated in my post  https://www.mapleprimes.com/posts/145922-Perimeter-Area-And-Visualization-Of-A-Plane-Figure-  and is applicable to any flat region bounded by a piecewise smooth non-selfintersecting curve (the curve can be specified in Cartesian or polar coordinates or parametrically).

Edit.

As alternatives to  subs , you can also use  eval  or  alias :

restart;
s1 := RootOf(D1*D2*D6*_Z^2+(-D1*D4*D6-D2*D6*S-D4)*_Z+D4*D6*S):

s2 := -(D1*RootOf(D1*D2*D6*_Z^2+(-D1*D4*D6-D2*D6*S-D4)*_Z+D4*D6*S)*D6-S*D6+RootOf(D1*D2*D6*_Z^2+(-D1*D4*D6-D2*D6*S-D4)*_Z+D4*D6*S))/D2/D6/RootOf(D1*D2*D6*_Z^2+(-D1*D4*D6-D2*D6*S-D4)*_Z+D4*D6*S):

eval(s2, s1=s);
alias(s=s1):
s2;

                           

If  subs  and  eval  are fairly close commands, then  alias  is essentially different from them. If in the first two cases  s  is just a symbol, then as for  alias  Maple remembers what  s  means. This may be more convenient in subsequent calculations. See help on these commands.

 

 

restart;
lambda:=x+I*y:
evalc(abs(1+1/3*lambda+1/18*lambda^2-1/324*lambda^3+1/1944*lambda^4)-1);
plots:-implicitplot(%, x=-15..15, y=-15..15, gridrefine=5, scaling=constrained, size=[550,550]);

   

 


Edit. It would be interesting to show that the curves on the right (bottom and top) are exact circles (this is my assumption) and learn their equations.

 

The following is working:

 

restart;
P1:=(r,R)->(2/Pi)*(arccos(r/(2*R))-(r/(2*R))*sqrt(1-(r/(2*R))^2));

J0:=(r,shk)->BesselJ(0, 2*Pi*r*shk);

Jhk:=unapply(evalf((1/s)*Int(P1(r,R)*J0(r,shk)*sin(2*Pi*r*s), r=0..2*R)),s,shk,R);

plot(Jhk(s,2.14,38), s=0..5, numpoints=200, size=[1000,300]);

proc (r, R) options operator, arrow; 2*(arccos((1/2)*r/R)-(1/2)*r*sqrt(1-(1/4)*r^2/R^2)/R)/Pi end proc

 

proc (r, shk) options operator, arrow; BesselJ(0, 2*Pi*r*shk) end proc

 

proc (s, shk, R) options operator, arrow; (Int(.6366197722*(arccos(.5000000000*r/R)-.2500000000*r*(4.-1.*r^2/R^2)^(1/2)/R)*BesselJ(0., 6.283185308*r*shk)*sin(6.283185308*r*s), r = 0. .. 2.*R))/s end proc

 

 

 


 

Download plot.mw

You have mixed up the order of arguments for  Normal(mu, sigma) . The first argument  mu  is the mean, and the second one  sigma  is the standard deviation.

Solution:

restart;
with(Statistics):
X := RandomVariable(Normal(mu, 10));                           
dummy := int(PDF(X,u), u = -infinity .. 500);                        
fsolve(dummy = 0.05, mu=500..infinity);

                                             516.4485363

Within the meaning of the task for the probability to be <=0.05 ,  should be  mu >= 516.4485363


 

Temperature over 24hr period

 

y := 0.26e-1*x^3-1.03*x^2+10.2*x+34, x = 0 .. 24

0.26e-1*x^3-1.03*x^2+10.2*x+34, x = 0 .. 24

(1)

plot(y);plot(y)

 

NULL

 

``


 

Download temperature24hr_new.mw

It corrected in Maple 2018.2:

 

with(LinearAlgebra)

with(Student[MultivariateCalculus])

with(Optimization)

CorrM := Matrix(20, 20, {(1, 1) = 1.0000, (1, 2) = 0.355e-1, (1, 3) = 0.305e-1, (1, 4) = .1212, (1, 5) = 0.334e-1, (1, 6) = 0.159e-1, (1, 7) = 0.499e-1, (1, 8) = 0.708e-1, (1, 9) = 0.399e-1, (1, 10) = 0.93e-2, (1, 11) = -0.59e-2, (1, 12) = -0.284e-1, (1, 13) = 0.556e-1, (1, 14) = .1528, (1, 15) = -0.19e-2, (1, 16) = 0.636e-1, (1, 17) = 0.648e-1, (1, 18) = -0.284e-1, (1, 19) = 0.946e-1, (1, 20) = 0.818e-1, (2, 1) = 0.355e-1, (2, 2) = 1.0000, (2, 3) = .3680, (2, 4) = .4854, (2, 5) = .1889, (2, 6) = .3714, (2, 7) = .8936, (2, 8) = .3978, (2, 9) = .7277, (2, 10) = .5439, (2, 11) = .3972, (2, 12) = .4458, (2, 13) = .4790, (2, 14) = .1279, (2, 15) = .1323, (2, 16) = .3737, (2, 17) = .6812, (2, 18) = .7325, (2, 19) = .2610, (2, 20) = .3160, (3, 1) = 0.305e-1, (3, 2) = .3680, (3, 3) = 1.0000, (3, 4) = .2534, (3, 5) = .3843, (3, 6) = .4157, (3, 7) = .3979, (3, 8) = .2636, (3, 9) = .3862, (3, 10) = .3601, (3, 11) = .2941, (3, 12) = .2514, (3, 13) = .3368, (3, 14) = .1315, (3, 15) = .2507, (3, 16) = .2440, (3, 17) = .3184, (3, 18) = .3461, (3, 19) = 0.166e-1, (3, 20) = .1638, (4, 1) = .1212, (4, 2) = .4854, (4, 3) = .2534, (4, 4) = 1.0000, (4, 5) = .3323, (4, 6) = .4805, (4, 7) = .5019, (4, 8) = .3996, (4, 9) = .4884, (4, 10) = .3604, (4, 11) = .3636, (4, 12) = .3454, (4, 13) = .5063, (4, 14) = .3340, (4, 15) = .2112, (4, 16) = .4054, (4, 17) = .4734, (4, 18) = .4096, (4, 19) = .2683, (4, 20) = .3724, (5, 1) = 0.334e-1, (5, 2) = .1889, (5, 3) = .3843, (5, 4) = .3323, (5, 5) = 1.0000, (5, 6) = .6355, (5, 7) = .2921, (5, 8) = .2168, (5, 9) = .1245, (5, 10) = .2602, (5, 11) = .2531, (5, 12) = .3343, (5, 13) = .4500, (5, 14) = .2112, (5, 15) = .3084, (5, 16) = .2208, (5, 17) = .1806, (5, 18) = 0.397e-1, (5, 19) = 0.923e-1, (5, 20) = .1355, (6, 1) = 0.159e-1, (6, 2) = .3714, (6, 3) = .4157, (6, 4) = .4805, (6, 5) = .6355, (6, 6) = 1.0000, (6, 7) = .4506, (6, 8) = .4818, (6, 9) = .3920, (6, 10) = .4143, (6, 11) = .4485, (6, 12) = .4732, (6, 13) = .6146, (6, 14) = .2996, (6, 15) = .3583, (6, 16) = .4637, (6, 17) = .4004, (6, 18) = .3265, (6, 19) = .3242, (6, 20) = .4054, (7, 1) = 0.499e-1, (7, 2) = .8936, (7, 3) = .3979, (7, 4) = .5019, (7, 5) = .2921, (7, 6) = .4506, (7, 7) = 1.0000, (7, 8) = .4165, (7, 9) = .7080, (7, 10) = .5476, (7, 11) = .3997, (7, 12) = .4669, (7, 13) = .4949, (7, 14) = .1645, (7, 15) = .1937, (7, 16) = .3729, (7, 17) = .6522, (7, 18) = .7011, (7, 19) = .3031, (7, 20) = .3363, (8, 1) = 0.708e-1, (8, 2) = .3978, (8, 3) = .2636, (8, 4) = .3996, (8, 5) = .2168, (8, 6) = .4818, (8, 7) = .4165, (8, 8) = 1.0000, (8, 9) = .5172, (8, 10) = .4434, (8, 11) = .4775, (8, 12) = .3625, (8, 13) = .5849, (8, 14) = .5115, (8, 15) = .2159, (8, 16) = .5860, (8, 17) = .5232, (8, 18) = .4426, (8, 19) = .5572, (8, 20) = .6478, (9, 1) = 0.399e-1, (9, 2) = .7277, (9, 3) = .3862, (9, 4) = .4884, (9, 5) = .1245, (9, 6) = .3920, (9, 7) = .7080, (9, 8) = .5172, (9, 9) = 1.0000, (9, 10) = .5696, (9, 11) = .4434, (9, 12) = .4097, (9, 13) = .5895, (9, 14) = .3632, (9, 15) = .2408, (9, 16) = .5024, (9, 17) = .7881, (9, 18) = .7397, (9, 19) = .3838, (9, 20) = .4875, (10, 1) = 0.93e-2, (10, 2) = .5439, (10, 3) = .3601, (10, 4) = .3604, (10, 5) = .2602, (10, 6) = .4143, (10, 7) = .5476, (10, 8) = .4434, (10, 9) = .5696, (10, 10) = 1.0000, (10, 11) = .5284, (10, 12) = .3229, (10, 13) = .4995, (10, 14) = .2116, (10, 15) = .2613, (10, 16) = .3683, (10, 17) = .5302, (10, 18) = .5272, (10, 19) = .2958, (10, 20) = .3482, (11, 1) = -0.59e-2, (11, 2) = .3972, (11, 3) = .2941, (11, 4) = .3636, (11, 5) = .2531, (11, 6) = .4485, (11, 7) = .3997, (11, 8) = .4775, (11, 9) = .4434, (11, 10) = .5284, (11, 11) = 1.0000, (11, 12) = .3453, (11, 13) = .4507, (11, 14) = .3134, (11, 15) = .2125, (11, 16) = .4307, (11, 17) = .4228, (11, 18) = .3877, (11, 19) = .3787, (11, 20) = .4422, (12, 1) = -0.284e-1, (12, 2) = .4458, (12, 3) = .2514, (12, 4) = .3454, (12, 5) = .3343, (12, 6) = .4732, (12, 7) = .4669, (12, 8) = .3625, (12, 9) = .4097, (12, 10) = .3229, (12, 11) = .3453, (12, 12) = 1.0000, (12, 13) = .4789, (12, 14) = .1916, (12, 15) = .1434, (12, 16) = .3309, (12, 17) = .4653, (12, 18) = .3713, (12, 19) = .3167, (12, 20) = .3396, (13, 1) = 0.556e-1, (13, 2) = .4790, (13, 3) = .3368, (13, 4) = .5063, (13, 5) = .4500, (13, 6) = .6146, (13, 7) = .4949, (13, 8) = .5849, (13, 9) = .5895, (13, 10) = .4995, (13, 11) = .4507, (13, 12) = .4789, (13, 13) = 1.0000, (13, 14) = .5864, (13, 15) = .3155, (13, 16) = .6059, (13, 17) = .6345, (13, 18) = .4252, (13, 19) = .4592, (13, 20) = .5468, (14, 1) = .1528, (14, 2) = .1279, (14, 3) = .1315, (14, 4) = .3340, (14, 5) = .2112, (14, 6) = .2996, (14, 7) = .1645, (14, 8) = .5115, (14, 9) = .3632, (14, 10) = .2116, (14, 11) = .3134, (14, 12) = .1916, (14, 13) = .5864, (14, 14) = 1.0000, (14, 15) = .1391, (14, 16) = .5548, (14, 17) = .4141, (14, 18) = .1784, (14, 19) = .5404, (14, 20) = .6244, (15, 1) = -0.19e-2, (15, 2) = .1323, (15, 3) = .2507, (15, 4) = .2112, (15, 5) = .3084, (15, 6) = .3583, (15, 7) = .1937, (15, 8) = .2159, (15, 9) = .2408, (15, 10) = .2613, (15, 11) = .2125, (15, 12) = .1434, (15, 13) = .3155, (15, 14) = .1391, (15, 15) = 1.0000, (15, 16) = .2904, (15, 17) = .2197, (15, 18) = 0.953e-1, (15, 19) = .1161, (15, 20) = .2490, (16, 1) = 0.636e-1, (16, 2) = .3737, (16, 3) = .2440, (16, 4) = .4054, (16, 5) = .2208, (16, 6) = .4637, (16, 7) = .3729, (16, 8) = .5860, (16, 9) = .5024, (16, 10) = .3683, (16, 11) = .4307, (16, 12) = .3309, (16, 13) = .6059, (16, 14) = .5548, (16, 15) = .2904, (16, 16) = 1.0000, (16, 17) = .5610, (16, 18) = .3626, (16, 19) = .5647, (16, 20) = .6212, (17, 1) = 0.648e-1, (17, 2) = .6812, (17, 3) = .3184, (17, 4) = .4734, (17, 5) = .1806, (17, 6) = .4004, (17, 7) = .6522, (17, 8) = .5232, (17, 9) = .7881, (17, 10) = .5302, (17, 11) = .4228, (17, 12) = .4653, (17, 13) = .6345, (17, 14) = .4141, (17, 15) = .2197, (17, 16) = .5610, (17, 17) = 1.0000, (17, 18) = .6435, (17, 19) = .3996, (17, 20) = .4950, (18, 1) = -0.284e-1, (18, 2) = .7325, (18, 3) = .3461, (18, 4) = .4096, (18, 5) = 0.397e-1, (18, 6) = .3265, (18, 7) = .7011, (18, 8) = .4426, (18, 9) = .7397, (18, 10) = .5272, (18, 11) = .3877, (18, 12) = .3713, (18, 13) = .4252, (18, 14) = .1784, (18, 15) = 0.953e-1, (18, 16) = .3626, (18, 17) = .6435, (18, 18) = 1.0000, (18, 19) = .2582, (18, 20) = .3813, (19, 1) = 0.946e-1, (19, 2) = .2610, (19, 3) = 0.166e-1, (19, 4) = .2683, (19, 5) = 0.923e-1, (19, 6) = .3242, (19, 7) = .3031, (19, 8) = .5572, (19, 9) = .3838, (19, 10) = .2958, (19, 11) = .3787, (19, 12) = .3167, (19, 13) = .4592, (19, 14) = .5404, (19, 15) = .1161, (19, 16) = .5647, (19, 17) = .3996, (19, 18) = .2582, (19, 19) = 1.0000, (19, 20) = .6789, (20, 1) = 0.818e-1, (20, 2) = .3160, (20, 3) = .1638, (20, 4) = .3724, (20, 5) = .1355, (20, 6) = .4054, (20, 7) = .3363, (20, 8) = .6478, (20, 9) = .4875, (20, 10) = .3482, (20, 11) = .4422, (20, 12) = .3396, (20, 13) = .5468, (20, 14) = .6244, (20, 15) = .2490, (20, 16) = .6212, (20, 17) = .4950, (20, 18) = .3813, (20, 19) = .6789, (20, 20) = 1.0000})

interface(rtablesize = 100); OnesM := Vector[row](20, datatype = integer[1], fill = 1)

Vector[row](%id = 18446745808670926478)

(1)

TotRisk := Vector(20, {(1) = 0.835e-1, (2) = 0.217e-1, (3) = 0.169e-1, (4) = 0.178e-1, (5) = 0.114e-1, (6) = 0.125e-1, (7) = 0.175e-1, (8) = 0.185e-1, (9) = 0.257e-1, (10) = 0.208e-1, (11) = 0.186e-1, (12) = 0.168e-1, (13) = 0.217e-1, (14) = 0.275e-1, (15) = 0.199e-1, (16) = 0.290e-1, (17) = 0.224e-1, (18) = 0.232e-1, (19) = 0.454e-1, (20) = 0.267e-1})

Vector[column](%id = 18446745808670923102)

(2)

f := proc (j) options operator, arrow; w[j] end proc

proc (j) options operator, arrow; w[j] end proc

(3)

NULLNULL

WeightM := Vector(20, f)

Vector[column](%id = 18446745808670920326)

(4)

VarList := convert(WeightM, list)

[w[1], w[2], w[3], w[4], w[5], w[6], w[7], w[8], w[9], w[10], w[11], w[12], w[13], w[14], w[15], w[16], w[17], w[18], w[19], w[20]]

(5)

TotRiskDiag := DiagonalMatrix(TotRisk)

Matrix(%id = 18446745808670896366)

(6)

VarCovar := TotRiskDiag.Matrix(20, CorrM).TotRiskDiag

Matrix(%id = 18446745808732146254)

(7)

PortVarM := WeightM^%T.VarCovar.WeightM

(0.6972250000e-2*w[1]+0.64324225e-4*w[2]+0.43040075e-4*w[3]+0.180139560e-3*w[4]+0.31793460e-4*w[5]+0.16595625e-4*w[6]+0.72916375e-4*w[7]+0.109368300e-3*w[8]+0.85623405e-4*w[9]+0.16152240e-4*w[10]-0.9163290e-5*w[11]-0.39839520e-4*w[12]+0.100744420e-3*w[13]+0.350867000e-3*w[14]-0.3157135e-5*w[15]+0.154007400e-3*w[16]+0.121201920e-3*w[17]-0.55016480e-4*w[18]+0.358619140e-3*w[19]+0.182369010e-3*w[20])*w[1]+(0.64324225e-4*w[1]+0.470890000e-3*w[2]+0.134956640e-3*w[3]+0.187490604e-3*w[4]+0.46730082e-4*w[5]+0.100742250e-3*w[6]+0.339344600e-3*w[7]+0.159696810e-3*w[8]+0.405831013e-3*w[9]+0.245494704e-3*w[10]+0.160317864e-3*w[11]+0.162520848e-3*w[12]+0.225556310e-3*w[13]+0.76324325e-4*w[14]+0.57131109e-4*w[15]+0.235169410e-3*w[16]+0.331117696e-3*w[17]+0.368769800e-3*w[18]+0.257131980e-3*w[19]+0.183087240e-3*w[20])*w[2]+(0.43040075e-4*w[1]+0.134956640e-3*w[2]+0.285610000e-3*w[3]+0.76227788e-4*w[4]+0.74039238e-4*w[5]+0.87816625e-4*w[6]+0.117678925e-3*w[7]+0.82414540e-4*w[8]+0.167738246e-3*w[9]+0.126582352e-3*w[10]+0.92447394e-4*w[11]+0.71377488e-4*w[12]+0.123514664e-3*w[13]+0.61114625e-4*w[14]+0.84312917e-4*w[15]+0.119584400e-3*w[16]+0.120533504e-3*w[17]+0.135698888e-3*w[18]+0.12736516e-4*w[19]+0.73911474e-4*w[20])*w[3]+(0.180139560e-3*w[1]+0.187490604e-3*w[2]+0.76227788e-4*w[3]+0.316840000e-3*w[4]+0.67430316e-4*w[5]+0.106911250e-3*w[6]+0.156341850e-3*w[7]+0.131588280e-3*w[8]+0.223423464e-3*w[9]+0.133434496e-3*w[10]+0.120380688e-3*w[11]+0.103288416e-3*w[12]+0.195563438e-3*w[13]+0.163493000e-3*w[14]+0.74811264e-4*w[15]+0.209267480e-3*w[16]+0.188754048e-3*w[17]+0.169148416e-3*w[18]+0.216818596e-3*w[19]+0.176986824e-3*w[20])*w[4]+(0.31793460e-4*w[1]+0.46730082e-4*w[2]+0.74039238e-4*w[3]+0.67430316e-4*w[4]+0.129960000e-3*w[5]+0.90558750e-4*w[6]+0.58273950e-4*w[7]+0.45723120e-4*w[8]+0.36476010e-4*w[9]+0.61698624e-4*w[10]+0.53667324e-4*w[11]+0.64025136e-4*w[12]+0.111321000e-3*w[13]+0.66211200e-4*w[14]+0.69963624e-4*w[15]+0.72996480e-4*w[16]+0.46118016e-4*w[17]+0.10499856e-4*w[18]+0.47770788e-4*w[19]+0.41243490e-4*w[20])*w[5]+(0.16595625e-4*w[1]+0.100742250e-3*w[2]+0.87816625e-4*w[3]+0.106911250e-3*w[4]+0.90558750e-4*w[5]+0.156250000e-3*w[6]+0.98568750e-4*w[7]+0.111416250e-3*w[8]+0.125930000e-3*w[9]+0.107718000e-3*w[10]+0.104276250e-3*w[11]+0.99372000e-4*w[12]+0.166710250e-3*w[13]+0.102987500e-3*w[14]+0.89127125e-4*w[15]+0.168091250e-3*w[16]+0.112112000e-3*w[17]+0.94685000e-4*w[18]+0.183983500e-3*w[19]+0.135302250e-3*w[20])*w[6]+(0.72916375e-4*w[1]+0.339344600e-3*w[2]+0.117678925e-3*w[3]+0.156341850e-3*w[4]+0.58273950e-4*w[5]+0.98568750e-4*w[6]+0.306250000e-3*w[7]+0.134841875e-3*w[8]+0.318423000e-3*w[9]+0.199326400e-3*w[10]+0.130102350e-3*w[11]+0.137268600e-3*w[12]+0.187938275e-3*w[13]+0.79165625e-4*w[14]+0.67456025e-4*w[15]+0.189246750e-3*w[16]+0.255662400e-3*w[17]+0.284646600e-3*w[18]+0.240812950e-3*w[19]+0.157136175e-3*w[20])*w[7]+(0.109368300e-3*w[1]+0.159696810e-3*w[2]+0.82414540e-4*w[3]+0.131588280e-3*w[4]+0.45723120e-4*w[5]+0.111416250e-3*w[6]+0.134841875e-3*w[7]+0.342250000e-3*w[8]+0.245902740e-3*w[9]+0.170620320e-3*w[10]+0.164307750e-3*w[11]+0.112665000e-3*w[12]+0.234808105e-3*w[13]+0.260225625e-3*w[14]+0.79483585e-4*w[15]+0.314389000e-3*w[16]+0.216814080e-3*w[17]+0.189963920e-3*w[18]+0.467992280e-3*w[19]+0.319980810e-3*w[20])*w[8]+(0.85623405e-4*w[1]+0.405831013e-3*w[2]+0.167738246e-3*w[3]+0.223423464e-3*w[4]+0.36476010e-4*w[5]+0.125930000e-3*w[6]+0.318423000e-3*w[7]+0.245902740e-3*w[8]+0.660490000e-3*w[9]+0.304485376e-3*w[10]+0.211954068e-3*w[11]+0.176892072e-3*w[12]+0.328758255e-3*w[13]+0.256691600e-3*w[14]+0.123152344e-3*w[15]+0.374438720e-3*w[16]+0.453693408e-3*w[17]+0.441038728e-3*w[18]+0.447810164e-3*w[19]+0.334517625e-3*w[20])*w[9]+(0.16152240e-4*w[1]+0.245494704e-3*w[2]+0.126582352e-3*w[3]+0.133434496e-3*w[4]+0.61698624e-4*w[5]+0.107718000e-3*w[6]+0.199326400e-3*w[7]+0.170620320e-3*w[8]+0.304485376e-3*w[9]+0.432640000e-3*w[10]+0.204427392e-3*w[11]+0.112834176e-3*w[12]+0.225454320e-3*w[13]+0.121035200e-3*w[14]+0.108157296e-3*w[15]+0.222158560e-3*w[16]+0.247030784e-3*w[17]+0.254405632e-3*w[18]+0.279329856e-3*w[19]+0.193376352e-3*w[20])*w[10]+(-0.9163290e-5*w[1]+0.160317864e-3*w[2]+0.92447394e-4*w[3]+0.120380688e-3*w[4]+0.53667324e-4*w[5]+0.104276250e-3*w[6]+0.130102350e-3*w[7]+0.164307750e-3*w[8]+0.211954068e-3*w[9]+0.204427392e-3*w[10]+0.345960000e-3*w[11]+0.107899344e-3*w[12]+0.181911534e-3*w[13]+0.160304100e-3*w[14]+0.78654750e-4*w[15]+0.232319580e-3*w[16]+0.176155392e-3*w[17]+0.167300304e-3*w[18]+0.319789428e-3*w[19]+0.219605364e-3*w[20])*w[11]+(-0.39839520e-4*w[1]+0.162520848e-3*w[2]+0.71377488e-4*w[3]+0.103288416e-3*w[4]+0.64025136e-4*w[5]+0.99372000e-4*w[6]+0.137268600e-3*w[7]+0.112665000e-3*w[8]+0.176892072e-3*w[9]+0.112834176e-3*w[10]+0.107899344e-3*w[11]+0.282240000e-3*w[12]+0.174587784e-3*w[13]+0.88519200e-4*w[14]+0.47941488e-4*w[15]+0.161214480e-3*w[16]+0.175101696e-3*w[17]+0.144717888e-3*w[18]+0.241553424e-3*w[19]+0.152330976e-3*w[20])*w[12]+(0.100744420e-3*w[1]+0.225556310e-3*w[2]+0.123514664e-3*w[3]+0.195563438e-3*w[4]+0.111321000e-3*w[5]+0.166710250e-3*w[6]+0.187938275e-3*w[7]+0.234808105e-3*w[8]+0.328758255e-3*w[9]+0.225454320e-3*w[10]+0.181911534e-3*w[11]+0.174587784e-3*w[12]+0.470890000e-3*w[13]+0.349934200e-3*w[14]+0.136242365e-3*w[15]+0.381292870e-3*w[16]+0.308417760e-3*w[17]+0.214062688e-3*w[18]+0.452394656e-3*w[19]+0.316810452e-3*w[20])*w[13]+(0.350867000e-3*w[1]+0.76324325e-4*w[2]+0.61114625e-4*w[3]+0.163493000e-3*w[4]+0.66211200e-4*w[5]+0.102987500e-3*w[6]+0.79165625e-4*w[7]+0.260225625e-3*w[8]+0.256691600e-3*w[9]+0.121035200e-3*w[10]+0.160304100e-3*w[11]+0.88519200e-4*w[12]+0.349934200e-3*w[13]+0.756250000e-3*w[14]+0.76122475e-4*w[15]+0.442453000e-3*w[16]+0.255085600e-3*w[17]+0.113819200e-3*w[18]+0.674689400e-3*w[19]+0.458465700e-3*w[20])*w[14]+(-0.3157135e-5*w[1]+0.57131109e-4*w[2]+0.84312917e-4*w[3]+0.74811264e-4*w[4]+0.69963624e-4*w[5]+0.89127125e-4*w[6]+0.67456025e-4*w[7]+0.79483585e-4*w[8]+0.123152344e-3*w[9]+0.108157296e-3*w[10]+0.78654750e-4*w[11]+0.47941488e-4*w[12]+0.136242365e-3*w[13]+0.76122475e-4*w[14]+0.396010000e-3*w[15]+0.167589840e-3*w[16]+0.97933472e-4*w[17]+0.43998104e-4*w[18]+0.104891706e-3*w[19]+0.132301170e-3*w[20])*w[15]+(0.154007400e-3*w[1]+0.235169410e-3*w[2]+0.119584400e-3*w[3]+0.209267480e-3*w[4]+0.72996480e-4*w[5]+0.168091250e-3*w[6]+0.189246750e-3*w[7]+0.314389000e-3*w[8]+0.374438720e-3*w[9]+0.222158560e-3*w[10]+0.232319580e-3*w[11]+0.161214480e-3*w[12]+0.381292870e-3*w[13]+0.442453000e-3*w[14]+0.167589840e-3*w[15]+0.841000000e-3*w[16]+0.364425600e-3*w[17]+0.243957280e-3*w[18]+0.743484020e-3*w[19]+0.480995160e-3*w[20])*w[16]+(0.121201920e-3*w[1]+0.331117696e-3*w[2]+0.120533504e-3*w[3]+0.188754048e-3*w[4]+0.46118016e-4*w[5]+0.112112000e-3*w[6]+0.255662400e-3*w[7]+0.216814080e-3*w[8]+0.453693408e-3*w[9]+0.247030784e-3*w[10]+0.176155392e-3*w[11]+0.175101696e-3*w[12]+0.308417760e-3*w[13]+0.255085600e-3*w[14]+0.97933472e-4*w[15]+0.364425600e-3*w[16]+0.501760000e-3*w[17]+0.334414080e-3*w[18]+0.406377216e-3*w[19]+0.296049600e-3*w[20])*w[17]+(-0.55016480e-4*w[1]+0.368769800e-3*w[2]+0.135698888e-3*w[3]+0.169148416e-3*w[4]+0.10499856e-4*w[5]+0.94685000e-4*w[6]+0.284646600e-3*w[7]+0.189963920e-3*w[8]+0.441038728e-3*w[9]+0.254405632e-3*w[10]+0.167300304e-3*w[11]+0.144717888e-3*w[12]+0.214062688e-3*w[13]+0.113819200e-3*w[14]+0.43998104e-4*w[15]+0.243957280e-3*w[16]+0.334414080e-3*w[17]+0.538240000e-3*w[18]+0.271956896e-3*w[19]+0.236192472e-3*w[20])*w[18]+(0.358619140e-3*w[1]+0.257131980e-3*w[2]+0.12736516e-4*w[3]+0.216818596e-3*w[4]+0.47770788e-4*w[5]+0.183983500e-3*w[6]+0.240812950e-3*w[7]+0.467992280e-3*w[8]+0.447810164e-3*w[9]+0.279329856e-3*w[10]+0.319789428e-3*w[11]+0.241553424e-3*w[12]+0.452394656e-3*w[13]+0.674689400e-3*w[14]+0.104891706e-3*w[15]+0.743484020e-3*w[16]+0.406377216e-3*w[17]+0.271956896e-3*w[18]+0.2061160000e-2*w[19]+0.822949002e-3*w[20])*w[19]+(0.182369010e-3*w[1]+0.183087240e-3*w[2]+0.73911474e-4*w[3]+0.176986824e-3*w[4]+0.41243490e-4*w[5]+0.135302250e-3*w[6]+0.157136175e-3*w[7]+0.319980810e-3*w[8]+0.334517625e-3*w[9]+0.193376352e-3*w[10]+0.219605364e-3*w[11]+0.152330976e-3*w[12]+0.316810452e-3*w[13]+0.458465700e-3*w[14]+0.132301170e-3*w[15]+0.480995160e-3*w[16]+0.296049600e-3*w[17]+0.236192472e-3*w[18]+0.822949002e-3*w[19]+0.712890000e-3*w[20])*w[20]

(8)

Minimize(PortVarM, {WeightM^%T.OnesM-1 = 0})

[0.803349379166598e-4, [w[1] = HFloat(0.007708358325750363), w[2] = HFloat(0.002134358811100384), w[3] = HFloat(0.057711028676106474), w[4] = HFloat(0.052904629860405145), w[5] = HFloat(0.44576829230332826), w[6] = HFloat(0.12108378551278938), w[7] = HFloat(0.03207105038339679), w[8] = HFloat(0.11207167544917171), w[9] = HFloat(-0.07708559116800914), w[10] = HFloat(0.007728792610408916), w[11] = HFloat(0.059610348107353564), w[12] = HFloat(0.12470612458191378), w[13] = HFloat(-0.2222880243326143), w[14] = HFloat(0.09819204548937215), w[15] = HFloat(0.1051523308448878), w[16] = HFloat(-0.04780689135454479), w[17] = HFloat(0.04157730143977216), w[18] = HFloat(0.10645290391416276), w[19] = HFloat(-0.016138875948426362), w[20] = HFloat(-0.011553643506325213)]]

(9)

  NULL

Minimize(PortVarM, {WeightM^%T.OnesM-1 = 0}, assume = nonnegative)

[0.945989357392042e-4, [w[1] = HFloat(0.010248582701259305), w[2] = HFloat(0.0), w[3] = HFloat(0.06707363612473421), w[4] = HFloat(0.028751657380591055), w[5] = HFloat(0.5193903874713897), w[6] = HFloat(0.025465432888036228), w[7] = HFloat(0.0), w[8] = HFloat(0.056387064362297123), w[9] = HFloat(0.0), w[10] = HFloat(0.0), w[11] = HFloat(0.049948106386210035), w[12] = HFloat(0.0910658166015014), w[13] = HFloat(0.0), w[14] = HFloat(4.1431197119470956e-4), w[15] = HFloat(0.08168550957667065), w[16] = HFloat(0.0), w[17] = HFloat(0.0), w[18] = HFloat(0.06956949453611558), w[19] = HFloat(0.0), w[20] = HFloat(0.0)]]

(10)

OptimumWeights := LagrangeMultipliers(PortVarM, [WeightM^%T.OnesM-1], VarList)

[0.7708358326e-2, 0.2134358811e-2, 0.5771102868e-1, 0.5290462986e-1, .4457682923, .1210837855, 0.3207105038e-1, .1120716754, -0.7708559117e-1, 0.7728792610e-2, 0.5961034811e-1, .1247061246, -.2222880243, 0.9819204549e-1, .1051523308, -0.4780689135e-1, 0.4157730144e-1, .1064529039, -0.1613887595e-1, -0.1155364351e-1]

(11)

convert(OptimumWeights, `+`)

.9999999995

(12)

``

NULL

``


 

Download BE312-1920-CW2-Amended-Maple-Codemw-46469mw-46557_(1)_new.mw

Such a year will be only one. This is the year  2020 .

restart;
with(LinearAlgebra):
k:=0: T:=table():
for i from 2001 to 2100 do
L:=convert(i,base,10);
R,A,E,Y:=L[];
M:=<Y,E,A,R; E,A,R,Y; A,R,Y,E; R,Y,E,A>;
N:=<M | <2,0,2,0>>;
m:=Rank(M); n:=Rank(N);
if m<4 then if m=n then k:=k+1; T[k]:=Y*10^3+E*10^2+A*10+R fi;fi;
od:
YEARs:=convert(T,list); 

                                                YEARs := [2020]


Edit. As Thomas Dean pointed out in his comment, replacing the vector  <2,0,2,0>  in the code with the vector  <Y,E,A,R>  allows you to get a larger number of solutions.

Compare these options:

restart;
data:=[$1..10^6]:
CodeTools:-Usage(is(numelems(data)<>0));
CodeTools:-Usage(is(data<>[]));
CodeTools:-Usage(is(nops(data)<>0));
CodeTools:-Usage(is(not (data::[])));

                       

I usually use the  nops  command.

expand(exp(k*(ln(t)+ln(a)))-(exp(ln(t)+ln(a)))^k) assuming t > 0, a > 0;

                                          0

1. Maple often calculates the sum of divergent series in a special sense. For instance

evalf(sum((-1)^(n+1),n=1..infinity));

                                      0.5000000000

See help on  sum,details  and  wiki  https://en.wikipedia.org/wiki/Divergent_series  for details.


2. When you calculate  limit((-1)^n, n=infinity) , then n is not necessarily an integer, for example

(-1)^2.7;

                              -0.5877852523 + 0.8090169944*I

First 16 17 18 19 20 21 22 Last Page 18 of 242