tomleslie

13876 Reputation

20 Badges

15 years, 180 days

MaplePrimes Activity


These are replies submitted by tomleslie

In my previous post the final set of graphs rendered in a rather odd way when the x-coordinate is close to zero. I'm still not sure why this is happening. In the attached I have slightly modified the way the final calculations are done. The two methods provide the "same" answers, but in the attached the plot rendering is much better. (I'm still not sure why!)

Anyhow for what it is worth, check out the attached, which I still can't display on this site because someone has broken the "inline display" capability -again!

someODEs2.mw

@David Sycamore 

Just use the download link in my previous post and run it!

@michalkvasnicka 

I think it depends on the contents of the pathdef.m file. I'm not sure if you can have more than one of these!

@David Sycamore 

Pretty trivial to do by stripping down my previous worksheet, as in the atached

  restart;
  interface(version);
#
# Define the upper limit for the odd numbers
# to be tested and the upper limit for the
# even addends
#
  Nodd:=1000:
  Neven:=10000:
#
# Procedure which does the work
#
  doWork:= proc( p::posint, N::posint )
                 local #
                       # Edited this to run in Maple 18
                       # whihc means it will probably run
                       # in every subsequent version
                       #
                       # f:=NumberTheory:-PrimeFactors(p),
                        f:=numtheory:-factorset(p),
                       j:
                 for j from 2 by 2 to N do
                     if   isprime~(f+~j)={true}
                     then #
                          # Return the lowest even number
                          #
                            return j;
                     fi;
                 od;
                 return #
                        # No even addend found: return a zero
                        #
                          0;
           end proc:

`Standard Worksheet Interface, Maple 2019.1, Windows 7, May 21 2019 Build ID 1399874`

(1)

#
# Just get a list of the even addends for
# the odd numbers 3,5,7.....Nodd. Only even
# addends up to Neven are checked
#
 [ seq( doWork(j, Neven), j=3..Nodd,2)]

[2, 2, 4, 2, 2, 4, 2, 2, 4, 4, 6, 2, 2, 2, 6, 2, 6, 4, 4, 2, 4, 2, 6, 4, 2, 6, 2, 4, 2, 6, 4, 6, 4, 8, 2, 6, 2, 6, 4, 2, 6, 2, 2, 8, 4, 10, 12, 4, 2, 2, 4, 0, 2, 4, 4, 14, 6, 4, 6, 2, 2, 2, 4, 4, 6, 4, 2, 2, 10, 14, 6, 2, 4, 2, 6, 2, 6, 6, 8, 6, 4, 2, 6, 4, 4, 6, 6, 2, 2, 10, 10, 6, 2, 4, 2, 4, 0, 2, 12, 4, 12, 2, 8, 12, 12, 2, 18, 6, 10, 6, 4, 2, 2, 4, 0, 6, 6, 4, 2, 10, 2, 6, 4, 14, 6, 6, 2, 6, 4, 2, 6, 6, 8, 2, 6, 4, 2, 4, 10, 2, 10, 0, 6, 2, 4, 14, 2, 2, 6, 4, 2, 6, 4, 4, 2, 4, 0, 14, 2, 2, 12, 6, 4, 6, 6, 4, 6, 10, 14, 6, 4, 8, 2, 4, 4, 6, 2, 0, 8, 4, 2, 6, 6, 2, 6, 6, 2, 18, 4, 4, 6, 6, 4, 8, 6, 8, 18, 4, 4, 8, 6, 2, 6, 10, 2, 12, 6, 10, 2, 10, 14, 2, 6, 0, 2, 6, 2, 18, 4, 4, 6, 8, 2, 8, 2, 16, 6, 4, 2, 2, 4, 0, 12, 4, 10, 18, 12, 8, 8, 4, 0, 6, 4, 4, 8, 2, 2, 12, 4, 14, 6, 2, 4, 12, 6, 4, 6, 6, 8, 2, 18, 0, 6, 6, 2, 6, 2, 2, 6, 6, 10, 18, 10, 10, 12, 4, 0, 6, 4, 2, 6, 14, 4, 2, 6, 2, 6, 10, 4, 6, 6, 0, 6, 10, 2, 6, 6, 28, 2, 6, 4, 2, 6, 0, 6, 4, 2, 2, 12, 8, 12, 2, 0, 6, 10, 16, 12, 4, 2, 2, 4, 0, 6, 2, 10, 6, 6, 10, 2, 12, 0, 12, 8, 4, 6, 4, 2, 6, 4, 2, 8, 2, 4, 6, 10, 0, 12, 2, 8, 8, 4, 14, 6, 10, 4, 6, 6, 2, 8, 4, 10, 2, 6, 2, 24, 6, 0, 6, 4, 4, 8, 2, 14, 6, 6, 20, 6, 4, 8, 8, 4, 2, 24, 4, 14, 14, 6, 4, 12, 2, 2, 6, 10, 8, 24, 6, 8, 12, 6, 8, 6, 6, 2, 2, 10, 10, 18, 4, 4, 2, 4, 2, 2, 10, 4, 6, 6, 10, 14, 2, 2, 6, 6, 10, 6, 4, 0, 2, 4, 0, 14, 6, 2, 18, 4, 4, 6, 4, 14, 2, 4, 2, 20, 4, 2, 12, 2, 0, 12, 6, 4, 12, 4, 2, 8, 6, 0, 6, 10, 4, 18, 6, 4, 8, 4, 2, 2, 4, 4, 6, 6, 0, 6, 6, 14, 14, 2, 2, 12, 6, 2, 6, 4, 0, 6, 10, 0, 6, 8, 4, 8, 2, 0, 18, 6, 16, 12, 12, 4]

(2)

 

Download prmeProb4.mw

@Kitonum 

one can achieve the same thing using LPSolve, by adding the option 'integervariables', as in

Optimization:-LPSolve(P.V, {seq(C.V <=~ R), seq(V >=~ 0)}, maximize, integervariables=[F,K]);

whiihc produces

[8500, [F = 50, K = 150]]

 

@student_md 

pdetest() outputs a list whose entries are the "result/discrepancy" are the outcomes of substituting the "obtained_solution" into the PDE system and BCs, ICs

You have a single PDE, two BCs and a single IC, so there are a total of four checks to be performed. The output will be a list of four values. If everything is perfect, the output will be a list of four zeros. In a PDE system with (say) four PDEs, six BCs and three ICs, the output list woukd have thirteen entries.

Any non-zero entry indicates that the provided solution does not fulfil the PDE/BCs/IC. The order in the output list is the same order as the functions are given to pdetest(). So, for your case

pdetest(solution, [PDE, BCs, IC])

  1. first list entry is essentially obtained by substituting "solution" into the "PDE", and working out the difference between the lhs() and rhs() of the result. This ought to be '0', if "solution" satisfies the PDE
  2. subsequent three entries are obtained by evaluating the "solution" under the same conditions as the BCs/ICs and again evaluating rhs()-lhs() for each of the generated equations

You can experiment with this behaviour by testing the "solution" against "slightly" different BCs/ICs than those which were used to produce it. In general this will produce a nonzero entry (showing the resulting discrepancy) at the appropriate place in the output list. You can even change the "solution" (I'd advise "slightly"). This will produce a non-zero first entry - the PDE is not satisfied, and generally one or more non-zeros entries for the BCs/ICs

Experimenting with solutions PDEs/BCs/ICs in this way can often assisy you if you are "guessing" a solution (whihc we have all done!). You can immediately see which PDEs/BCs/ICs are unsatisfied,  by how much, and adjust your "guess" appropriately

In the attached I have added an execution group which shows the effect of testing the obtained solution against "somewhat modified" BCs/ICs, as well as changing the obtained "solution" itself

restart:
with(PDEtools):
PDE :=  diff(y(x,t), t)-diff(y(x,t), x,x,t)-diff(y(x,t), x$2)+ diff(y(x,t), x)+y(x,t)*diff(y(x,t),x)=exp(-t)*(cos(x)-sin(x)+1/2*exp(-t)*sin(2*x));

diff(y(x, t), t)-(diff(diff(diff(y(x, t), t), x), x))-(diff(diff(y(x, t), x), x))+diff(y(x, t), x)+y(x, t)*(diff(y(x, t), x)) = exp(-t)*(cos(x)-sin(x)+(1/2)*exp(-t)*sin(2*x))

(1)

# Initial/boundary conditions
  BCs:=y(0,t) = 0, y(Pi,t)=0;
  ICs:=y(x,0) =sin(x) ;

y(0, t) = 0, y(Pi, t) = 0

 

y(x, 0) = sin(x)

(2)

pdsolve({PDE, BCs,ICs}, y(x,t), HINT=`*`);  # NULL. Maple does not find an exact solution

num_sol := pdsolve(PDE, {BCs,ICs}, numeric);
num_sol:-plot3d(x=0..1, t=0..1);

_m900620480

 

 

  exact_solution:=exp(-t)*sin(x);
  Test1:=pdetest(y(x,t)=exact_solution,[PDE, BCs,ICs]);

 
 

exp(-t)*sin(x)

 

[0, 0, 0, 0]

(3)

#
# "Adjust"  one of the BCs
#
  BCs2:=y(0,t) = 1, y(Pi,t)=0:
  Test2:=pdetest(y(x,t)=exact_solution,[PDE, BCs2,ICs]);
#
# "Adjust"  another one of the BCs
#
  BCs3:=y(0,t) = 0, y(Pi,t)=1:
  Test3:=pdetest(y(x,t)=exact_solution,[PDE, BCs3,ICs]);
#
# "Adjust"  the IC
#
  ICs2:=y(x,0) =cos(x):
  Test4:=pdetest(y(x,t)=exact_solution,[PDE, BCs,ICs2]);
#
# "Adjust" the exact solution a couple of different ways
#
  Test5:=pdetest(y(x,t)=2*exact_solution,[PDE, BCs,ICs]);
  Test6:=pdetest(y(x,t)=2+exact_solution,[PDE, BCs,ICs]);

[0, -1, 0, 0]

 

[0, 0, -1, 0]

 

[0, 0, 0, (-1/2+(1/2)*I)*exp(-I*x)+(-1/2-(1/2)*I)*exp(I*x)]

 

[((1/2)*I)*exp(-t+I*x)+(1/2)*exp(-t+I*x)-((1/2)*I)*exp(-t-I*x)+(1/2)*exp(-t-I*x)+(3/2)*exp(-2*t)*sin(2*x), 0, 0, sin(x)]

 

[2*exp(-t)*cos(x), 2, 2, 2]

(4)

 

Download testPDE.mw

 

@Carl Love 

You might need parse~(ImportMatrix() ), but using a matrix with pretty "random" symbolic entries, the following works for me.

(You will need to change the file path for your installation);

A:=Matrix([ [x^2, int(x*cos(x),x)],
            [piecewise( x<5, 2*x, 3*x/2), diff(y(x),x$2)*exp(y(x))=0]
          ]
         );
ExportMatrix( "C:/Users/TomLeslie/Desktop/testMat", A);

Matrix(2, 2, {(1, 1) = x^2, (1, 2) = cos(x)+x*sin(x), (2, 1) = piecewise(x < 5, 2*x, (3/2)*x), (2, 2) = (diff(diff(y(x), x), x))*exp(y(x)) = 0})

 

82

(1)

restart;
B:=parse~(ImportMatrix("C:/Users/TomLeslie/Desktop/testMat"));

Matrix(2, 2, {(1, 1) = x^2, (1, 2) = cos(x)+x*sin(x), (2, 1) = piecewise(x < 5, 2*x, (3/2)*x), (2, 2) = (diff(diff(y(x), x), x))*exp(y(x)) = 0})

(2)

 


Download mattest.mw

 

to debug this problem if you posted the offending worksheet using the big green up-arrow in the Mapleprimes toolbar

It is really easy to "work around" because (in the above worksheet)

member( 10, [entries(t1, nolist)]);

will work. But this really shouldn't be necessary

@brian bovril 

The Omega ratio is explained in

https://en.wikipedia.org/wiki/Omega_ratio

and one of the references in that page

Kapsos, Michalis; Zymler, Steve; Christofides, Nicos; Rustem, Berç (Summer 2014). "Optimizing the Omega Ratio using Linear Programming" (PDF). Journal of Computational Finance. 17 (4): 49–57.

gives a more comprensive description of the linear programming approach.

As for the data used in Samir Khan's worksheet, I have no more idea than you about exactly what is meant by the numbers in each column. If I had to guess, based on "real-word" plausibility, then I'd probably assume that the numbers were percentage return per month - purely on the basis that moving up and down a few % per month seems "realistic"

As for trying your own portfolio - I don't give financial advice!! :-)

@ogunmiloro 

Everything to do with your choice to use 2D input.

You should realise that when you choose to use 2D input, the interpretation of "whitespace" characters (ie spaces, tabs, C/R) varies. Sometimes "whitespace" is just "whitespace" - and sometimes it isn't. If you wish to continue using 2D-input then you really must learn when a "space" character is just a space and when it means something else (such as a multiplication). Failure to appreciate these subtleties in 2D-input means that you are pretty much guaranteed to keep running into *interesting" errors. My recommendations would be

  1. If you wish to continue with 2D-input, then never, ever try to make your code "look nice" by using any kind of indentation - and before you enter any kind of whitespace character, consider carefully how it will be interpreted in the current context. This will provide functional code - whihc looks ugly as sin
  2. Use 1-D input. This has the "miraculous" property that "whitespqace" is just white space and never anything else. Hence you can use as much indentation and spacing of code layout as you want. I find that this greatly improves legibility

Attached are two files. The first uses 2-D input: the only changes to the worksheet whch you posted (ie  ) are that I deleted all the "whitespace" in the offending commands. This works but doesn't do much for code legibility. The second uses 1-D input; this makes it easier (for me) to determine which arguments and options are associated with which command, and is therefore more "human-readable"

restart; with(plots); interface(version); _local(gamma)

`Standard Worksheet Interface, Maple 18.02, Windows 7, October 20 2014 Build ID 991181`

(1)

M__h := .50:

ODEs := diff(B(T), T) = M__h-beta__1*psi*(B(T)+C(T))*H(T)-sigma*psi*beta__1*E(T)*H(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*(B(T)+C(T))*H(T)-(alpha+xi+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(`&varpi;`+xi+mu__r)*DD(T), diff(E(T), T) = `&varpi;`*DD(T)-(gamma+mu__r)*E(T), diff(F(T), T) = gamma*E(T)+sigma*psi*beta__1*F(T)*H(T)-mu__r*F(T), diff(G(T), T) = M__c-psi*beta__o*G(T)*DD(T)-mu__b*G(T), diff(H(T), T) = psi*beta__o*G(T)*DD(T)-mu__b*H(T):

ans := dsolve([ODEs, bcs], numeric):

 

 

 

 

 

 

 

interface(rtablesize = 22); M := Matrix([`~`[lhs](ans(0)), seq(`~`[rhs](ans(j)), j = 0 .. 20)])

M := Matrix(22, 8, {(1, 1) = T, (1, 2) = B(T), (1, 3) = C(T), (1, 4) = DD(T), (1, 5) = E(T), (1, 6) = F(T), (1, 7) = G(T), (1, 8) = H(T), (2, 1) = 0., (2, 2) = 50., (2, 3) = 30., (2, 4) = 21., (2, 5) = 14., (2, 6) = 70., (2, 7) = 45., (2, 8) = 14., (3, 1) = 1., (3, 2) = 50.4757829913694, (3, 3) = 25.5575079474562, (3, 4) = 20.2413350094118, (3, 5) = 8.93476021674514, (3, 6) = 77.8009301456023, (3, 7) = 45.4056689838066, (3, 8) = 13.9344799352524, (4, 1) = 2., (4, 2) = 50.9517042861457, (4, 3) = 21.7732057953036, (4, 4) = 19.1991185729657, (4, 5) = 6.33111424301372, (4, 6) = 83.0173704221050, (4, 7) = 45.8094678095317, (4, 8) = 13.8691335287751, (5, 1) = 3., (5, 2) = 51.4276669563117, (5, 3) = 18.5495796746541, (5, 4) = 17.9820385233544, (5, 5) = 4.92813671736454, (5, 6) = 86.8798586692581, (5, 7) = 46.2114574379362, (5, 8) = 13.8039082811349, (6, 1) = 4., (6, 2) = 51.9036130320715, (6, 3) = 15.8035626969457, (6, 4) = 16.6714516583213, (6, 5) = 4.10887104570361, (6, 6) = 89.9876659437646, (6, 7) = 46.6116795393824, (6, 8) = 13.7387709410969, (7, 1) = 5., (7, 2) = 52.3795051400209, (7, 3) = 13.4643946140523, (7, 4) = 15.3273237666627, (7, 5) = 3.57371565743505, (7, 6) = 92.6321391296506, (7, 7) = 47.0101611197031, (7, 8) = 13.6737028799647, (8, 1) = 6., (8, 2) = 52.8553172609914, (8, 3) = 11.4717985735175, (8, 4) = 13.9929712055072, (8, 5) = 3.17880170203220, (8, 6) = 94.9557749671457, (8, 7) = 47.4069181944612, (8, 8) = 13.6086964175305, (9, 1) = 7., (9, 2) = 53.3310300135796, (9, 3) = 9.77442795393850, (9, 4) = 12.6988352778328, (9, 5) = 2.85616909435746, (9, 6) = 97.0300691802980, (9, 7) = 47.8019586919789, (9, 8) = 13.5437519192551, (10, 1) = 8., (10, 2) = 53.8066281916241, (10, 3) = 8.32854334230932, (10, 4) = 11.4654771278927, (10, 5) = 2.57446425033359, (10, 6) = 98.8932984213762, (10, 7) = 48.1952847329760, (10, 8) = 13.4788755168356, (11, 1) = 9., (11, 2) = 54.2820994312045, (11, 3) = 7.09688550193379, (11, 4) = 10.3059458447231, (11, 5) = 2.31968445942390, (11, 6) = 100.568614896467, (11, 7) = 48.5868944080827, (11, 8) = 13.4140773308999, (12, 1) = 10., (12, 2) = 54.7574334499874, (12, 3) = 6.04771539478718, (12, 4) = 9.22764331200852, (12, 5) = 2.08581976619023, (12, 6) = 102.072526790591, (12, 7) = 48.9767831521078, (12, 8) = 13.3493700969435, (13, 1) = 11., (13, 2) = 55.2326215818715, (13, 3) = 5.15399607440913, (13, 4) = 8.23378670861787, (13, 5) = 1.87036441689728, (13, 6) = 103.418731306890, (13, 7) = 49.3649447962597, (13, 8) = 13.2847681133127, (14, 1) = 12., (14, 2) = 55.7076564691196, (14, 3) = 4.39269644819759, (14, 4) = 7.32454792482105, (14, 5) = 1.67221333782959, (14, 6) = 104.619737022156, (14, 7) = 49.7513723627469, (14, 8) = 13.2202864468074, (15, 1) = 13., (15, 2) = 56.1825318417621, (15, 3) = 3.74419753068560, (15, 4) = 6.49793765842352, (15, 5) = 1.49071216478514, (15, 6) = 105.687467337294, (15, 7) = 50.1360586566244, (15, 8) = 13.1559403410368, (16, 1) = 14., (16, 2) = 56.6572423491652, (16, 3) = 3.19178693040782, (16, 4) = 5.75048524495814, (16, 5) = 1.32526003144654, (16, 6) = 106.633415749484, (16, 7) = 50.5189966968304, (16, 8) = 13.0917447855840, (17, 1) = 15., (17, 2) = 57.1317834251096, (17, 3) = 2.72122859254014, (17, 4) = 5.07775680378739, (17, 5) = 1.17516896160884, (17, 6) = 107.468624579588, (17, 7) = 50.9001800213339, (17, 8) = 13.0277142110589, (18, 1) = 16., (18, 2) = 57.6061511758188, (18, 3) = 2.32039527095494, (18, 4) = 4.47474747095627, (18, 5) = 1.03963680345053, (18, 6) = 108.203610436062, (18, 7) = 51.2796028953429, (18, 8) = 12.9638622810886, (19, 1) = 17., (19, 2) = 58.0803422857694, (19, 3) = 1.97895651531399, (19, 4) = 3.93617229075042, (19, 5) = .917766153838762, (19, 6) = 108.848289685284, (19, 7) = 51.6572604433541, (19, 8) = 12.9002017604666, (20, 1) = 18., (20, 2) = 58.5543539371233, (20, 3) = 1.68811238325571, (20, 4) = 3.45667982032798, (20, 5) = .808597352505364, (20, 6) = 109.411923234287, (20, 7) = 52.0331487242844, (20, 8) = 12.8367444402178, (21, 1) = 19., (21, 2) = 59.0281837405626, (21, 3) = 1.44036675537223, (21, 4) = 3.03100499830172, (21, 5) = .711142050392071, (21, 6) = 109.903085135445, (21, 7) = 52.4072647634383, (21, 8) = 12.7735011058283, (22, 1) = 20., (22, 2) = 59.5018296756537, (22, 3) = 1.22933413066306, (22, 4) = 2.65407535007048, (22, 5) = .624412016612247, (22, 6) = 110.329653167156, (22, 7) = 52.7796065526334, (22, 8) = 12.7104815373142})

(2)

Order := 12:

{B(T) = 50.+.4756654107*T+0.1496304111e-3*T^2-0.3710256611e-4*T^3+0.5759332898e-5*T^4-0.7903268164e-6*T^5+0.9241268171e-7*T^6-0.9302910232e-8*T^7+0.8202016339e-9*T^8-0.6430551289e-10*T^9+0.4539572144e-11*T^10-0.2915144956e-12*T^11, C(T) = 30.-4.808192000*T+.3855049585*T^2-0.2060521254e-1*T^3+0.8260003686e-3*T^4-0.2648910213e-4*T^5+0.7078835612e-6*T^6-0.1621364726e-7*T^7+0.3248732067e-9*T^8-0.5781624419e-11*T^9+0.9231228136e-13*T^10-0.1322245525e-14*T^11, DD(T) = 21.-.5724000000*T-.2116752800*T^2+0.2714615569e-1*T^3-0.1818081122e-2*T^4+0.8522283990e-4*T^5-0.3104815485e-5*T^6+0.9291359531e-7*T^7-0.2364596022e-8*T^8+0.5241861768e-10*T^9-0.1030197179e-11*T^10+0.1819297370e-13*T^11, E(T) = 14.-6.991600000*T+2.410107520*T^2-.5721345982*T^3+.1010901644*T^4-0.1420943480e-1*T^5+0.1660617999e-2*T^6-0.1662161274e-3*T^7+0.1455377825e-4*T^8-0.1132642572e-5*T^9+0.7933098813e-7*T^10-0.5051232921e-8*T^11, F(T) = 70.+9.774632946*T-2.448837269*T^2+.5626536631*T^3-.1001744212*T^4+0.1415986335e-1*T^5-0.1658619621e-2*T^6+0.1661472996e-3*T^7-0.1455139936e-4*T^8+0.1132543011e-5*T^9-0.7932574563e-7*T^10+0.5050928877e-8*T^11, G(T) = 45.+.4066303200*T-0.9767660193e-3*T^2+0.1670011009e-4*T^3-0.1334568823e-5*T^4+0.6663102388e-7*T^5-0.2419818363e-8*T^6+0.6952934982e-10*T^7-0.1637295128e-11*T^8+0.3147746591e-13*T^9-0.4508715635e-15*T^10+0.2203562579e-17*T^11, H(T) = 14.-0.6563032000e-1*T+0.1242660193e-3*T^2-0.1527927676e-4*T^3+0.1332792781e-5*T^4-0.6662924784e-7*T^5+0.2419816883e-8*T^6-0.6952934877e-10*T^7+0.1637295127e-11*T^8-0.3147746591e-13*T^9+0.4508715635e-15*T^10-0.2203562579e-17*T^11}

(3)

for j in indets([ODEs], function(name)) do display([odeplot(ans, [T, j], T = 0 .. 10, thickness = 2, color = red), plot(eval(j, ans2), T = 0 .. 10, thickness = 2, color = blue)], title = cat(convert(j, string), " (Numerical and PowerSeries compared)"), titlefont = [tims, bold, 20]) end do;

 

 

 

 

 

 

 

 

Download Phd11_2D.mw

  restart:
  with(plots):
  interface(version);
  local gamma:

`Standard Worksheet Interface, Maple 18.02, Windows 7, October 20 2014 Build ID 991181`

(1)

  M__h:= 0.50:    beta__o:= 0.034: beta__1:= 0.025:
  mu__r:= 0.0004: sigma:= 0.7902:  alpha:= 0.11:
  psi:= 0.000136: xi:= 0.05:       gamma:= 0.7:
  M__c:= 0.636:   mu__b:= 0.005:   varpi:= 0.134:

  ODEs:= diff(B(T), T) = M__h - beta__1*psi*(B(T) + C(T))*H(T) - sigma*psi*beta__1*E(T)*H(T) - mu__r*B(T),
         diff(C(T), T) = beta__1*psi*(B(T) + C(T))*H(T) - (alpha + xi + mu__r)*C(T),
         diff(DD(T), T) = alpha*C(T) - (varpi + xi + mu__r)*DD(T), diff(E(T), T) = varpi*DD(T) - (gamma + mu__r)*E(T),
         diff(F(T), T) = gamma*E(T) + sigma*psi*beta__1*F(T)*H(T) - mu__r*F(T),
         diff(G(T), T) = M__c - psi*beta__o*G(T)*DD(T) - mu__b*G(T),
         diff(H(T), T) = psi*beta__o*G(T)*DD(T) - mu__b*H(T):
  bcs:=  B(0) = 50, C(0) = 30, DD(0) = 21, E(0) = 14,
         F(0) = 70, G(0) = 45,  H(0) = 14:

  ans:= dsolve([ODEs, bcs], numeric):
  for j in indets([ODEs], function(name)) do
      odeplot( ans,
               [T, j],
               T = 0 .. 30,
               title = convert(j, string),
               titlefont = [tims, bold, 20],
               thickness = 2,
               color = red
             ):
  end do;

 

 

 

 

 

 

 

  interface(rtablesize = 22):
  M:= Matrix
      ( [ lhs~(ans(0)),
          seq
          ( rhs~(ans(j)),
            j = 0 .. 20
          )
        ]
      );

M := Matrix(22, 8, {(1, 1) = T, (1, 2) = B(T), (1, 3) = C(T), (1, 4) = DD(T), (1, 5) = E(T), (1, 6) = F(T), (1, 7) = G(T), (1, 8) = H(T), (2, 1) = 0., (2, 2) = 50., (2, 3) = 30., (2, 4) = 21., (2, 5) = 14., (2, 6) = 70., (2, 7) = 45., (2, 8) = 14., (3, 1) = 1., (3, 2) = 50.4757829913694, (3, 3) = 25.5575079474562, (3, 4) = 20.2413350094118, (3, 5) = 8.93476021674514, (3, 6) = 77.8009301456023, (3, 7) = 45.4056689838066, (3, 8) = 13.9344799352524, (4, 1) = 2., (4, 2) = 50.9517042861457, (4, 3) = 21.7732057953036, (4, 4) = 19.1991185729657, (4, 5) = 6.33111424301372, (4, 6) = 83.0173704221050, (4, 7) = 45.8094678095317, (4, 8) = 13.8691335287751, (5, 1) = 3., (5, 2) = 51.4276669563117, (5, 3) = 18.5495796746541, (5, 4) = 17.9820385233544, (5, 5) = 4.92813671736454, (5, 6) = 86.8798586692581, (5, 7) = 46.2114574379362, (5, 8) = 13.8039082811349, (6, 1) = 4., (6, 2) = 51.9036130320715, (6, 3) = 15.8035626969457, (6, 4) = 16.6714516583213, (6, 5) = 4.10887104570361, (6, 6) = 89.9876659437646, (6, 7) = 46.6116795393824, (6, 8) = 13.7387709410969, (7, 1) = 5., (7, 2) = 52.3795051400209, (7, 3) = 13.4643946140523, (7, 4) = 15.3273237666627, (7, 5) = 3.57371565743505, (7, 6) = 92.6321391296506, (7, 7) = 47.0101611197031, (7, 8) = 13.6737028799647, (8, 1) = 6., (8, 2) = 52.8553172609914, (8, 3) = 11.4717985735175, (8, 4) = 13.9929712055072, (8, 5) = 3.17880170203220, (8, 6) = 94.9557749671457, (8, 7) = 47.4069181944612, (8, 8) = 13.6086964175305, (9, 1) = 7., (9, 2) = 53.3310300135796, (9, 3) = 9.77442795393850, (9, 4) = 12.6988352778328, (9, 5) = 2.85616909435746, (9, 6) = 97.0300691802980, (9, 7) = 47.8019586919789, (9, 8) = 13.5437519192551, (10, 1) = 8., (10, 2) = 53.8066281916241, (10, 3) = 8.32854334230932, (10, 4) = 11.4654771278927, (10, 5) = 2.57446425033359, (10, 6) = 98.8932984213762, (10, 7) = 48.1952847329760, (10, 8) = 13.4788755168356, (11, 1) = 9., (11, 2) = 54.2820994312045, (11, 3) = 7.09688550193379, (11, 4) = 10.3059458447231, (11, 5) = 2.31968445942390, (11, 6) = 100.568614896467, (11, 7) = 48.5868944080827, (11, 8) = 13.4140773308999, (12, 1) = 10., (12, 2) = 54.7574334499874, (12, 3) = 6.04771539478718, (12, 4) = 9.22764331200852, (12, 5) = 2.08581976619023, (12, 6) = 102.072526790591, (12, 7) = 48.9767831521078, (12, 8) = 13.3493700969435, (13, 1) = 11., (13, 2) = 55.2326215818715, (13, 3) = 5.15399607440913, (13, 4) = 8.23378670861787, (13, 5) = 1.87036441689728, (13, 6) = 103.418731306890, (13, 7) = 49.3649447962597, (13, 8) = 13.2847681133127, (14, 1) = 12., (14, 2) = 55.7076564691196, (14, 3) = 4.39269644819759, (14, 4) = 7.32454792482105, (14, 5) = 1.67221333782959, (14, 6) = 104.619737022156, (14, 7) = 49.7513723627469, (14, 8) = 13.2202864468074, (15, 1) = 13., (15, 2) = 56.1825318417621, (15, 3) = 3.74419753068560, (15, 4) = 6.49793765842352, (15, 5) = 1.49071216478514, (15, 6) = 105.687467337294, (15, 7) = 50.1360586566244, (15, 8) = 13.1559403410368, (16, 1) = 14., (16, 2) = 56.6572423491652, (16, 3) = 3.19178693040782, (16, 4) = 5.75048524495814, (16, 5) = 1.32526003144654, (16, 6) = 106.633415749484, (16, 7) = 50.5189966968304, (16, 8) = 13.0917447855840, (17, 1) = 15., (17, 2) = 57.1317834251096, (17, 3) = 2.72122859254014, (17, 4) = 5.07775680378739, (17, 5) = 1.17516896160884, (17, 6) = 107.468624579588, (17, 7) = 50.9001800213339, (17, 8) = 13.0277142110589, (18, 1) = 16., (18, 2) = 57.6061511758188, (18, 3) = 2.32039527095494, (18, 4) = 4.47474747095627, (18, 5) = 1.03963680345053, (18, 6) = 108.203610436062, (18, 7) = 51.2796028953429, (18, 8) = 12.9638622810886, (19, 1) = 17., (19, 2) = 58.0803422857694, (19, 3) = 1.97895651531399, (19, 4) = 3.93617229075042, (19, 5) = .917766153838762, (19, 6) = 108.848289685284, (19, 7) = 51.6572604433541, (19, 8) = 12.9002017604666, (20, 1) = 18., (20, 2) = 58.5543539371233, (20, 3) = 1.68811238325571, (20, 4) = 3.45667982032798, (20, 5) = .808597352505364, (20, 6) = 109.411923234287, (20, 7) = 52.0331487242844, (20, 8) = 12.8367444402178, (21, 1) = 19., (21, 2) = 59.0281837405626, (21, 3) = 1.44036675537223, (21, 4) = 3.03100499830172, (21, 5) = .711142050392071, (21, 6) = 109.903085135445, (21, 7) = 52.4072647634383, (21, 8) = 12.7735011058283, (22, 1) = 20., (22, 2) = 59.5018296756537, (22, 3) = 1.22933413066306, (22, 4) = 2.65407535007048, (22, 5) = .624412016612247, (22, 6) = 110.329653167156, (22, 7) = 52.7796065526334, (22, 8) = 12.7104815373142})

(2)

  Order:= 12:
  ans2:= convert~
          ( evalf~
            ( dsolve
              ( { ODEs, bcs },
                indets
                ( [ODEs],
                  function(name)
                ),
                'series'
              )
            ),
            polynom
          ):

  for j in indets([ODEs], function(name)) do
      display
      ( [ odeplot
          ( ans,
            [T, j],
            T = 0 .. 10,
            thickness = 2,
            color = red
          ),
          plot
          ( eval
            (j, ans2),
            T = 0 .. 10,
            thickness = 2,
            color = blue
          )
        ],
        title = cat
                ( convert(j, string),
                  " (Numerical and PowerSeries compared)"
                ),
        titlefont = [times, bold, 20]
      );
  end do;

 

 

 

 

 

 

 

 


 

Download Phd11_1D.mw

@ogunmiloro 

You define a value for the variable M__c but you then use the variable M[c] in the ODEs.

Obviously M[c} and M__c are compltely differtn variables.

Since you have chosen to use 2D input, both of these will display (in both input and output) as Mc and good luck with spotting the difference - although the warning message

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)

should tell you that something is wrong! The simple diagnosis process is

  1. Hmmmm I wonder why I am getting this warning
  2. run indets~([ODEs], name) to check which variables exist in the ODE system - it lists M[c]
  3. But M[c] appears to be defined earlier - except it isn't M[c}, it is M__c
  4. this takes about 30 seconds - and all you have to do is stop ignoring the Maple warning messages.

Anyway,the attached now works

restart; with(plots); _local(gamma)

M__h := .50; beta__o := 0.34e-1; beta__1 := 0.25e-1; mu__r := 0.4e-3; sigma := .7902; alpha := .11; psi := 0.136e-3; xi := 0.5e-1; gamma := .7; M__c := .636; mu__b := 0.5e-2; `&varpi;` := .134

ODEs := diff(B(T), T) = M__h-beta__1*psi*(B(T)+C(T))*V(T)-sigma*psi*beta__1*E(T)*V(T)-mu__r*B(T), diff(C(T), T) = beta__1*psi*(B(T)+C(T))*V(T)-(alpha+mu__r)*C(T), diff(DD(T), T) = alpha*C(T)-(`&varpi;`+xi+mu__r)*DD(T), diff(E(T), T) = `&varpi;`*DD(T)-(gamma+mu__r)*E(T), diff(F(T), T) = gamma*E(T)-sigma*psi*beta__1*E(T)*G(T)-mu__r*F(T), diff(G(T), T) = M__c-psi*beta__o*F(T)*C(T)-mu__b*G(T), diff(V(T), T) = psi*beta__o*F(T)*C(T)-mu__b*V(T); bcs := B(0) = .50, C(0) = .30, DD(0) = .21, E(0) = .14, F(0) = .70, G(0) = .45, V(0) = .33

ans := dsolve([ODEs, bcs], numeric); for j in indets([ODEs], function(name)) do odeplot(ans, [T, j], T = 0 .. 30, title = convert(j, string), titlefont = [tims, bold, 20], thickness = 2, color = red) end do

 

 

 

 

 

 

 

M__c;


 

Download another2Dproblem.mw

 

 

 

 

cos I only have a Windows machine, but I see no problems in runniing your examples in either Maple 2018 or Maple 2019. See the attached worksheets

kernelopts(version);

`Maple 2018.2, X86 64 WINDOWS, Nov 16 2018, Build ID 1362973`

(1)

assume(a>-1,b>0);
additionally(a<=1);
about(a);

Originally a, renamed a~:
  is assumed to be: RealRange(Open(-1),1)

 

assume(tau<1,tau>0,s<1,s>0):
a_e1:=tau*s*(1+tau)<tau*s+tau+s-1:
b_e2:=expand(lhs(a_e1)-rhs(a_e1))<0:
 b_e3:=collect(b_e2,s,factor):
solve(b_e2,s) assuming tau<1;

[{1/(1+tau) < s}]

(2)

 

kernelopts(version);

`Maple 2019.1, X86 64 WINDOWS, May 21 2019, Build ID 1399874`

(1)

assume(a>-1,b>0);
additionally(a<=1);
about(a);

Originally a, renamed a~:

  is assumed to be: RealRange(Open(-1),1)

 

assume(tau<1,tau>0,s<1,s>0):
a_e1:=tau*s*(1+tau)<tau*s+tau+s-1:
b_e2:=expand(lhs(a_e1)-rhs(a_e1))<0:
 b_e3:=collect(b_e2,s,factor):
solve(b_e2,s) assuming tau<1;

[{1/(1+tau) < s}]

(2)

 


Download m18test.mw

Download m19test.mw

 

@radaar 

There are two basic ways to "speed-up" DirectSearch() execution times

  1. For any given set/list of values of the independent variables, reduce the time taken to calculate the objective function. Assume that this objective function will be calculated ~10000 times (at least). Hence saving 0.1sec per function evaluation will save you about 1000secs (or 15 minutes). So spend a lot of time making sure that the objective function evaluation is as fast as possible - this may take quite a lot of thought and careful coding: tough - deal with it
  2. Ensure that the search space of the independent variables is as small as possible. With no constraints on an independent variable, any value between -infinity and infinity is equally possible. Knowing that a value has to be positive will restrict this search space to 0..infinity and you have just reduced the search space by a factor of two (and the execution time by soomething comparable). Knowing that a particular valiable has to be in the range 0..1 reduces the search space dramatically, with hugely beneficial effects on execution time

For "abstract mathematical" optimisation problems search space reduction may be inappropriate. For any "real-world" problems, the "real world" will set constraints on possible values for the variables - use this information ad set the constraints as tightly as possible.

@David Sycamore 

The attached code runs in

Maple 18
Maple 2015
Maple 2016
Maple 2017
Maple 2018
Maple 2019

I know this because I have just checked it in all of these releases. The version uploaded here was run in  Maple 2017 which you claim to have, This can be verified from the output of the interface(version) command, in the following, which is

`Standard Worksheet Interface, Maple 2017.3, Windows 7, September 13 2017 Build ID 1262472`

(1)

I have added a couple of execution groups at the end, just to run the main working procedure on the numbers obtained by Carl Love (more out of interest, because I'm pretty sure he is correct!).

If you find that this code *still* does not execute correctly, then I suggest you perform the following

  1. download the code using the link at the bottom of this post
  2. execute the code - just use the !!! toolbar button in Maple
  3. save the resulting worksheet (any filename will do)
  4. upload this saved worksheet here using the big green up-arrow in the Mapleprimes toolbar

  restart;
  interface(version);
#
# Define the upper limit for the odd numbers
# to be tested and the upper limit for the
# even addends
#
  Nodd:=10000:
  Neven:=10000:
#
# Procedure which does the work
#
  doWork:= proc( p::posint, N::posint )
                 local #
                       # Edited this to run in Maple 18
                       # whihc means it will probably run
                       # in every subsequent version
                       #
                       # f:=NumberTheory:-PrimeFactors(p),
                        f:=numtheory:-factorset(p),
                       j:
                 for j from 2 by 2 to N do
                     if   isprime~(f+~j)={true}
                     then #
                          # Return a list containing the
                          # input odd number, its prime
                          # factors, the lowest even number
                          # which produces a a new set of primes,
                          # and this new set of primes
                          #
                            return [p, f, j, f+~j];
                     fi;
                 od;
                 return #
                        # No even addend found: return a list
                        # containing the input odd number and
                        # a zero
                        #
                          [p, f, 0];
           end proc:

`Standard Worksheet Interface, Maple 2017.3, Windows 7, September 13 2017 Build ID 1262472`

(1)

#
# Check how long it takes to return the complete list
# of answers for the specific values of NO and NE
#
# Results on my machine were. NB all timings approximate
#
#    Nodd    Neven      real time
#
#    100     100        15  msecs
#    100     1000       15  msecs
#    100     10000      15  msecs
#   
#    1000    100        66  msecs
#    1000    1000       77  msecs
#    1000    10000      1.0 secs
#  
#    10000   100        0.5 secs
#    10000   1000       1.5 secs
#    10000   10000      16  secs     
#
  ans:=CodeTools:-Usage([seq( doWork(j, Neven), j=3..Nodd,2)]):

memory used=1.73GiB, alloc change=40.00MiB, cpu time=14.27s, real time=14.27s, gc time=655.20ms

 

#
# Check answers for a couple of the cases used by OP
# to illustrate problem
#
# Utility to facilitate lookup of the answer in the
# main result list for any supplied odd number
#
  getVal:=p->(p-1)/2:
  ans[ getVal(119) ];
  ans[ getVal(105) ];

[119, {7, 17}, 6, {13, 23}]

 

[105, {3, 5, 7}, 0]

(2)

#
# Split the original list into successes and failures.
# Out of idle curiosity, check the number of successes
# and failures
#
  success,failure:=selectremove(i->numelems(i)=4, ans):
  numelems(success);
  numelems(failure);
#
# Output the first few successes and failures
#
  success[1..100];
  failure[1..100];
#
# Check whether the failure cases *always* have '3' as
# a prime factor. This should output any odd number
# which "failed" to generate a new set of prime numbers,
# and itself doesn't have '3' as a prime factor.
#
# It outputs nothing  interesting? coincidence??
#
  seq( `if`( j[2][1]=3, NULL, j[1]), j in failure);

4534

 

465

 

[[3, {3}, 2, {5}], [5, {5}, 2, {7}], [7, {7}, 4, {11}], [9, {3}, 2, {5}], [11, {11}, 2, {13}], [13, {13}, 4, {17}], [15, {3, 5}, 2, {5, 7}], [17, {17}, 2, {19}], [19, {19}, 4, {23}], [21, {3, 7}, 4, {7, 11}], [23, {23}, 6, {29}], [25, {5}, 2, {7}], [27, {3}, 2, {5}], [29, {29}, 2, {31}], [31, {31}, 6, {37}], [33, {3, 11}, 2, {5, 13}], [35, {5, 7}, 6, {11, 13}], [37, {37}, 4, {41}], [39, {3, 13}, 4, {7, 17}], [41, {41}, 2, {43}], [43, {43}, 4, {47}], [45, {3, 5}, 2, {5, 7}], [47, {47}, 6, {53}], [49, {7}, 4, {11}], [51, {3, 17}, 2, {5, 19}], [53, {53}, 6, {59}], [55, {5, 11}, 2, {7, 13}], [57, {3, 19}, 4, {7, 23}], [59, {59}, 2, {61}], [61, {61}, 6, {67}], [63, {3, 7}, 4, {7, 11}], [65, {5, 13}, 6, {11, 19}], [67, {67}, 4, {71}], [69, {3, 23}, 8, {11, 31}], [71, {71}, 2, {73}], [73, {73}, 6, {79}], [75, {3, 5}, 2, {5, 7}], [77, {7, 11}, 6, {13, 17}], [79, {79}, 4, {83}], [81, {3}, 2, {5}], [83, {83}, 6, {89}], [85, {5, 17}, 2, {7, 19}], [87, {3, 29}, 2, {5, 31}], [89, {89}, 8, {97}], [91, {7, 13}, 4, {11, 17}], [93, {3, 31}, 10, {13, 41}], [95, {5, 19}, 12, {17, 31}], [97, {97}, 4, {101}], [99, {3, 11}, 2, {5, 13}], [101, {101}, 2, {103}], [103, {103}, 4, {107}], [107, {107}, 2, {109}], [109, {109}, 4, {113}], [111, {3, 37}, 4, {7, 41}], [113, {113}, 14, {127}], [115, {5, 23}, 6, {11, 29}], [117, {3, 13}, 4, {7, 17}], [119, {7, 17}, 6, {13, 23}], [121, {11}, 2, {13}], [123, {3, 41}, 2, {5, 43}], [125, {5}, 2, {7}], [127, {127}, 4, {131}], [129, {3, 43}, 4, {7, 47}], [131, {131}, 6, {137}], [133, {7, 19}, 4, {11, 23}], [135, {3, 5}, 2, {5, 7}], [137, {137}, 2, {139}], [139, {139}, 10, {149}], [141, {3, 47}, 14, {17, 61}], [143, {11, 13}, 6, {17, 19}], [145, {5, 29}, 2, {7, 31}], [147, {3, 7}, 4, {7, 11}], [149, {149}, 2, {151}], [151, {151}, 6, {157}], [153, {3, 17}, 2, {5, 19}], [155, {5, 31}, 6, {11, 37}], [157, {157}, 6, {163}], [159, {3, 53}, 8, {11, 61}], [161, {7, 23}, 6, {13, 29}], [163, {163}, 4, {167}], [165, {3, 5, 11}, 2, {5, 7, 13}], [167, {167}, 6, {173}], [169, {13}, 4, {17}], [171, {3, 19}, 4, {7, 23}], [173, {173}, 6, {179}], [175, {5, 7}, 6, {11, 13}], [177, {3, 59}, 2, {5, 61}], [179, {179}, 2, {181}], [181, {181}, 10, {191}], [183, {3, 61}, 10, {13, 71}], [185, {5, 37}, 6, {11, 43}], [187, {11, 17}, 2, {13, 19}], [189, {3, 7}, 4, {7, 11}], [191, {191}, 2, {193}], [193, {193}, 4, {197}], [197, {197}, 2, {199}], [199, {199}, 12, {211}], [201, {3, 67}, 4, {7, 71}], [203, {7, 29}, 12, {19, 41}], [205, {5, 41}, 2, {7, 43}]]

 

[[105, {3, 5, 7}, 0], [195, {3, 5, 13}, 0], [231, {3, 7, 11}, 0], [285, {3, 5, 19}, 0], [315, {3, 5, 7}, 0], [357, {3, 7, 17}, 0], [429, {3, 11, 13}, 0], [465, {3, 5, 31}, 0], [483, {3, 7, 23}, 0], [525, {3, 5, 7}, 0], [555, {3, 5, 37}, 0], [585, {3, 5, 13}, 0], [609, {3, 7, 29}, 0], [627, {3, 11, 19}, 0], [645, {3, 5, 43}, 0], [663, {3, 13, 17}, 0], [693, {3, 7, 11}, 0], [735, {3, 5, 7}, 0], [855, {3, 5, 19}, 0], [861, {3, 7, 41}, 0], [897, {3, 13, 23}, 0], [915, {3, 5, 61}, 0], [945, {3, 5, 7}, 0], [969, {3, 17, 19}, 0], [975, {3, 5, 13}, 0], [987, {3, 7, 47}, 0], [1005, {3, 5, 67}, 0], [1023, {3, 11, 31}, 0], [1071, {3, 7, 17}, 0], [1095, {3, 5, 73}, 0], [1113, {3, 7, 53}, 0], [1131, {3, 13, 29}, 0], [1155, {3, 5, 7, 11}, 0], [1185, {3, 5, 79}, 0], [1221, {3, 11, 37}, 0], [1239, {3, 7, 59}, 0], [1287, {3, 11, 13}, 0], [1311, {3, 19, 23}, 0], [1365, {3, 5, 7, 13}, 0], [1395, {3, 5, 31}, 0], [1419, {3, 11, 43}, 0], [1425, {3, 5, 19}, 0], [1449, {3, 7, 23}, 0], [1455, {3, 5, 97}, 0], [1491, {3, 7, 71}, 0], [1545, {3, 5, 103}, 0], [1575, {3, 5, 7}, 0], [1581, {3, 17, 31}, 0], [1599, {3, 13, 41}, 0], [1617, {3, 7, 11}, 0], [1635, {3, 5, 109}, 0], [1653, {3, 19, 29}, 0], [1665, {3, 5, 37}, 0], [1743, {3, 7, 83}, 0], [1755, {3, 5, 13}, 0], [1785, {3, 5, 7, 17}, 0], [1827, {3, 7, 29}, 0], [1833, {3, 13, 47}, 0], [1869, {3, 7, 89}, 0], [1881, {3, 11, 19}, 0], [1887, {3, 17, 37}, 0], [1905, {3, 5, 127}, 0], [1935, {3, 5, 43}, 0], [1989, {3, 13, 17}, 0], [1995, {3, 5, 7, 19}, 0], [2013, {3, 11, 61}, 0], [2067, {3, 13, 53}, 0], [2079, {3, 7, 11}, 0], [2085, {3, 5, 139}, 0], [2121, {3, 7, 101}, 0], [2139, {3, 23, 31}, 0], [2145, {3, 5, 11, 13}, 0], [2193, {3, 17, 43}, 0], [2205, {3, 5, 7}, 0], [2211, {3, 11, 67}, 0], [2247, {3, 7, 107}, 0], [2265, {3, 5, 151}, 0], [2301, {3, 13, 59}, 0], [2325, {3, 5, 31}, 0], [2337, {3, 19, 41}, 0], [2355, {3, 5, 157}, 0], [2373, {3, 7, 113}, 0], [2409, {3, 11, 73}, 0], [2415, {3, 5, 7, 23}, 0], [2445, {3, 5, 163}, 0], [2499, {3, 7, 17}, 0], [2535, {3, 5, 13}, 0], [2541, {3, 7, 11}, 0], [2553, {3, 23, 37}, 0], [2565, {3, 5, 19}, 0], [2583, {3, 7, 41}, 0], [2607, {3, 11, 79}, 0], [2625, {3, 5, 7}, 0], [2679, {3, 19, 47}, 0], [2691, {3, 13, 23}, 0], [2697, {3, 29, 31}, 0], [2715, {3, 5, 181}, 0], [2745, {3, 5, 61}, 0], [2751, {3, 7, 131}, 0], [2769, {3, 13, 71}, 0]]

(3)

#
# What happens when the procedure doWork is applied to the
# odd numbers found by Carl Love. Looks like he was right.
# Final value in each output list is 0, indicating that no even
# number (up to 10000) added to the factor list produces a
# a list of primes.
#
# I suppose there *might* be even numbers greater
# than the tested limit (10000) which could prove the
# opposite
#
  doWork~( [ 105, 95095, 215656441, 5070519693819151, 121621899527020215557,
             21664759328930363899339259137, 6118163487924060025029213220329793,
             3042203271558217610793849843552106188681707,
             410050702193824620789441168165116752238670790985538614407,
             243521388535217606004348248409375049907078159488916219637351331,
             65167879497494548612895080562902666093018940639437608943583983945258079733989
           ],
           10000
         );

[[105, {3, 5, 7}, 0], [95095, {5, 7, 11, 13, 19}, 0], [215656441, {7, 11, 13, 17, 19, 23, 29}, 0], [5070519693819151, {11, 13, 17, 19, 23, 29, 31, 37, 43, 47, 71}, 0], [121621899527020215557, {13, 17, 19, 23, 29, 31, 37, 41, 47, 53, 59, 61, 103}, 0], [21664759328930363899339259137, {17, 19, 23, 29, 31, 37, 41, 43, 47, 59, 61, 67, 73, 79, 83, 89, 103}, 0], [6118163487924060025029213220329793, {19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 71, 73, 83, 89, 101, 103, 131, 163, 191}, 0], [3042203271558217610793849843552106188681707, {23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 97, 101, 103, 109, 127, 131, 137, 157, 233}, 0], [410050702193824620789441168165116752238670790985538614407, {29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 97, 103, 107, 109, 113, 127, 139, 149, 151, 173, 179, 181, 191, 193, 317}, 0], [243521388535217606004348248409375049907078159488916219637351331, {31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 107, 113, 127, 131, 137, 139, 149, 157, 173, 179, 181, 271, 277, 311, 577}, 0], [65167879497494548612895080562902666093018940639437608943583983945258079733989, {37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 131, 137, 139, 149, 151, 167, 173, 179, 193, 197, 199, 229, 233, 239, 277, 317, 383, 439}, 0]]

(4)

doWork(81345, 10000);

[81345, {3, 5, 11, 17, 29}, 2, {5, 7, 13, 19, 31}]

(5)

 

Download prmeProb3.mw

 

 

First 59 60 61 62 63 64 65 Last Page 61 of 207