Items tagged with algebra algebra Tagged Items Feed

Hi all 

I have the following segment of maple program which belongs to time delay systems dynamic. here C=X-X0-G.Z-X.Dtau.P+X.Dtau.Z-U.P, is a matrix(vector) which comes from reordering the system terms and my goal is to minimizing J:=X.E.Transpose(X)+U.E.Transpose(U), subject to constraint C=0, but i don't know how to do so.

I will be so grateful if anyone can guide me

best wishes

Mahmood   Dadkhah

Ph.D Candidate

Applied Mathematics Department


restart:
with(Optimization):
with(LinearAlgebra):
macro(LA= LinearAlgebra):
L:=1:  r:=2:  tau:= 1:
interface(rtablesize= 2*r+1):

Z:= Matrix(
     2*r+1, 2*r+1,
     [tau,
      seq(evalf((L/(2*(iz-1)*Pi))*sin(2*(iz-1)*Pi*tau/L)), iz= 2..r+1),
      seq(evalf((L/(2*(iz-1-r)*Pi))*(1-cos(2*(iz-1-r)*Pi*tau/L))), iz= r+2..2*r+1)
      ],
     scan= columns,
     datatype= float[8]
);
                        
Dtau00:= < 1 >:
Dtau01:= Vector[row](r):
Dtau02:= Vector[row](r):
Dtau10:= Vector(r):
Dtau20:= Vector(r):

Dtau1:= LA:-DiagonalMatrix([seq(evalf(cos(2*i*Pi*tau/L)), i= 1..r)]):
Dtau2:= LA:-DiagonalMatrix([seq(evalf(sin(2*i*Pi*tau/L)), i= 1..r)]):
Dtau3:= -Dtau2:
Dtau4:= copy(Dtau1):

Dtau:= < < Dtau00 | Dtau01 | Dtau02 >,
         < Dtau10 | Dtau1  | Dtau2  >,
         < Dtau20 | Dtau3  | Dtau4  > >;
 
P00:= < L/2 >:
P01:= Vector[row](r):
P02:= Vector[row](r, j-> evalf(-L/j/Pi), datatype= float[8]):
P10:= Vector(r):
P20:= Vector(r, i-> evalf(L/2/i/Pi)):
P1:= Matrix(r,r):
P2:= LA:-DiagonalMatrix(P20):
P3:= LA:-DiagonalMatrix(-P20):
P4:= Matrix(r,r):

P:= < < P00 | P01 | P02 >,
      < P10 | P1  | P2  >,
      < P20 | P3  | P4  > >;

interface(rtablesize=2*r+1):    # optionally
J:=Vector([L, L/2 $ 2*r]):      # Matrix([[...]]) would also work here

E:=DiagonalMatrix(J);

X:=  Vector[row](2*r+1,symbol=a);
U:=Vector[row](2*r+1,symbol=b);

X0:= Vector[row](2*r+1,[1]);
G:=Vector[row](2*r+1,[1]);
C:=simplify(X-X0-G.Z-X.Dtau.P+X.Dtau.Z-U.P);

Z := Matrix(5, 5, {(1, 1) = 1., (1, 2) = 0., (1, 3) = 0., (1, 4) = 0., (1, 5) = 0., (2, 1) = 0., (2, 2) = 0., (2, 3) = 0., (2, 4) = 0., (2, 5) = 0., (3, 1) = 0., (3, 2) = 0., (3, 3) = 0., (3, 4) = 0., (3, 5) = 0., (4, 1) = 0., (4, 2) = 0., (4, 3) = 0., (4, 4) = 0., (4, 5) = 0., (5, 1) = 0., (5, 2) = 0., (5, 3) = 0., (5, 4) = 0., (5, 5) = 0.})

Dtau := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1., (2, 3) = 0, (2, 4) = 0., (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1., (3, 4) = 0, (3, 5) = 0., (4, 1) = 0, (4, 2) = -0., (4, 3) = -0., (4, 4) = 1., (4, 5) = 0, (5, 1) = 0, (5, 2) = -0., (5, 3) = -0., (5, 4) = 0, (5, 5) = 1.})

P := Matrix(5, 5, {(1, 1) = 1/2, (1, 2) = 0, (1, 3) = 0, (1, 4) = -.318309886100000, (1, 5) = -.159154943000000, (2, 1) = 0, (2, 2) = 0, (2, 3) = 0, (2, 4) = .1591549430, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 0, (3, 4) = 0, (3, 5) = 0.7957747152e-1, (4, 1) = .1591549430, (4, 2) = -.159154943000000, (4, 3) = 0, (4, 4) = 0, (4, 5) = 0, (5, 1) = 0.7957747152e-1, (5, 2) = 0, (5, 3) = -0.795774715200000e-1, (5, 4) = 0, (5, 5) = 0})

E := Matrix(5, 5, {(1, 1) = 1, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (1, 5) = 0, (2, 1) = 0, (2, 2) = 1/2, (2, 3) = 0, (2, 4) = 0, (2, 5) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 1/2, (3, 4) = 0, (3, 5) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 1/2, (4, 5) = 0, (5, 1) = 0, (5, 2) = 0, (5, 3) = 0, (5, 4) = 0, (5, 5) = 1/2})

X := Vector[row](5, {(1) = a[1], (2) = a[2], (3) = a[3], (4) = a[4], (5) = a[5]})

U := Vector[row](5, {(1) = b[1], (2) = b[2], (3) = b[3], (4) = b[4], (5) = b[5]})

X0 := Vector[row](5, {(1) = 1, (2) = 0, (3) = 0, (4) = 0, (5) = 0})

G := Vector[row](5, {(1) = 1, (2) = 0, (3) = 0, (4) = 0, (5) = 0})

C := Vector[row](5, {(1) = 1.500000000*a[1]-2.-.1591549430*a[4]-0.7957747152e-1*a[5]-.5000000000*b[1]-.1591549430*b[4]-0.7957747152e-1*b[5], (2) = a[2]+.1591549430*a[4]+.1591549430*b[4], (3) = a[3]+0.7957747152e-1*a[5]+0.7957747152e-1*b[5], (4) = a[4]+.3183098861*a[1]-.1591549430*a[2]+.3183098861*b[1]-.1591549430*b[2], (5) = a[5]+.1591549430*a[1]-0.7957747152e-1*a[3]+.1591549430*b[1]-0.7957747152e-1*b[3]})

(1)

J:=X.E.Transpose(X)+U.E.Transpose(U);

J := a[1]^2+(1/2)*(a[2]^2)+(1/2)*(a[3]^2)+(1/2)*(a[4]^2)+(1/2)*(a[5]^2)+b[1]^2+(1/2)*(b[2]^2)+(1/2)*(b[3]^2)+(1/2)*(b[4]^2)+(1/2)*(b[5]^2)

(2)

Minimize(J,{C=0});






Error, (in Optimization:-NLPSolve) invalid arguments

 

#XP:=-.015+X[1]+add(X[l+1]*f1(l)+X[r+l+1]*f2(l), l= 1..r):
#plot([XP,T1], t= 0..1);#,legend= "Solution Of x(t) with r=50"):

 

 

 

 

 

 

Download work1.mwswork1.mws

I was required to purchase Maple 17 for my upcoming Calculus III course, and until now, I have been using my TI-Nspire CAS CX for all of my CAS needs.  I am going through various tutorials/labs in an effort to learn how to use the Maple 17 Software. As a part of this process, I am attempting to solve a system of equations and was told to use the following command:

>solve({2*x+3*y=7,5*x+8*y=9},{x,y}); 

in order to receive the answer 

{y=-17,x=29}.

 

Instead, I have received the following error message, which has no help attached to it through the help page.

solve({2*x+3*y = 7, 5*x+8*y = 9}, {x, y});
Warning, solving for expressions other than names or functions is not recommended.

I am hoping this has something to do with Mac vs. Windows software, and that it has a simple solution.  I would greatly appreciate any guidance!

The result of the following lines in Maple is V := [5., 3.,5. 11., 6.] that I think should be V := [5., 3.,5. 0., 6.], is there somthing wrong?

 

v1:= Vector([-28., -63., -17., -55., 17.], datatype= float[8]):

V:= LinearAlgebra:-Modular:-Mod(11, v1, float[8]);

bug.mw



Hi,

I'm currently writing a programme for synchronising automatas, its creates an array and adds words or matrices to the array that aren't already in. I am currently getting an error when i try and run my procedure though and i'm unsure of the problem, any help would be appreciated, here is my code so far.

Thanks!

proc_cerny1:=proc(A::Matrix,B::Matrix,C::Vector[row],N)
local x, S, i, j, T, R, y, found;
x:=2^N;
S:=Array(0..(x-1));
S[0]:=C;
i:=0;
j:=1;
found:=false;

while (i<(x-1) and i<>j) do
T:=S[i].A;
for y from 0 to j do
if LinearAlgebra:-Equal(S[y],T) then
found:=true;
if (found=false) then
S[j]:=T;
j:=j+1;
end if:
end if:
od:

R:=S[i].B;
for y from 0 to j do
if LinearAlgebra:-Equal(S[y],T) then
found:=true;
if (found=false) then
S[j]:=R;
j:=j+1;
i:=i+1;

end if:
end if:
od:
od:
print(S);
end proc:

 

The error i'm getting is when i input this:

proc_cerny1(Matrix([[1,0,0],[1,0,0],[1,0,0]]),Matrix([[0,1,0],[0,0,1],[0,0,1]]),Vector(1..3,1,orientation=row),3);

and the error is:

Error, (in LinearAlgebra:-Equal) invalid input: LinearAlgebra:-Equal expects its 1st argument, X, to be of type {Matrix, Vector} but received 0

 

f := x1^2/((x2^3)*(x3^2));

would like to extract 1/x2 from 1/(x2^3) and 1/x3 from 1/(x3^2)

and then assign 1/x2 to x2b and assign 1/x3 to x3b

and then replace 1/(x2^3) with x2b^3 and 1/(x3^2) with x3b^2 in f

 

only in this example has x2 and x3, in real case, it is unknown how many variables all division part

how to automatically to do above for equations with division

 

ifactor(op(1, convert(0.999987406876435, fraction)));
ifactor(op(2, convert(0.999987406876435, fraction)));

ifactor(op(1, convert(0.999919848203811, fraction)));
ifactor(op(2, convert(0.999919848203811, fraction)));

x1:=2;
x2:=3;
x3:=7;
x4:=17;
x5:=173;
x6:=709;
x7:=5347;
x8:=18713;

i think that there is a need to distinct all factor into a list of x1,x2,x3.... depending on all factors in these two decimal

0.999987406876435 = x4*x2^3*x5/(x3*x1^4*x6)
0.999919848203811 = x1*x8/(x3*x7);

then replace factors with x1,x2,x3....

Hi MaplePrimers,

I'm trying to solve a system of algebraic equations using 'solve' [float].  I'd prefer to use 'solve' over 'fsolve', as 'solve' solves my system in about 0.05s, whereas fsolve takes about 5 seconds.  I need to solve the system repeatedly at a different points, so time is important.  I don't know why there is such a large difference in time ... 

I have a few piecewise functions of order 3 to 5.  It solves fine with the other (piecewise) equations, but adding one piecewise function which gives me an error while trying to solve:

Error, (in RootOf) _Z occurs but is not the dependent variable.

I think this is due to solve finding multiple solutions.  Is there a way to limit solve to only real solutions?

Thanks in advance!

Hello,
my question may be simple but I don't find the answer in any help guide.
when I define a function I cannot use a linearalgebra expression such as Trace.
Here is an example of what I would like to do:




If anyone can help me...
Thank you

I have been struggling (reading Ore/Weyl Algebra documentation) to understand how to input a PDE system with polynomial coeff. in Weyl algebra notation so I can compute a Groebner basis for it. I would be very grateful if someone could  show, using the simple example below, which differential operators in Ore_algebra[diff_algebra] should one declare to express the system in Weyl algebra notation. The systems I'm working are more complicated but all have many dependent variables, f and g functions in this example:

pdesys:= [ x*diff( f(x,y,z),x)- z*diff( g(x,y,z),y) = 0, (x^2-y)*diff( f(x,y,z),z)- y*diff( g(x,y,z),z) = 0 ]

Hi,

I have a Matrix whose entries are polynomials in several formal parameters (the matrix is sparse and the polynomials are rather simple, though inverses of the parameters may also arise).
Then, when I compute the kernel with LinearAlgebra-NullSpace, maple naturally gives a basis of solutions over the same ring of polynomials.

Now for some reason there are some parameters that I don't want to see in the solutions (all but two of them, actually).

How can I compute the part of the kernel that lives in $\mathbb{Z}[a,a^{-1}, b,b^{-1}]$, i.e. that involves only the first two parameters?

Thank you,

NoThik

Edit : the coefficients of the polynomials are integers, and I expect the kernel elements to have integer coefficients as well.

4(x-7) =6

 

(2x+3)(2x2-5x-3)=0

La aplicacion de las matrices en su más claro ejemplo, dirigido explicitamente a la criptografia; solo hay que tener conocimiento de algebra de matrices y calculo de matriz inversa. (versión español).

The application of the matrices in its most obvious example, explicitly directed to cryptography; just have to have knowledge of matrix algebra and inverse matrix calculation. (version english).

 

Criptografia.mw

 

Lenin Araujo Castillo

Physics Pure

Computer Science

Creating Sliders...

November 03 2013 nicholasfbennett 30

I am coming back to maple after being years out of it (Maple 9). I am writing a paper in class of how to use Maple with Algebra. I would like to create a document so that students can manipulate the graph of a(x-h)^2+k and se how parameters a, h and k effect the function.  However, I can't seem to figure out how to create a slider linked with each parameter so students can manipulate it. 

 

Is this possible? Any help wold be great!

 

Nicholas

  1.   The formula to calculate a length of rafter may be given as

Length of rafter = √ (rise)squared + (run)squared            

      (The whole of the RHS has been square rooted but cant type that symbol)

Transpose this equation and express in terms of the rise. Describe each stage so as to clearly identify what you have done.  Using this new equation calculate the rise if the length of the rafter is 7m and the run is 6. Write your answer to 3 s.f. 

 

 

If anyone has any ideas or could help it would be really appreciated. Thanks. 

 

(i)develop an algorithm for computing f¡ÊF[x,y],F a field,where the degree of f in y is less than n and and f(x,ui)=vi; for i=0,1......,n-1, for distinct ui∈F,and arbitrary Vi∈F[x].showthat f is unique.

(ii) assuming that the degree of each Vi is less than m, what is the computing time of your algorithm (in term of m and n)?

(iii) computer f∈ F[11][x,y]such thatf(x,0)=x^2+7,f(x,1)=x^3+2*x+3,f(x,2)=x^3+5.

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