Maple 2019 Questions and Posts

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

How to find KKT conditions using maple for maximization function with constraint?

Decision variable are k1 and k2.

Attaching sheet:Q_KKT.mw

Loop is not executing all values just considerinng 1st value of tau0 =0.3.

Also how to plot a 2D graph from the loop result

Attaching sheet with questions in the sheet:
for_loop_question_rec.mw

The attached sheet contains equations H1 to H6 and K1 to K3. What data do I need to modify to ensure that the values of H1 to H6 fall between 0 and 1, and K1 to K3 are negative? The parameter ranges are also given in the sheet. Is there a method to achieve this?

rouhg.mw

How to use for loop in the optimization function? The objective function contain piecewise function, in that case what to do?
Can anyone help me with the syntax? I am attaching the sheet below:
Question_loop.mw

I'm encountering an error in the optimization process when adding constraints C1 and C2. I've attached the sheet for reference. 

Q4.mw
To obtain a graph similar to the one below, which parameters in the data should I adjust? As you can see in the attached sheet, the graph is concave with respect to tau1 but not tau2. What changes should I make to ensure the graph is also concave with respect to tau2?

Dummy graph:-

I am attaching a sheet where i found error in the optimization function. Its not considering constrain C3 and C5 . Can anyone help?
N_7.mw

Also in the plot the tau1 value remain same for the optimal lambda. What parameter in the model can be changed in DATA so that i get dome like structure? 

I am attaching the sheet, I want to solve for w or find range of w. 
q1.mw

I can't isolate a variable from the constraint and move it to one side of the inequality. For example, it's like having theta <= all other terms. I've tried using the isolate and eval functions, but they aren't producing any results or simplifying the expression. What am I doing wrong?

Attaching sheet below (issue marked yellow in background): N_1.mw 

Can anyone helps me with my optimization Problem.  Following are the issues :-

  • I have to minimize the function TRC, i am unable to do. 
  • I am unable to add a constraint with if statement. 
  • Check whether i have represented I1 and I2 with respect to alpha and beta right or wrong

Attaching the sheet below, the background marked in yellow is the problem area. Thankyou

Basic_model.mw

Hello Everyone;

I need to find the bifurcation point and further bifarcation diagram for the given model. But facing error. Can anybody help to do this? Can you refer some library for bifurcation analysis of ODE's? Code is attched. Thanks in Advance. 

123.mw

 

 

 

 

restart

C_m := 1.0; g_K := 36.0; I_inj := 0; g_L := .3; E_Na := 50.0; E_K := -77.0; E_L := -54.4

alpha_m := (.1*(V-25.0))/(1-exp(-(V-25.0)*(1/10))); beta_m := 4*exp(-V/(18.0)); alpha_h := 0.7e-1*exp(-V/(20.0)); beta_h := 1/(1+exp(-(V-30)*(1/10))); alpha_n := (0.1e-1*(V-10.0))/(1-exp(-(V-10.0)/(10.0))); beta_n := .125*exp(-V/(80.0)); I_Na := g_Na*m^3*h*(V-E_Na); I_K := g_K*n^4*(V-E_K); I_L := g_L*(V-E_L)

.125*exp(-0.1250000000e-1*V)

(1.1)

eq1 := (I_inj-I_Na-I_K-I_L)/C_m; m := alpha_m/(alpha_m+beta_m); n := alpha_n/(alpha_n+beta_n); h := alpha_h/(alpha_h+beta_h)

-16.32000000-1.000000000*g_Na*m^3*h*(V-50.0)-36.00000000*n^4*(V+77.0)-.3000000000*V

 

.1*(V-25.0)/((1-exp(-(1/10)*V+2.500000000))*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V)))

 

0.1e-1*(V-10.0)/((1-exp(-.1000000000*V+1.000000000))*(0.1e-1*(V-10.0)/(1-exp(-.1000000000*V+1.000000000))+.125*exp(-0.1250000000e-1*V)))

 

0.7e-1*exp(-0.5000000000e-1*V)/(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3)))

(1.2)

bif_eq1 := eq1 = 0;

-16.32000000-0.7000000000e-4*g_Na*(V-25.0)^3*exp(-0.5000000000e-1*V)*(V-50.0)/((1-exp(-(1/10)*V+2.500000000))^3*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^3*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3))))-0.3600000000e-6*(V-10.0)^4*(V+77.0)/((1-exp(-.1000000000*V+1.000000000))^4*(0.1e-1*(V-10.0)/(1-exp(-.1000000000*V+1.000000000))+.125*exp(-0.1250000000e-1*V))^4)-.3000000000*V = 0

bif_eq2 := diff( eq1, V) = 0;

-0.2100000000e-3*g_Na*(V-25.0)^2*exp(-0.5000000000e-1*V)*(V-50.0)/((1-exp(-(1/10)*V+2.500000000))^3*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^3*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3))))+0.2100000000e-4*g_Na*(V-25.0)^3*exp(-0.5000000000e-1*V)*(V-50.0)*exp(-(1/10)*V+2.500000000)/((1-exp(-(1/10)*V+2.500000000))^4*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^3*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3))))+0.2100000000e-3*g_Na*(V-25.0)^3*exp(-0.5000000000e-1*V)*(V-50.0)*(.1/(1-exp(-(1/10)*V+2.500000000))-0.1000000000e-1*(V-25.0)*exp(-(1/10)*V+2.500000000)/(1-exp(-(1/10)*V+2.500000000))^2-.2222222222*exp(-0.5555555556e-1*V))/((1-exp(-(1/10)*V+2.500000000))^3*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^4*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3))))+0.3500000000e-5*g_Na*(V-25.0)^3*exp(-0.5000000000e-1*V)*(V-50.0)/((1-exp(-(1/10)*V+2.500000000))^3*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^3*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3))))+0.7000000000e-4*g_Na*(V-25.0)^3*exp(-0.5000000000e-1*V)*(V-50.0)*(-0.3500000000e-2*exp(-0.5000000000e-1*V)+(1/10)*exp(-(1/10)*V+3)/(1+exp(-(1/10)*V+3))^2)/((1-exp(-(1/10)*V+2.500000000))^3*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^3*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3)))^2)-0.7000000000e-4*g_Na*(V-25.0)^3*exp(-0.5000000000e-1*V)/((1-exp(-(1/10)*V+2.500000000))^3*(.1*(V-25.0)/(1-exp(-(1/10)*V+2.500000000))+4*exp(-0.5555555556e-1*V))^3*(0.7e-1*exp(-0.5000000000e-1*V)+1/(1+exp(-(1/10)*V+3))))-0.1440000000e-5*(V-10.0)^3*(V+77.0)/((1-exp(-.1000000000*V+1.000000000))^4*(0.1e-1*(V-10.0)/(1-exp(-.1000000000*V+1.000000000))+.125*exp(-0.1250000000e-1*V))^4)+0.1440000000e-6*(V-10.0)^4*(V+77.0)*exp(-.1000000000*V+1.000000000)/((1-exp(-.1000000000*V+1.000000000))^5*(0.1e-1*(V-10.0)/(1-exp(-.1000000000*V+1.000000000))+.125*exp(-0.1250000000e-1*V))^4)+0.1440000000e-5*(V-10.0)^4*(V+77.0)*(0.1e-1/(1-exp(-.1000000000*V+1.000000000))-0.1000000000e-2*(V-10.0)*exp(-.1000000000*V+1.000000000)/(1-exp(-.1000000000*V+1.000000000))^2-0.1562500000e-2*exp(-0.1250000000e-1*V))/((1-exp(-.1000000000*V+1.000000000))^4*(0.1e-1*(V-10.0)/(1-exp(-.1000000000*V+1.000000000))+.125*exp(-0.1250000000e-1*V))^5)-0.3600000000e-6*(V-10.0)^4/((1-exp(-.1000000000*V+1.000000000))^4*(0.1e-1*(V-10.0)/(1-exp(-.1000000000*V+1.000000000))+.125*exp(-0.1250000000e-1*V))^4)-.3000000000 = 0

 

 

 

bif_sol := solve({ bif_eq1,bif_eq2}, {V, g_Na});

Warning, solutions may have been lost

 

 

as the solutions, which are then expressed as the points mu, y via

   

[Back to ODE Powertool Table of Contents]

 

 

Hi, I have an homework where I need to find the highest point and the lowest point on an ellipse form by the intersection of two equations wich are 4x-3y+8z=5 and z^2=x^2+y^2 and I have to use the LagrangeMultiplier command. I get how it works but I can't get the correct form. How should I do it ? 

Hello everyone,

I'm trying to symbolically diagonalize a 5x5 matrix in Maple. I can determine the eigenvalues for my matrix, but when it comes to evaluating the eigenvectors, Maple gives me the following results:

eigenvalues(A): -a + u, a + u, u, u, u

eigenvectors(A): [a + u, 1, {r}], [-a + u, 1, {r}], [u, 5, {r, r, r, r, r}]

I don't understand why I'm getting {r} in the eigenvectors. How can I display the eigenvectors for my matrix A?

Thank you in advance for your answers !

5x5

 

restartNULL

with(linalg)

[BlockDiagonal, GramSchmidt, JordanBlock, LUdecomp, QRdecomp, Wronskian, addcol, addrow, adj, adjoint, angle, augment, backsub, band, basis, bezout, blockmatrix, charmat, charpoly, cholesky, col, coldim, colspace, colspan, companion, concat, cond, copyinto, crossprod, curl, definite, delcols, delrows, det, diag, diverge, dotprod, eigenvals, eigenvalues, eigenvectors, eigenvects, entermatrix, equal, exponential, extend, ffgausselim, fibonacci, forwardsub, frobenius, gausselim, gaussjord, geneqns, genmatrix, grad, hadamard, hermite, hessian, hilbert, htranspose, ihermite, indexfunc, innerprod, intbasis, inverse, ismith, issimilar, iszero, jacobian, jordan, kernel, laplacian, leastsqrs, linsolve, matadd, matrix, minor, minpoly, mulcol, mulrow, multiply, norm, normalize, nullspace, orthog, permanent, pivot, potential, randmatrix, randvector, rank, ratform, row, rowdim, rowspace, rowspan, rref, scalarmul, singularvals, smith, stackmatrix, submatrix, subvector, sumbasis, swapcol, swaprow, sylvester, toeplitz, trace, transpose, vandermonde, vecpotent, vectdim, vector, wronskian]

(1.1)

A := Matrix([[0, 1, 0, 0, 0], [(gamma-1)*H-u^2-a^2, (3-gamma)*u, -(gamma-1)*v, -(gamma-1)*w, gamma-1], [-u*v, v, u, 0, 0], [-u*w, w, 0, u, 0], [u*((gamma-2)*H-a^2), H-(gamma-1)*u^2, -(gamma-1)*u*v, -(gamma-1)*u*w, gamma*u]])

Matrix(%id = 18446746202416421574)

(1.2)

eigenvalues(A)

u+(-gamma*u^2-gamma*v^2-gamma*w^2+2*H*gamma-a^2+u^2+v^2+w^2-2*H)^(1/2), u-(-gamma*u^2-gamma*v^2-gamma*w^2+2*H*gamma-a^2+u^2+v^2+w^2-2*H)^(1/2), u, u, u

(1.3)

V := sqrt(u^2+v^2+w^2)

(u^2+v^2+w^2)^(1/2)

(1.4)

H := (1/2)*V^2+a^2/(gamma-1)

(1/2)*u^2+(1/2)*v^2+(1/2)*w^2+a^2/(gamma-1)

(1.5)

eigenvalues(A)

-a+u, a+u, u, u, u

(1.6)

eigenvectors(A)

[-a+u, 1, {r}], [a+u, 1, {r}], [u, 3, {r, r, r}]

(1.7)

``

Download maps.mw

Please help me check why my minmax optimization is not having these errors:

Error, (in minimize/cell/function/multidependence/univariate) 

Error, n should be an integer for integer[n]
Error, (in minimize/cell/function/multidependence/univariate) invalid input: `minimize/continuous` expects its 2nd argument, yFP, to be of type {name, list(name)}, but received `X[4,3]` = -infinity

Error, invalid input: `convert/Array` expects its 1st argument, A, to be of type {Array, Matrix, Vector, array, sequential}, but received 0

my design optimization objective function is to carry out a minimize the maximum assignments from vector B overlap  between any two members in A , such that in vector A all members fall under a group and there is no duplication of membership, further   a member from each group representing the group  is to be assigned to vector B such that only one member of a group should be assigned each member of vector B, while ensuring that every member in vector B has represntation from every group in vector A. 

with(Optimization); num_profiles := 4; num_websites := 3; num_groups := 2; X := Array(1 .. num_profiles, 1 .. num_websites, datatype = integer[0 .. 1]); obj := minimize(max(seq(add(X[i, j], j = 1 .. num_websites), i = 1 .. num_profiles))); constraints := {seq(add(add(X[i, j], i = k*num_profiles/num_groups+1 .. (k+1)*num_profiles/num_groups), k = 0 .. num_groups-1) = 1, j = 1 .. num_websites)}; sol := Optimization[Minimize](obj, constraints, assume = binary); optimal_assignment := convert(sol[1], Array); for i to num_profiles do for j to num_websites do if optimal_assignment[i, j] = 1 then print("Profile ", i, " assigned to Website ", j) end if end do end do; print("Objective Value (Minimized Maximum Website Overlap): ", sol[2])

"Objective Value (Minimized Maximum Website Overlap): ", [obj = 0, X[1, 1] = 0, X[1, 2] = 0, X[1, 3] = 0, X[2, 1] = 0, X[2, 2] = 0, X[2, 3] = 1, X[3, 1] = 1, X[3, 2] = 1, X[3, 3] = 0, X[4, 1] = 0, X[4, 2] = 0, X[4, 3] = 0]

(1)

``

Download firstworkablecode.mw

Sorry if this is already known, but I haven't found the proper function call.

I just want to "print" this expression without evaluating the boolean calls

restart;
P(X <= 5) = P(-5 <= -X) = P(E(X) - 5 <= E(X) - X);

As it stands, this will evaluate to "false" which I obviously don't want.

I just want to use it as a displayer.

Hi, I'm trying to solve these 2 nonlinear equations in f, g, and x, where x is from 0 to 1 with an increment of 0.1.

I am new to Maple and do not know the basics. Please try and help me. I'd highly appreciate it.

Since this is a nonlinear system, multiple solutions exist, I need to find the first 3 or 5 solutions. Once I solve the system, I would like to plot 2 plots, y-x and z-x.

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