MaplePrimes Questions

How do I simulate the follow stochastic differential equations. Thanks very much!

dx=x*(5-2*x-3*y-z)dt+5x*dB1(t);

dy=y*(4-*x-5*y-2z)dt+4y*dB2(t);

dz=z*(2-5*x-7*y-2z)dt+2z*dB3(t);

I want to plot the eigenvalues of a 4x4 matrix. I know how to determine the eigenvalues, but how do i plot them? Because i saw that plot only works with real numbers. The result is a column vector. 

Hi dears,

How can I detect two equivalent matrices? Is there any Maple command for this?

Also, Is there any command to verify that two matrices have the same Smith normalform?

Sincerely yours

I would like to return local variable y (line 4 in showstat) in the attached dummy procedure (s1) without manually adding any comment inside the procedure s1. This procedure is a simple one and easy to copy paste/or change. When we have a long procedure, it is difficult to do so. I will always know the name of the local variable I want (say, y) and/or line number in showstat

Thanks

PS, I want to get y:=array(1..,2[(1)=x,2=zz])
 

restart;

s1:=proc(n,x)
local y,xx,i,j,zz::array(1..n,1..n);
for i from 1 to n do for j from 1 to n do zz[i,j]:=x[i]*(1+x[j]^2);od:
od:
y:=array(1..2,[(1)=x, (2)=zz]):
for j from 1 to n do xx[i]:=zz[i,i]/(add(zz[i,j],j=1..n));od:
0;
end proc;

s1 := proc (n, x) local y, xx, i, j, zz::(array(1 .. n, 1 .. n)); for i to n do for j to n do zz[i, j] := x[i]*(1+x[j]^2) end do end do; y := array(1 .. 2, [1 = x, 2 = zz]); for j to n do xx[i] := zz[i, i]/add(zz[i, j], j = 1 .. n) end do; 0 end proc

(1)

showstat(s1);

 

s1 := proc(n, x)

local y, xx, i, j, zz::array(1 .. n,1 .. n);

   1   for i to n do

   2     for j to n do

   3       zz[i,j] := x[i]*(1+x[j]^2)

         end do

       end do;

   4   y := array(1 .. 2,[1 = x, 2 = zz]);

   5   for j to n do

   6     xx[i] := zz[i,i]/add(zz[i,j],j = 1 .. n)

       end do;

   7   0

end proc

 

 

x0:=Vector(2,[1,1]);

x0 := Vector(2, {(1) = 1, (2) = 1})

(2)

s1(2,x0);

0

(3)

 


 

Download showstatexample.mws

Dear All

I am trying to use differential operator two times in sucession but I am not getting desired differentiation. Please see content below:


 

with(PDEtools):

DepVars := [u(x, t), v(x, t), phi(x, t), psi(x, t)]; 1; declare(u(x, t), v(x, t), phi(x, t), psi(x, t))

[u(x, t), v(x, t), phi(x, t), psi(x, t)]

 

u(x, t)*`will now be displayed as`*u

 

v(x, t)*`will now be displayed as`*v

 

phi(x, t)*`will now be displayed as`*phi

 

psi(x, t)*`will now be displayed as`*psi

(1)

_local(I):

I := phi(x, t)*(diff(v(x, t), x)+b*(diff(u(x, t), x, x)))+psi(x, t)*(diff(u(x, t), x, x, x)+d*(diff(v(x, t), x, x)))

phi(x, t)*(diff(v(x, t), x)+b*(diff(diff(u(x, t), x), x)))+psi(x, t)*(diff(diff(diff(u(x, t), x), x), x)+d*(diff(diff(v(x, t), x), x)))

(2)

ToJet(I, DepVars)

phi*(b*u[x, x]+v[x])+psi*(d*v[x, x]+u[x, x, x])

(3)

T[1] := proc (f) options operator, arrow; diff(f, u[x]) end proc; 1; T[2] := proc (f) options operator, arrow; diff(f, u[x, x]) end proc; 1; T[3] := proc (f) options operator, arrow; diff(f, u[x, x, x]) end proc; 1; U[1] := proc (f) options operator, arrow; diff(f, v[x]) end proc; 1; U[2] := proc (f) options operator, arrow; diff(f, v[x, x]) end proc

proc (f) options operator, arrow; diff(f, u[x]) end proc

 

proc (f) options operator, arrow; diff(f, u[x, x]) end proc

 

proc (f) options operator, arrow; diff(f, u[x, x, x]) end proc

 

proc (f) options operator, arrow; diff(f, v[x]) end proc

 

proc (f) options operator, arrow; diff(f, v[x, x]) end proc

(4)

d := proc (f) options operator, arrow; diff(f, x)+u[x]*(diff(f, u))+u[x, x]*(diff(f, u[x]))+u[x, x, x]*(diff(f, u[x, x])) end proc

proc (f) options operator, arrow; diff(f, x)+u[x]*(diff(f, u))+u[x, x]*(diff(f, u[x]))+u[x, x, x]*(diff(f, u[x, x])) end proc

(5)

T[2](I)

0

(6)

Why this is giving zero result ?

If I change Ito jet notation then I get result non zero result like:

T[2](phi*(b*u[x, x]+v[x])+psi*(d*v[x, x]+u[x, x, x]))

phi*b

(7)

d(T[2](phi*(b*u[x, x]+v[x])+psi*(d*v[x, x]+u[x, x, x])))

0

(8)

I was expecting this to be "phi[x]*b, "but instead I am getting zero result.``


 

Download operator_for_differentiation.mw

I'm sorry if this sounds like a noob question. I am trying to make a matrix from a table, something like Gauss-Jordan Elimination tutor.

For example

maplet1 := Maplet([BoxCell(Table([A, B], [[1, 2], [3, 4]]), 'as_needed'), Button("OK", Shutdown())]);

How do I turn it to 2x2 matrix?Any help appreciated

Just came across actually a couple of applications but seem to be missing the mapleHDLS.src library .  Does anyone have it?

required for these digital electronics applications in Maple8
http://www.maplesoft.com/applications/view.aspx?SID=1419&view=html&L=G

http://www.maplesoft.com/applications/view.aspx?SID=1417&view=html&L=F

I don't know if they were just lost or removed.  Google can't find it, so I think unless someone has a copy of it from way back I might be out of luck. 

Does anyone happen to have it?

I am working to minimize an objective function concerning a facility location problem (p-median technique).

Can somebody explain how to formulate the constraint equation that involves  1 or 0?

For instance, the constraint x[i,j]  is an element of {0,1}; namely, x[i,j] = 1 if a point is assigned to a facility located at the point j; 0 otherwise.

Thanks in advance.

 

Hi

I'm trying to add a new element to an array to a position that doesn't exist (length+1). According to the Maple help sheet, automatic resizing should take care of this. Instead I'm getting the error 'Error, invalid left hand side in assignment'. I tried this in a new worksheet. This is the entire code

L:=Array():
L:=(1,2,3,4,5):
L:=(6):
L;

When I run this, it kicks that error and only returns 1,2,3,4,5

When I do this to a 2D array it seems to work which has confused me more!

Thanks for your help

Hi!

I'm currently using Maple 17 and I'm trying to programatically export .eps 3D plots using the following code:

plotsetup(eps, plotoutput = `square_of_x`, plotoptions = `color=rgb , portrait, noborder, height=4in,width=4in, shrinkby=0.1`)

The problem that I'm facing is:

1- The z-axis label is outside of my figure (see uploaded figure). This happens even if I try to save the figure in .png and it seems that the 'shrinkby' option its not working properly;

Could you help me solving this?

Thanks!

 

Hi

I have a set P which is filled with 2D elements e.g.

P:={[1,1],[1,2],[1,3]...}


Later I'm wanting to add a new element e.g. {[1,10]}
At the moment I have

P union {[10, 10]}


If I were to print this I get what I want, but I want to update P.
When I try and do

 P:= P union {[10,10]}

I get an error "Error, illegal use of an object as a name"

What am I doing wrong and how can I solve this? Much appreciated!

I have upload the attachment here. in this problem I want to find the comparison. Please check it and please tell me the correction

 

Ask.mw

AB44.mwAdded these tasks by highlighting object and then choosing
Edit > Create Task

Is there some way to delete a task from my Tasks palette

At some point I created "My second palette" is there a way
to delete individual items from this palette and how are tasks
added to a customized palette.

Any help appreciated, Thanks! Les

AB44.mw

Hello!

Hope everything fine with you. Please check the following program

restart; a := 0; b := 1; Rd := .5; Ra := .2; Nc := .6; e := .2; Nr := .3; H := .9; Digits := 20;
with(LinearAlgebra);
L[0] := 1; L[1] := a+1-x;
M := 4; K := 1;
for n while n <= M do
L[n+1] := expand(-((x-2*n-a-1)*L[n]+(n+a)*L[n-1])/(n+1))
end do; printlevel := 2;
for m from 0 while m < M do
for n to 2^(K-1) do
psi[n, m] := simplify(sqrt(m+1/2.)*2^((1/2)*K)*(eval(L[m], x = 2^K*x-2*n+1)))
end do
end do;
f1 := simplify(sum(sum(c[p, q]*psi[p, q], q = 0 .. M-1), p = 1 .. 2^(K-1)));
u := collect(f1, [x], recursive);

u := -3.5276684147527874541*c[1, 3]*x^3+(4.4721359549995793928*c[1, 2]+21.166010488516724724*c[1, 3])*x^2+(-3.4641016151377545871*c[1, 1]-13.416407864998738178*c[1, 2]-34.394767043839677677*c[1, 3])*x+c[1, 0]+3.4641016151377545871*c[1, 1]+7.8262379212492639373*c[1, 2]+14.992590762699346680*c[1, 3]

f := 1+sum(A[i]*(x^(i+1)-(i+1)*x), i = 1 .. M-2)

f:=1+A[1]*(x^2-2*x)+A[2]*(x^3-3*x)

 

I want to equate the like powers of "x" in f ( mention as red) and u ( mention as red) for any values of M make a system of equations as

Eq[1]:=-3.5276684147527874541*c[1, 3] = A[2];

Eq[2]:=4.4721359549995793928*c[1, 2]+21.166010488516724724*c[1, 3] = A[1];

Eq[3]:=-3.4641016151377545871*c[1, 1]-13.416407864998738178*c[1, 2]-34.394767043839677677*c[1, 3] = -2*A[1]-3*A[2];

Eq[4]:=c[1, 0]+3.4641016151377545871*c[1, 1]+7.8262379212492639373*c[1, 2]+14.992590762699346680*c[1, 3] = 1;

and solve them for any values of A[1] and A[2];

Also attached the program Equate.mw

With my best regards and sincerely.

Muhammad Usman

School of Mathematical Sciences 
Peking University, Beijing, China

For the PDE, I can't seem to plot T' as the y-axis, it gives me the error, "Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct". Anyone knows what seem to be the problem? I am open to all ideas and would appreciate any help:)

fyp3.mw

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