Items tagged with seq


hey is there a easy way to make maple solve an equation with similar different variables,

for eksample 

defining the different variables

x_0:=1       x_1:=4           x_2:=10

setting up and equation

solve x * 5

recieving answers for all defined x variables

= [5,20,50]




I'm currently writing my thesis and actually haven't used Maple before.

I've got the following problem with converting the results of a sequence:

seq(Optimization:-Maximize(function with 2 variables), parameter:0..1,0.1)

The results are ok, but I can't convert the values to a spreadsheet with 4 columns (parameter value, maximum value, value of variable 1, value of variable 2).

Thank you!

Best regards

How do I define this sequence a(n) in Maple?

a(n) = 1/n for n=odd, a(n) = -1/n^2 for n = even.


When using seq function below in the second call, it does not generate a sequence of functions with 'a' being 1, 2, and 3, and I had expected. 

First seq function call is just to show that it works without the function "x ->" wrapping.

I could of couse use unapply as in the third call, but I had expected the second call to work.

Am I doing anything wrong, or is this a Maple bug?



I have a sequence of functions :  solution[i] , i = 1..n

I have a sequence of times:          Time[i], i = 1..n+1

I need help to plot in the same graph:

 plot(  Sol[1] , t = Time[1]..Time[2] )  

 plot(  Sol[2] , t = Time[2]..Time[3] )  

 plot(  Sol[3] , t = Time[3]..Time[4] )  


plot(  Sol[n] , t = Time[n]..Time[n+1] )  

Thank you





Any idea about the summation of Fibonacci sequence


Best regards


Hello everybody.

I have a function:

f(x,y)=GAMMA(y, -ln(x))/GAMMA(y)

seq(sum(f(x, y), y = 0 .. 1), x = 0 .. 5)


and I got a error message:

Error, (in ln) numeric exception: division by zero ??
This is normal behavior in seq function or Bug?


but  when I'm first calculate the sum sol := sum(f(x, y), y = 0 .. 1) -> x,

and evalf([seq(sol, x = 0 .. 5)]) ->[0., 1., 2., 3., 4., 5.] works fine.

Mariusz Iwaniuk

I have the following command.

message := `Kajian ini mempunyai tiga objektif pertama seperti yang ditunjukkan dalam bahagian 1.11. Objektif tersebut harus`;

m := convert(message, bytes);

block := map(convert, m, binary);
block := map2(nprintf, "%08d", block);
block := map(proc (t) options operator, arrow; [seq(parse(convert(t, string)[i]), i = 1 .. length(convert(t, string)))] end proc, block);

block := [[0, 1, 0, 0, 1, 0, 1, 1], [0, 1, 1, 0, 0, 0, 0, 1], [0, 1, 1, 0, 1, 0, 1, 0], [0, 1, 1, 0, 1, 0, 0, 1], ........]

for i to l do
for j from 3 to 7 do
block[i][j] := 1-block[i][j];  //used to flip bit in between 3rd to 7th bit in a block
end do;
c_block[i] := block[i];
end do;
c_block1 := [seq(c_block[i], i = 1 .. l)];

Error, assigning to a long list, please use Arrays

May i know how to solve this problem? I need to change some bit in a list but receive error when there is more than 100 elements in a list. Thank you.

Here is my command


> teksbiasa:=`Kriptografi`;




>nilaiASCII:=convert(teksbiasa, bytes);





Anyone know how i need to write the command to add the lenght of the text (len) into each of the number in nilaiASCII?

What is want to get is:


Thank you~=]]



So I'm trying to generate a .dat file that has x in the first column, then the output for y1 in the next and y2 in the following, where y1 and y2 are functions of x so the data file would look something like this from x=-5..5 in equal steps of 0.01.

-5          12           8
-4.99     7             5


I'm struggling to get my head around how to do this, i understand i should use the seq function in maple and save it in array of sorts and then use writedata, but im not sure how to piece it together for having 3 columns


thanks in advance for any help!

I am trying to do some algebra with the derivatives of some variables within a program. As a result i need to relable them before i feed them into solve.

To relable them i create vectors and use subs. one of these vectors behaves differently within a proc to how it behaves outside it. This is weird.

TimefullBehavesFunny := proc (nPars, nVars)
local nDiffs, timefull, timeless;
nDiffs := nPars;
timefull := [seq(dx[j, i] = diff(x[i](t), `$`(t, j)), i = 1 .. nVars)];
timefull := [seq(op(timefull), j = 0 .. nDiffs), seq(x[i] = x[i](t), i = 1 .. nVars)];
timeless := `~`[`=`](`~`[rhs](timefull), `~`[lhs](timefull));
timefull, timeless, nDiffs;
end proc

When i run the above for (3,3) i get a differet result to when i run the following
nDiffs := 3;
timefull := [seq(dx[j, i] = diff(x[i](t), `$`(t, j)), i = 1 .. nVars)];
timefull := [seq(op(timefull), j = 0 .. nDiffs), seq(x[i] = x[i](t), i = 1 .. nVars)];
timeless := `~`[`=`](`~`[rhs](timefull), `~`[lhs](timefull));

and similarly for other numbers.

any ideasas to why?



    The following code displays values of the subscripted variables slf[], a positive integer, and a string variable filler[] which is just a set of spaces depending on how big the corresponding value of slf[] s.  This is to make the printout lined up nicely.  

printf("%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d%s%d\n", filler[1],slf[1],filler[2],slf[2],filler[3],slf[3],filler[4],slf[4],filler[5],slf[5],filler[6],slf[6],filler[7],slf[7],filler[8],slf[8],filler[9],slf[9],filler[10],slf[10]);

   This works fine,but thought there might be a better way.  I tried:


but this came up with an error message.  Is there  a way of doing this more efficiently?

thanks,   David 


Dear all,

Thank you for helping me  to generate a table of values of f(x) starting with x=0 to 100 in steps of 1, that is for x=0,1,2,3,...,100.


I tried:

f:=x->2*sqrt(3)*a1*a2*(sum(pochhammer(1/3,k)*3^k*x^(3*k)/(3*k)! ,k=0..infinity)*sum(pochhammer(2/3,k)*3^k*x^(3*k+2)/(3*k+2)!  ,k=0..infinity)-sum(pochhammer(2/3,k)*3^k*x^(3*k+1)/(3*k+1)!  ,k=0..infinity)*sum(pochhammer(1/3,k)*3^k*x^(3*k+1)/(3*k+1)!  ,k=0..infinity));


But I the result is amazing.... I don't understand the problem.





I try to get the first ten fractions of Pi with the commands "seq" and "nthconver".

I tried this:

a:= cfrac(Pi);
CFRAC([3, 7, 15, 1, 292, 1, 1, 1, 2, 1, 3, ...])


But it doesn't work.

Who can help me?

1 2 3 4 5 Page 1 of 5