Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

How to solve matrix in maple.

Example: Set A := Matrix(3, 3, [[2, -3, 1], [-3, 5, 0], [1, 0, 5]]). Find matrix L such that A = L^T*L.

I can solve by hand but how to use Maple?

I have a list L:=[[0,0,0], [1,0,0], [1,1,0], [0,1,0], [0,0,1], [1,0,1], [1,1,1], [0,1,1]] (8 vertices of a cube). How can I select four vertices of the list to make a regular tetrahedron?

Hello,

I am experiencing some trouble with the function Minimize of the Optimization package. I have some trouble understanding what Maple is doing with nice functions already.

f := (x-2)^2+1;
                                 2    
                          (x - 2)  + 1
Minimize(f, {x >= -2, x <= 2});
             [1., [x = HFloat(1.9999999999999998)]]
Minimize(f(x), {x >= -2, x <= 2});
                    [1., [x = HFloat(2.0)]]
g := proc (x) options operator, arrow; (x-2)^2+1 end proc;
            2    
x -> (x - 2)  + 1
Minimize(g, {x >= -2, x <= 2});
Error, (in Optimization:-NLPSolve) constraints must be specified as a set or list of  procedures
Minimize(g(x), {x >= -2, x <= 2});
             [1., [x = HFloat(1.9999999999999998)]]

Hello there!

I have just an elemental question. Given an equation as input, how could I write a procedure to know the variables involved in that equation? 

For example, my input is 2x+3y=0, and I would like to have the output  {x,y}.

Thanks in avance for the help!

Hi all,

I am attempting to have the piecewise function

Render using either mathML or Letex in maple, using the syntax:

f := piecewise(-Pi <= x and x < 0, 1, 0 <= x and x < Pi, 0);

la := latex(f);

mml := MathML[ExportPresentation](f);

 

Unfortunately, as you will notice the latex produces some really annoying "and" words amongst the code.  While the MathML produces some equally annoying "&wedge;", and symbols, amongst the code.

Any help would be appreciated.

 

Mark

Hello,

I have a question about the Import of .txt file:

I can import the following .txt, but everytime I want to convert in a matrix or something else, maple chrashes. 

I need some parts (smaller matrices) of this data (for example: all values from coloumn 200-400 and row 100-600)

I hope somebody can help me

Thanks 
Martin

-Validierung-Stahl-AI-.txt

 

 

Hey 

i want to solve these 3 eqations 

21000 = ((10/1000)/60)*4181*983*(x-y)

H = -((10/1000)/60)*4181*ln(1-((x-y)/(x-40)))

H = 124+102'ln(x-40)+(7+2*ln(x-40))

 

with the result of:

H,x,y

 

how do i do that?

 

Thanks

Hi everyone, I am trying to plot field lines but I face problem in plotting field plot. kindly help me if anyone can do it. Find the code in the attached file. Thank you.

Field_lines.mw

tomleslie 2300Mohsen 20 @Carl Love @Markiyan Hirnyk @maple fan 175 @asa12 405  @Adri van der Meer 1253 

restart;

f:=5*x^3-5*x+1;

5*x^3-5*x+1

(1)

s:=[solve(f)]; evalf(%);  # All the roots are real

[(1/30)*(-2700+(300*I)*219^(1/2))^(1/3)+10/(-2700+(300*I)*219^(1/2))^(1/3), -(1/60)*(-2700+(300*I)*219^(1/2))^(1/3)-5/(-2700+(300*I)*219^(1/2))^(1/3)+((1/2)*I)*3^(1/2)*((1/30)*(-2700+(300*I)*219^(1/2))^(1/3)-10/(-2700+(300*I)*219^(1/2))^(1/3)), -(1/60)*(-2700+(300*I)*219^(1/2))^(1/3)-5/(-2700+(300*I)*219^(1/2))^(1/3)-((1/2)*I)*3^(1/2)*((1/30)*(-2700+(300*I)*219^(1/2))^(1/3)-10/(-2700+(300*I)*219^(1/2))^(1/3))]

 

[.8788850663-0.2e-9*I, -1.088033915-0.2598076212e-9*I, .2091488484+0.2598076212e-9*I]

(2)

max(s);  # ?

Error, (in simpl/max) complex argument to max/min: (1/30)*(-2700+(300*I)*219^(1/2))^(1/3)+10/(-2700+(300*I)*219^(1/2))^(1/3)

 

type(s,list(realcons)); # Wrong, the type realcons should not be purely syntactic; or is it?

false

(3)

R:=convert(s,RootOf):

max(R);  #  For nested RootOfs fails

Error, (in simpl/max) complex argument to max/min: (1/30)*RootOf(_Z^3+2700-300*RootOf(_Z^2+1, index = 1)*RootOf(_Z^2-73, index = 1)*RootOf(_Z^2-3, index = 1), index = 1)+10/RootOf(_Z^3+2700-300*RootOf(_Z^2+1, index = 1)*RootOf(_Z^2-73, index = 1)*RootOf(_Z^2-3, index = 1), index = 1)

 

sort(s): evalf(%);  # Wrong

[.8788850663-0.2e-9*I, .2091488484+0.2598076212e-9*I, -1.088033915-0.2598076212e-9*I]

(4)

 

Workaround

 

S:=[seq(RootOf(f,x,index=i),i=1..3)];

[RootOf(5*_Z^3-5*_Z+1, index = 1), RootOf(5*_Z^3-5*_Z+1, index = 2), RootOf(5*_Z^3-5*_Z+1, index = 3)]

(5)

evalf(S);

[.2091488484, .8788850662, -1.088033915]

(6)

min(S);max(S);  # OK

RootOf(5*_Z^3-5*_Z+1, index = 3)

 

RootOf(5*_Z^3-5*_Z+1, index = 2)

(7)

sort(S);   # Wrong!

[RootOf(5*_Z^3-5*_Z+1, index = 1), RootOf(5*_Z^3-5*_Z+1, index = 2), RootOf(5*_Z^3-5*_Z+1, index = 3)]

(8)

################################

r:=(sqrt(2)+I)^3 + (sqrt(2)-I)^3;

(2^(1/2)+I)^3+(2^(1/2)-I)^3

(9)

type(r,realcons);  # Purely syntactic?

false

(10)

type(expand(r),realcons);

true

(11)

max(r,13);  # Even for such a simple expression?

Error, (in simpl/max) complex argument to max/min: (2^(1/2)+I)^3+(2^(1/2)-I)^3

 

 


Download TryHarder.mw

So I've got a function and try to find an extrema (and there is one on the plot), but Maple gives me empty brackets.

First, earlier it gave me 2 x-coordinates with extrema (both empty), but now (after reloading) it gives one and empty.

Second, how do I set an interval, if I want to look for extrema from x=0 to x=1, for example? I tried extrema (V, {0,1}, x) and (V, {x=0, x=1}, x), but nothing seems to work.

2.mw

Hi everybody,

I use the Grid package to do intensive computations.

For some reason I'm ignorant about, the test case described in the Grid[Server][StartServer] 

 help page doesn't work with Maple 2015 (neither on Mac OS X, neither on Windows 7 ; here is the mw file run on MAC Os X)

Could someone explain me why (probably something I did not read with enough attention ... some license maybe) ?
Thanks in advance

GridServer.mw

Just a simple little worksheet to see if I have enough propane to heat my house for the rest of the winter.


 

Do I have enough propane for the winter?

NULL

I've taken some measurements from my propane tank throughout the winter.  Now we can use Maple to see if we have enough to last the rest of the winter.

``

a := [["nov 27, 2017", 73.5], ["dec 9, 2017", 72], ["dec 16, 2017", 69], ["dec 31, 2017", 62], ["jan 12, 2018", 60], ["jan 19, 2018", 56], ["jan 26, 2018", 54], ["feb 4,2018", 51]]

[["nov 27, 2017", 73.5], ["dec 9, 2017", 72], ["dec 16, 2017", 69], ["dec 31, 2017", 62], ["jan 12, 2018", 60], ["jan 19, 2018", 56], ["jan 26, 2018", 54], ["feb 4,2018", 51]]

(1)

with(Finance)  ``

pts := [seq([DayCount(a[1, 1], a[i, 1]), a[i, 2]], i = 1 .. nops(a))]

[[0, 73.5], [12, 72], [19, 69], [34, 62], [46, 60], [53, 56], [60, 54], [69, 51]]

(2)

with(plots)

listplot(pts)

 

Adding a 30% and 20% level to the graph.  We probably shouldn't be too worried about the cold in June so DayCount("Nov 27, 2017", "Jun 1, 2018") = 186 we'll extend these reference lines out to 186.

plot({pts, [[0, 20], [186, 20]], [[0, 30], [186, 30]]}, view = [default, 0 .. 80])

 

 

30% is the recommended level your propane company wants you to fill up at.  The technician who installed the tank said 20% is all right.  It's up to you if you want to go to 10% but if you run out of propane the company has to come in and do a leak test on your system which is an added cost you don't want.  So let's predict at what point we need to start worrying about filling up our propane tank.  To do that, of course, all we need is a forecast line.  For that we'll just calculate a best fit.

 

a1 := [seq(DayCount(a[1, 1], a[i, 1]), i = 1 .. nops(a))]

[0, 12, 19, 34, 46, 53, 60, 69]

(3)

a2 := a[() .. (), 2]

[73.5, 72, 69, 62, 60, 56, 54, 51]

(4)

X := convert(a1, Vector)

Y := convert(a2, Vector)

with(Statistics)

L1 := LinearFit([1, x], X, Y, x)

HFloat(74.79237702730747)-HFloat(0.34416046490941915)*x

(5)

Plotting it all together

plot({L1, pts, [[0, 20], [186, 20]], [[0, 30], [186, 30]]}, x = 0 .. 200, y = 0 .. 80, labels = ["Days", ""], tickmarks = [default, [seq(10*i = cat(10*i, "%"), i = 1 .. 8)]])

 

Projecting the line to 30% we get

solve(L1 = 30)

130.1496877

(6)

AdvanceDate(a[1, 1], trunc(solve(L1 = 30)))

Record(monthDay = 6, month = 4, year = 2018, format = "%B %e, %Y", ModulePrint = proc (m) Finance:-FormatDate(m) end proc)

(7)

April is still a bit chilly so maybe if we wait until 20%, of course it's getting warmer all this time so our usage should go down.  

AdvanceDate(a[1, 1], trunc(solve(L1 = 20)))

Record(monthDay = 5, month = (), year = 2018, format = "%B %e, %Y", ModulePrint = proc (m) Finance:-FormatDate(m) end proc)

(8)

It isn't warm enough to turn off the furnace yet but it looks like we'll have enough to get us into the warm months

AdvanceDate(a[1, 1], trunc(solve(L1 = 10)))

Record(monthDay = 3, month = 6, year = 2018, format = "%B %e, %Y", ModulePrint = proc (m) Finance:-FormatDate(m) end proc)

(9)

We'll hit 10% well into late spring and almost right into summer of course it's a rough estimate however it looks like we won't have to fill up during the high price winter season.  I can tell my wife to relax, we should have enough propane for the winter.

 

 

NULL


 

Download Propane_usage-.mw

I need to calculate sum w2(x,y),

v2 := proc (x, y) options operator, arrow; sin(x)*cos(y) end proc;
u2 := proc (x, y) options operator, arrow; 3*sin(x)-cos(y) end proc;
w2 := proc (x, y) options operator, arrow; diff(v2(x, y), x)-(diff(u2(x, y), y)) end proc;
L1 := proc (x, y) option inline; abs(w2(x, y)) end proc; CodeTools:-Usage(evalhf(add(add(abs(w2(x, y)), x = 0 .. 10), y = 0 .. 10)));
Error, (in CodeTools:-Usage) unable to evaluate built-in function `diff` in evalhf

 but it is error , how  can be rewritten properly?

 

I created the following plot

plot([BesselJ(0, x), BesselJ(1, x)], x = 0 .. 10, color = [red, blue]);
 

What I want to do mext is calculate all x values on this interval wherethe two paths intersect

 Calculate all x values on this interval where

I have a question as this:

Examples as following:(come from MAPLE‘s help ) 
with(LinearAlgebra);
Ax := <1.00004, 1.99987, -0.12e-3>;
b := <1., 2., 0.>;
Add(Ax, b, 1, -1);

result is this:[0.400000000000400e-4, -0.129999999999963e-3, -0.120000000000000e-3]'

I think result is :[0.400000000000400e-4, -0.13e-3, -0.120000000000000e-3]' 

Is this a bug of MAPLE?



 

First 851 852 853 854 855 856 857 Last Page 853 of 2216