isifesai

30 Reputation

3 Badges

7 years, 32 days

MaplePrimes Activity


These are questions asked by isifesai

Hi everyone, I have problem solving a given optimization problem using the Karush Khun Tucke conditions. The working is as follows:

restart;
with(linalg);
f := 49*x[1]+94*x[2]+90*x[3]+24*x[4]+6*x[5]+63*x[6]+17*x[7]+65*x[8]+72*x[9]+40*x[10]+67*x[11]+99*x[12]+97*x[13]+53*x[14]+22*x[15]+47*x[16]+60*x[17]+36*x[18]+54*x[19]+67*x[20]+46*x[21]+55*x[22]+42*x[23]+70*x[24];
49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

   + 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

   + 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

   + 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

   + 42 x[23] + 70 x[24]
g[1] := x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10]+x[11]+x[12]-475;
  x[1] + x[2] + x[3] + x[4] + x[5] + x[6] + x[7] + x[8] + x[9]

     + x[10] + x[11] + x[12] - 475
g[2] := x[13]+x[14]+x[15]+x[16]+x[17]+x[18]+x[19]+x[20]+x[21]+x[22]+x[23]+x[24]-30;
 x[13] + x[14] + x[15] + x[16] + x[17] + x[18] + x[19] + x[20]

    + x[21] + x[22] + x[23] + x[24] - 30
for i from 3 to 26 do g[i] := -x[i] end do;
h[1] := 54-x[1];
                           54 - x[1]
h[2] := 30-x[2];
                           13 - x[2]
h[3] := 13-x[3];
                           13 - x[3]
h[4] := 41-x[4];
                           41 - x[4]
h[5] := 97-x[5];
                           97 - x[5]
h[6] := 11-x[6];
                           11 - x[6]
h[7] := 62-x[7];
                           62 - x[7]
h[8] := 59-x[8];
                           59 - x[8]
h[9] := 35-x[9];
                           35 - x[9]
h[10] := 42-x[10];
                           42 - x[10]
h[11] := 19-x[11];
                           19 - x[11]
h[12] := 12-x[12];
                           12 - x[12]
vars := [x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]];
[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], 

  x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], 

  x[20], x[21], x[22], x[23], x[24]]
H := Hessian(f, vars);
Hessian(49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

   + 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

   + 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

   + 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

   + 42 x[23] + 70 x[24], [x[1], x[2], x[3], x[4], x[5], x[6], 

  x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], 

  x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]])
grad_f := Del(f, vars);
Del(49 x[1] + 94 x[2] + 90 x[3] + 24 x[4] + 6 x[5] + 63 x[6]

   + 17 x[7] + 65 x[8] + 72 x[9] + 40 x[10] + 67 x[11] + 99 x[12]

   + 97 x[13] + 53 x[14] + 22 x[15] + 47 x[16] + 60 x[17]

   + 36 x[18] + 54 x[19] + 67 x[20] + 46 x[21] + 55 x[22]

   + 42 x[23] + 70 x[24], [x[1], x[2], x[3], x[4], x[5], x[6], 

  x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], 

  x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]])
for i to 26 do grad_g[i] := Del(g[i], vars) end do;
for i to 12 do grad_h[i] := Del(h[i], vars) end do;
eq[1] := grad_f+sum(mu[i]*g[i], i = 13 .. 26)+sum(lambda[i]*h[j], j = 1 .. 12) = 0;
Error, (in sum) summation variable previously assigned, second argument evaluates to 13 = 13 .. 37
eq[2] := g[i] <= 0;
                          -x[13] <= 0
eq[3] := h[j] <= 0;
                           h[j] <= 0
eq[4] := mu[i] >= 0;
                          0 <= mu[13]
eq[5] := lambda[j] <= 0;
                         lambda[j] <= 0
eq[6] := mu[i]*g[i] = 0;
                       -mu[13] x[13] = 0
eval(solve({eq[1], eq[2], eq[3], eq[4], eq[5], eq[6]}, [vars, lambda[j], mu[i]]));
Error, invalid input: too many and/or wrong type of arguments passed to solve; first unused argument is [[x[1], x[2], x[3], x[4], x[5], x[6], x[7], x[8], x[9], x[10], x[11], x[12], x[13], x[14], x[15], x[16], x[17], x[18], x[19], x[20], x[21], x[22], x[23], x[24]], lambda[j], mu[13]]
 

Dear all, I am having difficuty in executing the following program. the error message reads "Error, unable to compute coeff". Secondly the solution and the graph of the equation could not display.Attached is the prime_question.mw
 

 

Download prime_question.mw
 

restart; with(student)

n := 2;

2

(1)

v := sum(u[i]*p^i, i = 0 .. 2);

p^2*u[2]+p*u[1]+u[0]

(2)

f := proc (x) options operator, arrow; e^x+(1/2)*x*(e^(2*x)-1) end proc;

proc (x) options operator, arrow; e^x+(1/2)*x*(e^(2*x)-1) end proc

(3)

k := proc (x, t) options operator, arrow; x end proc;

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

(4)

F := proc (u) options operator, arrow; u(x)^2 end proc;

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

(5)

u[0] := f(t);

e^t+(1/2)*t*(e^(2*t)-1)

(6)

for i to 2 do u[i] := expand(subs(x = t, int(coeff(p*k(x, t)*F(v), p^i), t = 0 .. x))) end do

Error, unable to compute coeff

 

s := value(sum(Eu[k], k = 0 .. 2*e));

sum(Eu[k], k = 0 .. 2*e)

(7)

U := proc (x) options operator, arrow; collect(s, x) end proc;

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

(8)

with*plots:

p1 := plot*(exact*solution, t = 0 .. T, style = point):

p2 := plot*(U(t), t = 0 .. T, style = line):

plots*([display])(p1, p2);

plots*[display(plot*(exact*solution, t = 0 .. T, style = point), plot*(sum(Eu[k], k = 0 .. 2*e), t = 0 .. T, style = line))]

(9)

``

``


 

Download prime_question.mw

 

 

file

Good day all, I have a yet challanging integration problem. The problem is to find the numerical solution of the problem:
Eq1 := x(t) = x(b)+c*t+k*x(b)*t-k*(int((t-s)*x(s), s = 0 .. t))+2*(int(sqrt(t-s)*x(s)^3, s = 0 .. t))/sqrt(Pi)

I differentiated Eq1 wrt x as follows:Eq2 := diff(Eq1, t)

Lastly, on typing sol := dsolve({Eq2, x(0) = x(b)}, x(t), numeric)

I got an error messag. Please all the valuable suggestions given to me on a similar problem could not solve this one as this appears to be a little complex when compared to my previous question. Please I need your help. Thanks

 

 

Dear all, I had a challenge of using maple to obtain numerical solution of a volterra-integral equation using the method of reproducing kernel space, however I converted the integral equation to an ode and try to solve it numerically but obtatined an error message. Please how do I overcome it? the problem is as follows:

dsn := dsolve({diff(u(x), x) = e^x*ln(e)+(2/9)*e^3-1/9+int(y*u(y)^3, y = 0 .. 1), u(0) = 1}, numeric)

I have a problem writing a program for the numerical solution of nonlinear volterra integral equation using the method of reproducing kernel space. I have my algorithm as well as the program I tried to write, though they are full of error messages. Please could anyone give me a clue on how to go about my challenges. The algorithm is as follows:

Step 1. Fix π‘Ž ≤ π‘₯ and 𝑑 ≤ 𝑏.
If 𝑑 ≤ π‘₯, set 𝑅π‘₯(𝑑) = 1 − π‘Ž + 𝑑.
Else set 𝑅π‘₯(𝑑) = 1 − π‘Ž + π‘₯.
Step 2. For 𝑖 = 1, 2, . . . , π‘š set π‘₯i = (𝑖 − 1)/(π‘š − 1).

Set πœ“i(π‘₯) = 𝐿t𝑅π‘₯(𝑑)|𝑑=π‘₯i .
Step 3. Set 𝑒0(π‘₯1) = 𝑒(π‘₯1).
Step 4. For 𝑖 = 1, 2, . . . , π‘š set 𝛾ij = [πœ“-1]ij.
Step 5. 𝑛 = 1.
Step 6. Set Sn = Σ𝑛
π‘˜=1 𝛾nk𝑒k-1(π‘₯k).
Step 7. Set 𝑒n(π‘₯) = Σ𝑛
𝑖=1 Siπœ“i(π‘₯).
Step 8. If 𝑛 < π‘šthen set 𝑛 = 𝑛 + 1 and go to step 6.
Else stop.

Page 1 of 1
ο»Ώ