Items tagged with seq seq Tagged Items Feed

Hi everyone,

 

Working on my project, I have this error "Error, (in VectorCalculus:--) too many levels of recursion".

The project is about filetring a stochastic process.

 

When I want to calculate one of the integrals, I have that error.

Here is the code:

 

Rxi:=sqrt(d)*IdentityMatrix(4):
xi:=WienerProcess(Rxi);
Reta:=sqrt(d)*IdentityMatrix(2):
eta:=Array([WienerProcess(Reta...

Hi,

See the code mli.mws

What is the mistake in this command ?

chfonc:=cat('piecewise(' , seq(cat(convert(t<lf[k],string) , ' , 1 , ' ,convert(t<lf[k],string), ' , 1 , ' ) , k=1..p) , '1) ') :

assigning values

March 23 2012 by Ronan 5 Maple

I have these as outputs from comparing the coefficients. How do i assign the g2xyz totheir associated numbers.


eg at present g2000 is g2000. I need it to be 1.2e7. And so on down the list.

Hi, I have a vector with 33 points ####[33x1]Matrix### for example : [43.6, 764,3.85,32.7 .........n]

Each point is at the plotted on the x axis of theha:Matrix([seq((Pi/32)*n,n=0..32)])^%T:   ####another[33x1]Matrix#####

How do I plot first point (0,43.6), second point (Pi/32,764), third point (2Pi/32,3.85) etc...

Please help. Thank you.

Hi, I have 2 sets of data:

P := array([1.23, 1.15, 1.10, 1.20, 1.35, 1.25, 1.28, .99, 1.22, 1.25, 1.30, 1.05]);
Q := array([892, 1012, 1060, 987, 680, 739, 809, 1275, 946, 874, 720, 1096]);
p=P(t), q=Q(t) i.e. both p & q are a function of parameter t  t=1..12
 
2 functions: 
x=ln(p)
y=ln(q)
I'm trying to display x against y , ie x=ln(p) on the horizontal axis, y=ln(q) on the vertical

I'm trying to substitute a list of equations into an expression as so:

 

V:=ReSeq([seq(seq(u(t)^r*v(t)^s=y(r,s),r=0..w+e+1),s=0..w+e+1)]); # where ReSeq reverses the order of the sequence

for i from 1 to nops(V)-1 do
N[i]:=algsubs(V[i],N[i-1]);
end do;

where N[0] is a polynomial in u(t) and v(t). But it keeps giving y(1,0)*y(2,0) instead of y(3,0).
for example:
i want to know how many numbers generated in this loops

 

[seq([seq(i, j = i .. 5)], i = 1 .. 5)]

[1, 1, 1, 1, 1], [2, 2, 2, 2], [3, 3, 3], [4, 4], [5];

 

as if there is no way that can make a "++" increment operator in maple 12

I'm learning to handle the output of pdsolve. It is a module and I'm quite new to that. The objective is to plot the solution for different values of, say, time t, in a fairly systematic way. I'll consign here my progress for reference. Feel free to comment if you have suggestions.

 sol := pdsolve
  ( diff(u(x, t), t) = (1/10)*(diff(u(x, t), x, x))
  , {u(0, t) = 0, u(x, 0) = 1, (D[1](u))(1, t) = 0}
  , numeric
  );

How can we draw a sequence of segments with a list data of column vector? Thanks

How do I create a symbolic sequence with a variable number of elements, so that later I can come back and set the number of elements to an integer? Maple has inert forms for many functions (e.g. Sum and sum), but there does not appear to be anything like "Seq" which would be the inert analogue of "seq".

Here are some of my attempts

  Ls:='seq'(a[j],j=2..p);
eval(Ls,p=5);
subs(p=5,Ls);
Ls:=seq(a[j],j=2..5);
Ls:='seq'(a[j],j=2..5);

I use a simple for loop below to illustrate. For each loop through the index value I want to add the result of that loop to a list h. This is how I tried to do it but I can't quite get it because the value in h1 gets updated for each step through the for loop.

 

for i from 1 to 10 do

u[i]:=2*i;

h:=[]; h1:=[u[i],op(h)]

end do;

So after the for loop is terminated I want to be left with a list h:= ...

I want to construct a sequence of diffenrential equations with

seq(diff(f[i],x)=k[i]*f[i],i=1..4);

but I get

0 = k[1]*f[1], 0 = k[2]*f[2], 0 = k[3]*f[3], 0 = k[4]*f[4] 

Is there anyone can tell me what I have done wrong? Thanks a ton!! 

"sum" not working as expected

March 11 2011 by Herb Kunze 0 Maple

If one types

seq(cos((n mod 3)*Pi,n=2..13);

Maple returns, correctly,

1,1,-1,1,1,-1,1,1,-1,1,1,-1

If one types

sum(cos((n mod 3)*Pi),n=2..13);  # surely the sum of the above sequence = 4

Maple returns, incorrectly, the value 1.

Sure enough, if one types

sum(cos((n mod 3)*Pi)*exp(n),n=2..13); # expecting the sum of e^n with every third term negative

Maple returns

e^2-e^3+e^4-e^5+e^6-e^7+e^8-e^9+e^10-e11+e^12-e^13  ...

I have a matrix (M) and it has both 0 and 1 as entries. I want to have a sequence/list of all indices associated with the entries equal to one (the others are irrelevant to me). I can use a nested for loop with an if statement, but I find that the easy way out and not very pretty. Is there is more sophisticated way, hopefully faster way of achieving this (using sequences, attributes, select/remove)?

Example:

M:=Matrix([[1,1,0],[0,0,1],[1,0,1]]);

Could somebody help me I am having trouble with an if statement.

I have defined three functions a.b and c in terms of one variable j.

I have correctly defined g_{k,j} as well as other functions and now I have run into trouble with my if statement.

p:=(k,j)->if k=0 then max(K-j*S,0) else g_{k,j} end if

I think its clear what i am trying to achieve in the if statement as I want to be able to enter p(1,4), p(4,3) etc. . .  after the if statement...

1 2 Page 1 of 2