Jarekkk

454 Reputation

13 Badges

19 years, 313 days

MaplePrimes Activity


These are replies submitted by Jarekkk

@acer Thank you for your comment. It's nice to use the Matrix constructor directly when building the block matrix. It would be good if there was an example of it in the help page (as I haven't found it).

What does SCR mean? Is it Software Change Request?

And how do you insert expressions and matrices as a text (not an image) here, please? (I tried the "Paste as Plain Text" icon, but it doesn't work).

@amrramadaneg Yes, you have to differentiate with respect to some variable, not a number. And that is what the Error message says.

It depends on what you want. If you want to evaluate e.g. sin(x) at five equidistant points on the interval [0,2*Pi] you can type:

M:=4:
f :=  i->2*(i-1)*Pi/M:
v := Vector(M+1, f):
x := sin~(v);

and get

 

There is also a different (and faster) way which doesn't use vectors:

sin~([seq(2*(i-1)*Pi/M,i=1..M+1)]);


Vectors v and sin~(v) (as well as the lists above) contain numerical values. So you cannot write diff~(sin~(v),v). If you want to differentiate (symbolically with diff) you need to do it before assigning numerical values to the valriable(s).

You can either do this:

restart;
M:=4:
f := i->2*(i-1)*Pi/M:
v := Vector(M+1, f):
dif1:=unapply(diff(sin(u),u),u):  # computing the differentiation for a scalar
x1dot:=dif1~(v); # and then apply it to a vector of numerical values
             

Or you can compute the whole vector x1dot at first symbolically:

restart;
M:=4:
f :=i -> theta[i]:
v := Vector(M+1, f):
x1dot:=diff~(sin~(v),v);

 

and then assign the numerical values to theta[i]:

for i to M+1 do theta[i]:= 2*(i-1)*Pi/M: end do:
x1dot;





@amrramadaneg Yes, you have to differentiate with respect to some variable, not a number. And that is what the Error message says.

It depends on what you want. If you want to evaluate e.g. sin(x) at five equidistant points on the interval [0,2*Pi] you can type:

M:=4:
f :=  i->2*(i-1)*Pi/M:
v := Vector(M+1, f):
x := sin~(v);

and get

 

There is also a different (and faster) way which doesn't use vectors:

sin~([seq(2*(i-1)*Pi/M,i=1..M+1)]);


Vectors v and sin~(v) (as well as the lists above) contain numerical values. So you cannot write diff~(sin~(v),v). If you want to differentiate (symbolically with diff) you need to do it before assigning numerical values to the valriable(s).

You can either do this:

restart;
M:=4:
f := i->2*(i-1)*Pi/M:
v := Vector(M+1, f):
dif1:=unapply(diff(sin(u),u),u):  # computing the differentiation for a scalar
x1dot:=dif1~(v); # and then apply it to a vector of numerical values
             

Or you can compute the whole vector x1dot at first symbolically:

restart;
M:=4:
f :=i -> theta[i]:
v := Vector(M+1, f):
x1dot:=diff~(sin~(v),v);

 

and then assign the numerical values to theta[i]:

for i to M+1 do theta[i]:= 2*(i-1)*Pi/M: end do:
x1dot;





@amrramadaneg Could you upload your worksheet again, please? I'm not able to download it.

@amrramadaneg Could you upload your worksheet again, please? I'm not able to download it.

@Markiyan Hirnyk Thanks. I agree that it would be (much) better if I didn't need to make the last step by hand. However, I couldn't find out how to force Maple to do it.

@Markiyan Hirnyk Thanks. I agree that it would be (much) better if I didn't need to make the last step by hand. However, I couldn't find out how to force Maple to do it.

I tried to compute it with Maple and found out that it is not possible. But I am not sure that Maple solved it correctly.

@amrramadaneg What kind of error do you mean?

Now, we can do this:

M := 100:
f := i -> (i-1)*2*Pi/M:
theta:=Vector(M+1,f):

And then we would continue with:

x := cos~(theta)/~(1+~cos~(theta));

but for theta=-Pi the denominator is 0 and you get the division by zero error.

@amrramadaneg What kind of error do you mean?

Now, we can do this:

M := 100:
f := i -> (i-1)*2*Pi/M:
theta:=Vector(M+1,f):

And then we would continue with:

x := cos~(theta)/~(1+~cos~(theta));

but for theta=-Pi the denominator is 0 and you get the division by zero error.

@marram The
                          'genfunc'(z)
 option is valid for linear recurrences with constant coefficients and systems of linear recurrences with constant coefficients. In this case, rsolve returns the generating functions of the sequences defined by eqns. The name z is used as the generating function variable.

see ?rsolve

 

If you type it without "genfunc(z)" you will see that rsolve found no solutions. You can also use "infolevel['rsolve'] := 2;" as stated in the help as well.

@marram The
                          'genfunc'(z)
 option is valid for linear recurrences with constant coefficients and systems of linear recurrences with constant coefficients. In this case, rsolve returns the generating functions of the sequences defined by eqns. The name z is used as the generating function variable.

see ?rsolve

 

If you type it without "genfunc(z)" you will see that rsolve found no solutions. You can also use "infolevel['rsolve'] := 2;" as stated in the help as well.

Could you upload a worksheet containing your equations? Or write them here as a text (that anyone can copy/paste it).

When I execute it in the Classic Worksheet, the maplet window has "all" three buttons. When I run it as a maplet with MapletViewer then it is the same.

In the Standard Worksheet I get the window you probably get as well with only one (close) button. Unfortunately, I do not know how to change it.

What is CoVar[1,2]? What are E1, E2, E3? And what should be w1, w2, w3 - real numbers?

First 10 11 12 13 14 15 Page 12 of 15