MaplePrimes Questions

Hello there, 

When I tried to solve a set of equations, represented in a matrix form, Maple complained. After the matrix form was decomposed to row by row and solve was attempted, Maple became happy. I wonder if I can solve the set of equations in a matrix form. 


 

Goal: solve this set of equations in terms of Xl12/Xl23/Xl13

X1 = 0.5 * ( Xl12 + Xl13 - Xl23 )
X2 = 0.5 * ( Xl12 + Xl23 - Xl13 )
X3 = 0.5 * ( Xl13 + Xl23 - Xl12 )

X:=<X1, X2, X3>;

Vector(3, {(1) = X1, (2) = X2, (3) = X3})

(1)

Xeq:= X = <1/2*(xl12 + xl13-xl23), 1/2*(xl12 + xl23-xl13), 1/2*(xl13 + xl23-xl12)>;

(Vector(3, {(1) = X1, (2) = X2, (3) = X3})) = (Vector(3, {(1) = (1/2)*xl12+(1/2)*xl13-(1/2)*xl23, (2) = (1/2)*xl12+(1/2)*xl23-(1/2)*xl13, (3) = (1/2)*xl13+(1/2)*xl23-(1/2)*xl12}))

(2)

solve(Xeq, {xl12, xl13, xl23});

Error, invalid input: solve expects its 1st argument, eqs, to be of type {`and`, `not`, `or`, algebraic, relation(algebraic), ({list, set})({`and`, `not`, `or`, algebraic, relation(algebraic)})}, but received (Vector(3, {(1) = X1, (2) = X2, (3) = X3})) = (Vector(3, {(1) = (1/2)*xl12+(1/2)*xl13-(1/2)*xl23, (2) = (1/2)*xl12+(1/2)*xl23-(1/2)*xl13, (3) = (1/2)*xl13+(1/2)*xl23-(1/2)*xl12}))

 

Did not work.

solve({X1=1/2*(xl12 + xl13-xl23), X2=1/2*(xl12 + xl23-xl13), X3=1/2*(xl13 + xl23-xl12)}, {xl12, xl13, xl23});

{xl12 = X1+X2, xl13 = X3+X1, xl23 = X2+X3}

(3)

Did work.

 


 

Download Q_20200609.mw

I want to shade the function y=x*ln(x) on the domain of (0,1].

It would seem that if a package is loaded at the "top-level" via with() and the worksheet also has a procedure definition which contains a 'uses' statement for the same package (OK, admittedly a bit redundant), the commands from the relevant package actually "go missing".

See the output from test4() in the attached.

I can't believe that this is deliberate, because when trying to 'compartmentalise' code, then a 'uses' statement in a procedure seems like a good idea. To have this fail because the "top-level" worksheet contains a with() statement loading the same package seems perverse.

Please don't post workarounds - I already know several ways to do achieve it. I'm trying to find out if this behaviour is "deliberate" or a "bug". If the latter, it has been around for a long time because I have checked all the way back to Maple 18: every version exhibits the same behaviour

  restart:

  kernelopts(version);
  test1:= proc(M::Matrix)
               uses LinearAlgebra:
               return MatrixInverse(M):
          end proc:
  test2:= proc(M::Matrix)
               return LinearAlgebra:-MatrixInverse(M):
          end proc:
  with(LinearAlgebra):
  test3:= proc(M::Matrix)
               return MatrixInverse(M):
          end proc:
  test4:= proc(M::Matrix)
               uses LinearAlgebra:
               return MatrixInverse(M):
          end proc:
  test1( Matrix( [[1,2],[3,4]]));
  test2( Matrix( [[1,2],[3,4]]));
  test3( Matrix( [[1,2],[3,4]]));
  test4( Matrix( [[1,2],[3,4]]));

`Maple 2020.0, X86 64 WINDOWS, Mar 4 2020, Build ID 1455132`

 

Matrix(2, 2, {(1, 1) = -2, (1, 2) = 1, (2, 1) = 3/2, (2, 2) = -1/2})

 

Matrix(2, 2, {(1, 1) = -2, (1, 2) = 1, (2, 1) = 3/2, (2, 2) = -1/2})

 

Matrix(2, 2, {(1, 1) = -2, (1, 2) = 1, (2, 1) = 3/2, (2, 2) = -1/2})

 

MatrixInverse(Matrix(%id = 18446744074373391174))

(1)

 

Download usewith.mw

Please everybody, help me to make phaseportrait 3D

f:= (ln(4x-4)/4)-(ln(4x+4)/4)+(arctan(x)/2)

When I do plots([f(x),f(x)-2,f(x)+2]), the graphs don't extend infinitely like I want. They stop just themselves. How get I the plots to extended more? I attached a picture. 

it really confused, with generating different sample some times the command fsolve is working and some times don't . is there any other way to solve this system of equations. because I am going to generate 1000 samples and for each sample, I supposed to solve this system.
 

``

with(LinearAlgebra):
NULL

 

 

``

f[1] := VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`+`(n_x, n_y), 1/theta1), VectorCalculus:-`-`(sum(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`+`(theta2, -1), x[t]), 1/VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(theta1, theta2), x[t]), 1)), t = 1 .. n_x))), VectorCalculus:-`-`(sum(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`+`(2, R_x[t]), x[t]), 1/VectorCalculus:-`*`(VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(theta1, theta2), x[t]), 1)^VectorCalculus:-`+`(1, VectorCalculus:-`-`(1/theta2)), VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(theta1, theta2), x[t]), 1)^(1/theta2), -1), theta3))), t = 1 .. n_x))), VectorCalculus:-`-`(sum(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`+`(theta2, -1), y[T]), 1/VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(theta1, theta2), y[T]), 1)), T = 1 .. n_y))), VectorCalculus:-`-`(sum(VectorCalculus:-`*`(VectorCalculus:-`*`(VectorCalculus:-`+`(2, R_y[T]), y[T]), 1/VectorCalculus:-`*`(VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(theta1, theta2), y[T]), 1)^VectorCalculus:-`+`(1, VectorCalculus:-`-`(1/theta2)), VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`+`(VectorCalculus:-`*`(VectorCalculus:-`*`(theta1, theta2), y[T]), 1)^(1/theta2), -1), theta4))), T = 1 .. n_y))):

N_x := 30:

n_x := 30:

NULL

R_x := [seq(0, nl = 1 .. 30)];

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

 

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

(1)

`&lambda;&lambda;` := 5; -1; QQ := 1; -1; `&alpha;&alpha;1` := 2; -1; `&alpha;&alpha;2` := 4

4

(2)

W := GenerateUniform(n_x, 0, 1):
``

fsolve({f[1], f[2], f[3], f[4]}, {theta1 = 0 .. infinity, theta2 = 0 .. infinity, theta3 = .5 .. infinity, theta4 = .5 .. infinity})

 

(3)

``

``


 

Download ask_maple.mw

I just need someone to explain to me why the following occurs:

 

 

 

showstat(rand)


rand := proc(r::{posint, numeric .. numeric}, $)
   1   if nargs = 0 then
   2     RandomTools:-MersenneTwister:-GenerateInteger()
       else
   3     try
   4       if type(r,('numeric') .. ('numeric')) then
   5         if rhs(r) < lhs(r) then
   6           error "invalid range, end points are out of order"
             elif not type(r,('integer') .. ('integer')) then
   7           return () -> RandomTools:-Generate(float(('range') = r,('method') = ('uniform')))
             end if
           end if;
   8       return RandomTools:-MersenneTwister:-NewGenerator(('range') = r)
         catch :
   9       error
         end try
       end if
end proc

 

NULL

showstat(RandomTools:-MersenneTwister:-GenerateInteger)


RandomTools:-MersenneTwister:-GenerateInteger := proc({range::{integer, integer .. integer} := 1000000000000}, $)
local bits, divisor, offset;
   1   if nargs = 0 then
   2     return MTKernelInterface(4)
       end if;
   3   if type(range,'integer') then
   4     divisor := range;
   5     offset := 0
       else
   6     if rhs(range) < lhs(range) then
   7       error "illegal range, end points out of order"
         end if;
   8     if lhs(range) = rhs(range) then
   9       return lhs(range)
         end if;
  10     offset := lhs(range);
  11     divisor := rhs(range)-offset+1
       end if;
  12   if divisor = 0 then
  13     return offset
       end if;
  14   bits := MTKernelInterface(5,divisor);
  15   MTKernelInterface(6,divisor,bits)+offset
end proc

 

NULL

showstat(MTKernelInterface)

Error, (in showstat) procedure name expected

 

``

``

 

 

Download rand_showstat.mw

Does maple provide any method for finding the saddle point of a function? Thank you

I am trying to write maple program for Gauss Siedel method. I needed two for loop. One for running the iterative method and the other for checking where (the number of iteration required) the results converge.

Please, I need help. 

 

Thanks. 

Hi guys! I'm having trouble using int with a few expressions, for example:

is returning

however simpler expressions such as

int(x^2 + x, x)

or int(x/2 + 1/2, x)

are working correctly and returning 

respectively. I'm using Maple 2020 in worksheet mode using Math 2D Input/Output.

Here's my screen, any help would be much appreciated thanks!

Hi,

I'm trying to solve for Double Inequality. (1.1) and (1.3) combined.

Thanks in Advance
 

Example: Solving a Double Inequality

 

-3 <= 6*x-1

0 <= 6*x+2

(1.1)

"(->)"

[[-1/3 <= x]]

(1.2)

6*x-1 < 3

6*x < 4

(1.3)

"(->)"[[x < 2/3]]

"ex1(x):=6 x-1"

proc (x) options operator, arrow, function_assign; 6*x-1 end proc

(1.4)

"->"

 

"->"

"ex2(y):=3"

proc (y) options operator, arrow, function_assign; 3 end proc

(1.5)

"ex3(y):=-3"

proc (y) options operator, arrow, function_assign; -3 end proc

(1.6)

NULL


 

Download Double_Inequality.mw

Hi,

I was wondering is there an easier way for me to solve an Equation Involving an Absolute Value?


 

Example: Solving an Equation Involving an Absolute Value

 

x^2-3*x = -4*x+6

x^2-3*x = -4*x+6

(1.1)

"(->)"

[[x = 2], [x = -3]]

(1.2)

-x^2+3*x = -4*x+6

-x^2+3*x = -4*x+6

(1.3)

"(->)"

[[x = 1], [x = 6]]

(1.4)

"ex7(x):=|x^(2)-3 x|+4 x-6"

proc (x) options operator, arrow, function_assign; abs(x^2-3*x)+4*x-6 end proc

(1.5)

"->"

 

``

NULL


 

Download Absolute_Value.mw

Mapple doesn' work at document mode.How can i solve the problem.(My Os is Win 10 )

Hi!
I am trying to solve ODE with bvp[midrich], and I need to prove the validity of this method. 
Where can i read about realization of bvp[midrich]. What scheme does it use? Аre there any articles on this subject?
 

 
First 248 249 250 251 252 253 254 Last Page 250 of 2132