Kitonum

14069 Reputation

24 Badges

11 years, 199 days

MaplePrimes Activity


These are replies submitted by Kitonum

If you need a procedure, then do so (I just rewrote vv's code as a procedure):

Squares:=(M,N)->plots:-display(seq(seq(plottools:-polygon([[m,n],[m+1/2,n+1/2],[m+1,n],[m+1/2,n-1/2]], color=`if`(m::odd,red,blue)), m=0..M),n=0..N), axes=none, scaling=constrained):


Examples of use:
Squares(2,2);
Squares(5,5);
Squares(3,2);

@vv 

sys := [x^2 + y^2 - x*y - 1 = 0, y^2 + z^2 - y*z - a^2 = 0, z^2 + x^2 - x*z - b^2 = 0]:
ab:={a=10,b=104/10}:
solve(eval(sys,ab), explicit):
evalf(%);

           {x = 6.676479229-2.966007548*I, y = 5.939434090+4.226624806*I, z = 12.50085790+.1379423560*I}, {x = -6.676479229+2.966007548*I, y = -5.939434090-4.226624806*I, z = -12.50085790-.1379423560*I}, {x = 6.676479229+2.966007548*I, y = 5.939434090-4.226624806*I, z = 12.50085790-.1379423560*I}, {x = -6.676479229-2.966007548*I, y = -5.939434090+4.226624806*I, z = -12.50085790+.1379423560*I}, {x = .1989718373, y = 1.084528494, z = 10.49807685}, {x = -.1989718373, y = -1.084528494, z = -10.49807685}, {x = 1.141952419, y = .4227976407, z = -9.781889234}, {x = -1.141952419, y = -.4227976407, z = 9.781889234}


Or even simpler:

sys := [x^2 + y^2 - x*y - 1 = 0, y^2 + z^2 - y*z - a^2 = 0, z^2 + x^2 - x*z - b^2 = 0]:
ab:={a=10,b=10.4}:
solve(eval(sys,ab));

Output is the same.

@abdgafartunde  Instead of column matrices, it is better to use vectors.

See the toy example:

N:= 5:
A:=<1,2; 3,4>;
b:=<1, 2>;  C:=<1, 1>;

for i from 0 to N do
      x[i+1] := A%.((i^2+1)*b) + C;
od; 

 

@abdgafartunde  I meant that in the same way, you can assign a name to each output, and then refer to these names when necessary.

@Ahmed111  See update to my answer above. The commands  diff  and  Physics:-diff  calculate any derivatives, both ordinary and partial. See help on these commands.

@Carl Love  See update to my answer. Compare my result with yours. 

@Scot Gould  Thank you for this!  I did not know that Maple solves systems written in vector form.

@amirhadiz  The  Interpolation  package appeared only in the latest versions of Maple. You have an older version, but you can use the code from my answer.

@acer  Thanks for this info. I did not know that such an evident command appeared recently only. Of course, for older versions, we can write
L1:=map(t->[t,ListTools:-Occurrences(t,L)], convert(L,set));
instead of  
L1:=ListTools:-Collect(L);

 but of course, Statistics:-Tally is more convenient. My point was simply to show that there are different ways to solve the same problem.

@Ali2020  It works in Maple 2019 only.

@minhthien2016 

Here is the equation with 6 another solutions:

abs(a*x+b)+abs(c*x+d)-3*x^2+n*x+p=0

@minhthien2016  
 

f:=x-> abs(a*x+b)+abs(c*x+d)-x^2+n*x+p;
solve([f(1) = 0, f(2) = 0, f(3) = 0, f(4) = 0, f(5) = 0, f(6) = 0], [a, b, c, d, n, p]);

     [[a = -2, b = 5, c = -2, d = 9, n = 7, p = -16], [a = -2, b = 5, c = 2, d = -9, n = 7, p = -16], [a = 2, b = -5, c = -2, d = 9, n = 7, p = -16], [a = 2, b = -5, c = 2, d = -9, n = 7, p = -16], [a = -2, b = 9, c = -2, d = 5, n = 7, p = -16], [a = 2, b = -9, c = -2, d = 5, n = 7, p = -16], [a = -2, b = 9, c = 2, d = -5, n = 7, p = -16], [a = 2, b = -9, c = 2, d = -5, n = 7, p = -16]]

@mehran rajabi  See help on  Student:-NumericalAnalysis:-Quadrature  command, spesifically the  method  option.

Present the complete code in an editable form (as text, not a picture) or the worksheet.

@weidade37211  I do not know how to explain this difference. I tried both methods and found that the second one is faster and does not need square brackets.

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