## 120 Reputation

15 years, 111 days

## Lagrangian Multipliers, integer solution...

Maple

Hi everyone,

does anyone know how to use the LagrangianMultipliers function so that the solutions obtained will be the closest integer smaller than whatever the output is for each entry in the list.

e.g.

LagrangeMultipliers(x1*x2*x3*x4*x5*x6*x7, [x1+x2+x3+x4+x5+x6+x7-32, x1^2+x2^2+x3^2+x4^2+x5^2+x6^2+x7^2-160],[x1,x2,x3,x4,x5,x6,x7]);

will give us entries which are not integers, and if i use other conditions I will sometimes not receive any integer solutions - which is to be expected.

Any help would be warmly received.

Thanks,

Alex

## Max solution using solve...

Maple

Hi all,

when using solve to solve a simultaneous equation e.g. " solve({6*c+d=24,6*c^2+d^2=96}; " I will obtain two solutions, or with different values maybe even more, I want to put the solutions into an equation e.g." c^6*d" and obtain the maximum value from all the sets of solutions I have.

Any help I will be very grateful, at the moment I am working out by copying and pasting but it will get much harder as the number of solutions increases.

Thanks,

Alex

## Random numbers without repeats...

Maple

I want to generate a set of numbers of fixed size with maple, when I use the rand procedure within a fixed integer range let us say rand(1..2^4) and ask maple to pick 8 integers, maple will pick 8 different integers in the required range.

I would be grateful for any help.

Alex

## runtime...

Maple
I am currently running a procedure that is taking up a lot of time in maple, I do not really need the whole output and would very much like Maple to run just for a set amount of time and output what it has done so far, how would I go about doing that?

## create group from procedure...

Maple
I am working with a procedure and i just want to put the outputted elements into a group, how do i go about doing this e.g. > restart: > P := proc(L::list, V::listlist) > local S,t,x,y; > for S in combinat[powerset]([\$1..nops(L)]) do > if S = {} then next end if; > print(add(L[t],t=S)) > end do > end proc: > with(ListTools): > P([a,b,c],[[1,0,0],[0,1,0],[0,0,1]]); 0 a b a + b c a + c
 1 2 Page 1 of 2
﻿