Maple 2019 Questions and Posts

These are Posts and Questions associated with the product, Maple 2019

I have to maximize my non linear objective function TBCI (given in attached worksheet) with 4 inequality constraints. The decision variables are i and q.The range of i is 0 to 1 and of q is 0 to 76.

When i tru to solve it using NLP solve it is showing error-"Error, (in Optimization:-NLPSolve) constraints must be specified as a set or list of equalities and inequalities".

Please help me to solve it. please find attached the maple file

restart

with(plots); with(DEtools); with(LinearAlgebra); with(Student[VectorCalculus]); with(linalg); with(Optimization); with(student)

TC := proc (Q) options operator, arrow; O1*(1-beta)*D/Q+(1/2)*h1*Q+(1/2)*h2*(gamma-beta)*Qr/gamma+O2*beta*D/Qr+r*beta*D-q*beta*D-P*(1-i)*beta*D end proc

proc (Q) options operator, arrow; Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(O1, Student:-VectorCalculus:-`+`(1, Student:-VectorCalculus:-`-`(beta))), Student:-VectorCalculus:-D), Q^Student:-VectorCalculus:-`-`(1)), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(h1, Q), 2^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(h2, Student:-VectorCalculus:-`+`(gamma, Student:-VectorCalculus:-`-`(beta))), Qr), Student:-VectorCalculus:-`*`(2, gamma)^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(O2, beta), Student:-VectorCalculus:-D), Qr^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(r, beta), Student:-VectorCalculus:-D)), Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(q, beta), Student:-VectorCalculus:-D))), Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(P, Student:-VectorCalculus:-`+`(1, Student:-VectorCalculus:-`-`(i))), beta), Student:-VectorCalculus:-D))) end proc

(1)

diff(TC(Q), Q)

-O1*(1-beta)*Student:-VectorCalculus:-D/Q^2+(1/2)*h1

(2)

simplify(isolate(%, Q))

Q = RootOf(2*Student:-VectorCalculus:-D*O1*beta+_Z^2*h1-2*Student:-VectorCalculus:-D*O1)

(3)

diff(TC(Q), Qr)

(1/2)*h2*(gamma-beta)/gamma-O2*beta*Student:-VectorCalculus:-D/Qr^2

(4)

simplify(isolate(%, Qr))

Qr = RootOf((beta*h2-gamma*h2)*_Z^2+2*gamma*O2*beta*Student:-VectorCalculus:-D)

(5)

diff(TC(Q), `$`(Q, 2))

2*O1*(1-beta)*Student:-VectorCalculus:-D/Q^3

(6)

diff(TC(Q), `$`(Qr, 2))

2*O2*beta*Student:-VectorCalculus:-D/Qr^3

(7)

TC1 := proc (Q, Qr) options operator, arrow; O1*(-beta*i+1)*D/Q+(1/2)*h1*Q+(1/2)*h2*(-beta*i+gamma)*Qr/gamma+O2*i*beta*D/Qr+r*i*beta*D-q*i*beta*D-P*(1-i)*i*beta*D end proc

proc (Q, Qr) options operator, arrow; Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(O1, Student:-VectorCalculus:-`+`(1, Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(i, beta)))), Student:-VectorCalculus:-D), Q^Student:-VectorCalculus:-`-`(1)), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(h1, Q), 2^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(h2, Student:-VectorCalculus:-`+`(gamma, Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(i, beta)))), Qr), Student:-VectorCalculus:-`*`(2, gamma)^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(O2, i), beta), Student:-VectorCalculus:-D), Qr^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(r, i), beta), Student:-VectorCalculus:-D)), Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(q, i), beta), Student:-VectorCalculus:-D))), Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(P, Student:-VectorCalculus:-`+`(1, Student:-VectorCalculus:-`-`(i))), i), beta), Student:-VectorCalculus:-D))) end proc

(8)

diff(TC1(Q, Qr), Q)

-O1*(-beta*i+1)*Student:-VectorCalculus:-D/Q^2+(1/2)*h1

(9)

a1 := isolate(-O1*(-beta*i+1)*D/Q^2+(1/2)*h1, Q)

Q = RootOf(2*Student:-VectorCalculus:-D*O1*beta*i+_Z^2*h1-2*Student:-VectorCalculus:-D*O1)

(10)

diff(TC1(Q, Qr), Qr)

(1/2)*h2*(-beta*i+gamma)/gamma-O2*i*beta*Student:-VectorCalculus:-D/Qr^2

(11)

a2 := isolate(diff(TC1(Q, Qr), Qr), Qr)

Qr = RootOf((beta*h2*i-gamma*h2)*_Z^2+2*gamma*O2*i*beta*Student:-VectorCalculus:-D)

(12)

TC2 := proc (Q) options operator, arrow; O1*(1-gamma)*D/Q+(1/2)*h1*Q+r*gamma*D-q*gamma*D-P*(1-i)*gamma*D end proc

proc (Q) options operator, arrow; Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`+`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(O1, Student:-VectorCalculus:-`+`(1, Student:-VectorCalculus:-`-`(gamma))), Student:-VectorCalculus:-D), Q^Student:-VectorCalculus:-`-`(1)), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(h1, Q), 2^Student:-VectorCalculus:-`-`(1))), Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(r, gamma), Student:-VectorCalculus:-D)), Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(q, gamma), Student:-VectorCalculus:-D))), Student:-VectorCalculus:-`-`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(Student:-VectorCalculus:-`*`(P, Student:-VectorCalculus:-`+`(1, Student:-VectorCalculus:-`-`(i))), gamma), Student:-VectorCalculus:-D))) end proc

(13)

b1 := isolate(diff(TC2(Q), Q), Q)

Q = RootOf(2*Student:-VectorCalculus:-D*O1*gamma+_Z^2*h1-2*Student:-VectorCalculus:-D*O1)

(14)

E1 := eval(a1, [P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, beta = 0.5e-1, gamma = 0.4e-1, q = 7.65, r = 382.5, i = .5])

Q = RootOf(76.5*_Z^2-20354080.50)

(15)

simplify(E1)

Q = 515.8162578

(16)

E2 := eval(a2, [P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, beta = 0.5e-1, gamma = 0.4e-1, q = 7.65, r = 382.5, i = .5])

Qr = RootOf(.57375*_Z^2-6958.66000)

(17)

simplify(E2)

Qr = 110.1289401

(18)

Totcost := eval(TC1(Q, Qr), [Q = 516, Qr = 110, P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, beta = 0.5e-1, gamma = 0.4e-1, q = 7.65, r = 382.5, i = .5])

-25502.577

(19)

TB1 := B1*D*P*beta*i-D*beta*i*q

B1*Student:-VectorCalculus:-D*P*beta*i-Student:-VectorCalculus:-D*beta*i*q

(20)

TBC := eval(TB1, [B1 = 3.36, P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, beta = 0.5e-1, gamma = 0.4e-1, r = 382.5])

-17396.65*q*i+44716349.16*i

(21)

Totincent := P*i^2*beta*D

P*i^2*beta*Student:-VectorCalculus:-D

(22)

TI := eval(Totincent, [B1 = 3.36, P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, beta = 0.5e-1, gamma = 0.4e-1, r = 382.5])

13308437.25*i^2

(23)

NULL

simplify(subs(P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, gamma = 0.4e-1, q = 7.65, r = 382.5, beta = 0.5e-1, Q = sqrt((2*(-beta*i+1))*O1*D/h1))); simplify(subs(P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, gamma = 0.4e-1, q = 7.65, r = 382.5, beta = 0.5e-1, Qr = sqrt(2*i*beta*gamma*O2*D/((gamma-beta)*h2))))

Q = 3230.787830*(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)

 

Qr = 190.7489196*(-i)^(1/2)

(24)

TCo := eval(TC1(Q, Qr), [Q = 3230.787830*sqrt(-0.1307189542e-2*i+0.2614379084e-1), Qr = 190.7489196*sqrt(-i), P = 765, D = 347933, O1 = 30, O2 = 10, h1 = 76.5, h2 = 38.25, gamma = 0.4e-1, q = 7.65, r = 382.5, beta = 0.5e-1])

3230.787829*(-0.5e-1*i+1)/(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)+123577.6345*(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)+91201.82720*(-0.5e-1*i+0.4e-1)*(-i)^(1/2)+912.0182718*i/(-i)^(1/2)+6521134.252*i-13308437.25*(1-i)*i

(25)

eq1 := TCo <= 0

3230.787829*(-0.5e-1*i+1)/(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)+123577.6345*(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)+91201.82720*(-0.5e-1*i+0.4e-1)*(-i)^(1/2)+912.0182718*i/(-i)^(1/2)+6521134.252*i-13308437.25*(1-i)*i <= 0

(26)

eq2 := 0 <= q/P and q/P <= 1

0 <= q/P and q/P <= 1

(27)

eq3 := 0 <= i and i <= gamma/beta

0 <= i and i <= gamma/beta

(28)

eq4 := TBC >= 0

0 <= -17396.65*q*i+44716349.16*i

(29)

``

TBCI := TBC-TCo+TI

-17396.65*q*i+38195214.91*i-3230.787829*(-0.5e-1*i+1)/(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)-123577.6345*(-0.1307189542e-2*i+0.2614379084e-1)^(1/2)-91201.82720*(-0.5e-1*i+0.4e-1)*(-i)^(1/2)-912.0182718*i/(-i)^(1/2)+13308437.25*(1-i)*i+13308437.25*i^2

(30)

NLPSolve(TBCI, {eq1, eq2, eq3, eq4}, assume = nonnegative)

Error, (in Optimization:-NLPSolve) constraints must be specified as a set or list of equalities and inequalities

 

``

This is Maple 2019. Suppose a directed graph D is given. 

I know that "Cycles≔CycleBasis(D)" lists down all the cycles in D and "numelems(Cycles)" gives the number of cycles in D. But if I only want to count the number of directed cycles of length k, say k=4, in D, is there a Maple function that gives us that?

Thank you all.

Dears,
I have a problem whem try to solve a optimization probolem.
The equations are "complex" (G1 equation), and this error is showed "Error, (in Optimization:-NLPSolve) could not store 0.1749271137e-1*(588.000000000000+72.0000000000000*(-3.03333333+.333333333333333*MM)*(MM-17.80)+72.0000000000000*(.333333333333333*NN-3.5666666666667)*(17.00-1.*NN)+24.50000000*(2.90+4.666666667*tan(1.000000000*arctan(.166666666666667*MM-2.96666666666667)))*(18.00+5.627472876000*sin(-1.570796327+1.000000000*arctan(.166666666666667*MM-2.96666666666667))/sin(-1.745329252+1.000000000*arctan(.166666666666667*MM-2.96666666666667)))*cos(-.5235987756000+1.000000000*arctan(.166666666666667*MM-2.96666666666667))^2*sin(.3490658504000+1.000000000*arctan(.166666666666667*MM-2.9666 ... 756000+1.000000000*arctan(.166666666666667*MM-2.96666666666667))^2)-1. in a floating-point rtable".
Someone can help me?

ATS := proc(NN::float, MM::float) 
L[7]*H[4] + L[4]*H[2] + L[1]*(H[1] - H[2]) + 1/2*(P[X1] - NN)*(H[1] - H[2]) + 1/2*(MM - P[XF])*(H[1] - H[2]); 
end proc;
bounds := 14.90 .. 16.90, 17.90 .. 19.90;
cstr8 := proc(NN::float, MM::float) 
G1 - FS; 
end proc;

NLPSolve(ATS, {cstr8}, bounds, initialpoint = [15.90, 18.90], assume = nonnegative)

Maple Input:
restart; with(RealDomain); log[2](x^2 - 6*x) = 3 + log[2](1 - x); Maple returns as solution
ln\x - 6 x/ ln(1 - x) ------------ = 3 + --------- ln(2) ln(2) "(->)" [[x = 2], [x = -4]]
Is the solution x = 2 correct?

Substituting x=2 into the original Function Maple returns correct: log[2](2^2 - 6*2);

undefined and log[2](1 - 2).; undefined. So x =2 should not be a solution of this function.

y''(x)+2(y'(x))^2+8y(x)=0   

y(0)=0 , y'(0)=1

I take the liberty to rephrase my previous question as I believe the title was not very clear and so maybe some power users did not look at it. I am making the transition from Mathcad towards Maple and get stuck solving the equation in the attached worksheet. In mathcad I would solve it like this:

How can I achieve results in Maple? I know it is a very powerful program but for me the learning curve is at this moment quite steep. Any help would be very much appreciated.

Multiple_input.mw

First of all I would like to wish all of you a happy, prosperous but especially healthy 2023! I have again a beginner question. Why is test2 not working in the attached document?

Thank you so much for your assistance!

QuestionFDS.mw

The transformed boundary conditions are

How should I draw a 2D graph for which one parameter in x axis and 3 parameters in y axis change with respect to x axis parameter in same graph. To be exact in my problem for changing β value (in x axis) what will be the optimum value for p, q and e. I had obtained the optimum p (named as ptemp in file), optimum q (named as qtemp in file), optimum e (named as etemp in file) for different values of β. But I don’t know how to plot it? Whether to give plot command inside the loop or not? Please help me. I am attaching the file with code and a sample graph. ( Find the problem in Numerical analysis - below in file)                                        new_assignment.mw

As a newbie I am still trying to learn Maple. I was wondering whether it is possible to import this txt file 2011068_2_ex.txt which contains results of different measurements separated by a header. I would like to import the data for each measurement without the header and to extract some data from the header. Is this possible in Maple and what should be the best method for doing so? What I would like to obtain at the end is Extracted_from_the_header.txt and raw data for the 4 measurements.

Thank you in advance for all help.

Dill_ABC_Model_PDE_System_Solution.mw

The attached Maple 2019  document attempts to solve a non-linear system of two coupled, time-dependent first-order PDE's, given a list of initial and boundary conditions.  The system models the optical transmittance through a thin photoresist layer whose transmittance changes upon exposure to the incident exposure energy, and hence, the cumulative transmittance through the layer is itself a function of both the exposure time and the distance traveled through the resist layer.  The list of fixed parameters, P, defines the characteristics of a particular photoresist (hereafter "pr") and an assumed exposure irradiance.

My first attempt towards a general solution without initial or boundary conditions (hereafter "ics" & "bcs") apparently "succeeds" (in that no error messages are thrown), however, the form of the solution is quite complicated and difficult (for me at least) to interpret.  I think I understand that the _Cn are undefined constants that require supplying ics & bcs to determine the solutions for the transmitted intensity I(z,t) & the normalized molar fraction of the photo-active component in the pr, M(z,t).  However I do not understand what the symbol _f refers to in the returned solutions.

I make a second attempt to solve the system numerically, supplying a list of the [ics,bcs] as arguments to Pdesolve, however the error message "Error, (in pdsolve/numeric/process_PDEs) PDEs can only contain dependent variables with direct dependence on the independent variables of the problem, got {Iota(0, t), Iota(z, 0), Mu(0, t), Mu(z, 0)}" raises the question of whether I have misunderstood the required syntax in using Pdesolve or that the system as posed is in fact insoluble by Maple.

I would appreciate any insights that readers of this post can contribute, as my experience using Maple and PDesolve in particular must be considered embryonic at best.

Scott Milligan

Hello all,

I am fairly new to Maple and would like to programatically simplify the output form using Maple's pade function on an arbitrary function: Y := 1/(R__s + 1/(s*C__dl + 1/(R__ct + 1/(sqrt(s)/sigma + 1/R__w))))
I found that only Maple's pade function was able to convert my function into a rational expression which is quite interesting.

Now I would like to replicate using maple what was manually done in steps 2 - 4 of the attached solution pdf (which was done by hand).

I was only able to do step 1 (as shown in the attached maple worksheet) after which I got stuck.

kindly assist

restart

with(numapprox)

[chebdeg, chebmult, chebpade, chebsort, chebyshev, confracform, hermite_pade, hornerform, infnorm, laurent, minimax, pade, remez]

(1)

s = I*omega

s = I*omega

(2)

Y := 1/(R__s+1/(s*C__dl+1/(R__ct+1/(sqrt(s)/sigma+1/R__w))))

1/(R__s+1/(s*C__dl+1/(R__ct+1/(s^(1/2)/sigma+1/R__w))))

(3)

padey := pade(Y, x = sqrt(s), [1, 1])

(C__dl*s^(3/2)*R__ct*R__w+C__dl*R__ct*s*sigma+C__dl*R__w*s*sigma+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+C__dl*R__ct*R__s*s*sigma+C__dl*R__s*R__w*s*sigma+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w+R__ct*sigma+R__s*sigma+sigma*R__w)

(4)

collect((C__dl*s^(3/2)*R__ct*R__w+C__dl*R__ct*s*sigma+C__dl*R__w*s*sigma+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+C__dl*R__ct*R__s*s*sigma+C__dl*R__s*R__w*s*sigma+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w+R__ct*sigma+R__s*sigma+sigma*R__w), s)

(C__dl*s^(3/2)*R__ct*R__w+(C__dl*R__ct*sigma+C__dl*R__w*sigma)*s+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+(C__dl*R__ct*R__s*sigma+C__dl*R__s*R__w*sigma)*s+(R__ct*R__w+R__s*R__w)*s^(1/2)+R__ct*sigma+R__s*sigma+sigma*R__w)

(5)

padey2 := collect((C__dl*s^(3/2)*R__ct*R__w+C__dl*R__ct*s*sigma+C__dl*R__w*s*sigma+s^(1/2)*R__w+sigma)/(C__dl*s^(3/2)*R__ct*R__s*R__w+C__dl*R__ct*R__s*s*sigma+C__dl*R__s*R__w*s*sigma+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w+R__ct*sigma+R__s*sigma+sigma*R__w), sigma)

((C__dl*R__ct*s+C__dl*R__w*s+1)*sigma+C__dl*s^(3/2)*R__ct*R__w+s^(1/2)*R__w)/((C__dl*R__ct*R__s*s+C__dl*R__s*R__w*s+R__ct+R__s+R__w)*sigma+C__dl*s^(3/2)*R__ct*R__s*R__w+s^(1/2)*R__ct*R__w+s^(1/2)*R__s*R__w)

(6)

Download maple_attempt.mw

solution.pdf

1 2 3 4 5 6 7 Last Page 3 of 44