Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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?



 

I am trying to solve the function


f :=  sqrt(1-x2)
L := int(sqrt(1+(diff(f(x), x))2), x = 0 .. 5)

Maple is returning an answer with Pi:  (1/2)*Pi+I*ln(5+2*sqrt(6))

How do I convert this into a numerical format?  

 

 

Dear Friends
Is there a way to solve a complicated integration in less possible time?

Thanks

_________________________________________________________________________________
 

restart;
Digits := 100:
tm := time():
with(LinearAlgebra):

m := 6:
a := 0.1:
b := 10*a:
E := 1:
h := 1:
nu := 0.3:

w := (r-b)^2*(r-a)^2*add(add(W[n, i]*r^n*t^(i-n), n = 0 .. i), i = 0 .. m):
ur := -z*(diff(w, r)):
ut := -z*(diff(w, t))/r:
er := diff(ur, r)+(1/2)*(diff(w, r))^2:
et := ur/r+(diff(ut, t))/r+(diff(w, t))^2/(2*r^2):
grt := diff(ut, r)-ut/r+(diff(ur, t))/r+(diff(diff(w, t), r))/r:
u := -(1/2)*E*(2*er*et*nu+er^2+et^2)/(nu^2-1)+(1/2)*E*grt^2/(2*(1+nu)):

PI := int(int(int(u*r, z = -(1/2)*h .. (1/2)*h), t = 0 .. 2*Pi), r = a .. b)-0.5*P*(int(int(r*(diff(w, r))^2, r = a .. b), t = 0 .. 2*Pi)):

Time = time()-tm;

I am looking for a window bat file to run my maple input file.mw

How can I find all roots of sin(sqrt(x)) as the search interval is not constant and depens on x for this function?

Is there a 3D globe available for Maple?  Specifically, a globe depicting the Earth's continents and oceans, that can be grabbed and rotated with the mouse like any other 3D Maple plot?

I can't believe I've just spent a half hour trying to do the simplest thing:

The second example is copied straight out of Tutorial 2.  I'm doing just what the tutorial says: right-click, Solve, Solve for Variable.  I've tried disabling everything in my startup profile, recalculating, restarting, etc.  Why in the world can't I do this simple thing?

Solve_for_variable.mw

Is it possible that the two-variable arctan function arctan(a(x),b(x)) could be could be equal to arctan(a(x)/b(x)) as long as x>0? And why?

arctan(a(x),b(x))=arctan(a(x)/b(x) as long as x>0 ?

Thank's for any replies :)

Hi,

Please I would like to find out if it is possible to plot from a matrix, for example

1) Plot the first and second rows of a matrix, where y-axis is the first row and x-axis is the second row

2) Plot a 3-D diagram using,e.g., first, second and third rows from a matrix. Or

3) Plot the first row of the matrix on the y-axis and then let the x-axis be a time period (e.g. quarters 1, 2, 3, 4).

I attached my Maple file which is solved using FSOLVE. I would like to (i) plot variable A and parameter T  And (ii) plot variables A and F against parameter T in a 3-D form. 

Your help is highly appreciated.

 

Regards,

 

Mela

 

Since thinking over my question I have actually answered it!  ...so I'd just appreciate some comments regards some finer points.  I was initially trying to print out a complex number, and I see in Maple Primes that Joe Riel answered a similar question in Dec 2011  viz

printf"%5.3Z\n",5+3I);  outputs

5.000+ 3.000I

    The documentation in Maple 7 did not give any examples of printing a complex number, and it talked of using z or Z together with a 'c'.  Initially I thought the c was a reference to complex numbers - but after trial and error I finall figured it stood for character.   In the code below I have reinstated the c between the  z and f.  I wanted the output withour the c, and finally removed it - but leaving one space.  (More than one space returns a syntax error.)   My next question was how to find the real and imaginary parts - which I've answered in the code.

    I'm just wondering if the f in zcf is superfluous?  Also, the documentation in Maple 7 seems to make out there are differences between upper and lower case z?  Any comments gratefully received

David

 

 zz:=eval(Zeta(2.5+3*I));

#zz:=eval(2.5+3*I);

a:=Re(zz);

b:=Im(zz);

printf("%zcf   %6.5f  %6.5f\n",zz, a, b);

 

Does anyone know how to calculate basic reproduction number using maple coding? Or by any chance, anyone know how to solve it by hand with this complicated equations?
 

restart

interface(imaginaryunit = j)

I

(1)

lambda := k*tau*(C*Upsilon+I)/N

k*tau*(C*Upsilon+I)/N

(2)

eqn1 := (1-p)*Pi+phi*V+delta*R-(mu+lambda+`&vartheta;`)*S

(1-p)*Pi+phi*V+delta*R-(mu+k*tau*(C*Upsilon+I)/N+vartheta)*S

(3)

eqn2 := p*Pi+`&vartheta;`*S-(lambda*`&epsilon;`+mu+phi)*V

p*Pi+vartheta*S-(epsilon*k*tau*(C*Upsilon+I)/N+mu+phi)*V

(4)

eqn3 := rho*lambda*S+rho*`&epsilon;`*lambda*V+I*(1-q)*eta-(mu+beta+chi)*C

rho*k*tau*(C*Upsilon+I)*S/N+rho*epsilon*k*tau*(C*Upsilon+I)*V/N+(1-q)*eta*I-(mu+beta+chi)*C

(5)

eqn4 := (1-rho)*lambda*S+(1-rho)*`&epsilon;`*lambda*V+chi*C-I*(mu+alpha+eta)

(1-rho)*k*tau*(C*Upsilon+I)*S/N+(1-rho)*epsilon*k*tau*(C*Upsilon+I)*V/N+chi*C-(mu+alpha+eta)*I

(6)

eqn5 := beta*C+I*q*eta-(mu+delta)*R

beta*C+q*eta*I-(mu+delta)*R

(7)

``


 

Download Equation_for_basic_reproduction_number.mwEquation_for_basic_reproduction_number.mw

Dear all,
Greetings!
I have made a code that solves a nonlinear system of equations by using Newton's Method. I am facing a problem in printing the Jacobian at each iteration. It only prints its lable not the Jacobian matrix itself. Please help me in this regard.
 

"restart;  iter:=5;  f[1](x,y):=3 x^(2)-y^(2);  f[2](x,y):=3 x^()*y^(2)-x^(3)-1;"

5

 

proc (x, y) options operator, arrow; 3*x^2-y^2 end proc

 

proc (x, y) options operator, arrow; 3*x*y^2-x^3-1 end proc

(1)

var := x, y

x, y

(2)

pointt := [x[n], y[n]]

[x[n], y[n]]

(3)

NULL

NULL

NULL

x[0] := 1; y[0] := 1

1

 

1

(4)

for n from 0 to iter do print('f1' = f[1](x[n], y[n]), 'f[2]' = f[2](x[n], y[n])); print('J'*[n] = J[n]); J[n] := Student[MultivariateCalculus][Jacobian]([f[1](x, y), f[2](x, y)], [var] = pointt, output = matrix); sol[n] := eval((Vector(2, {(1) = x[n], (2) = y[n]}))-1/J[n].(Vector(2, {(1) = f[1](x[n], y[n]), (2) = f[2](x[n], y[n])}))); x[n+1] := evalf(sol[n][1]); y[n+1] := evalf(sol[n][2]); print(x[n+1], y[n+1]) end do

f1 = 2, f[2] = 1

 

J*[0] = J[0]

 

.6111111111, .8333333333

 

f1 = .4259259256, f[2] = 0.44924554e-1

 

J*[1] = J[1]

 

HFloat(0.5036590808700434), HFloat(0.8524944221287727)

 

f1 = HFloat(0.03427066946790058), f[2] = HFloat(-0.029666658033242088)

 

J*[2] = J[2]

 

HFloat(0.4999641210723523), HFloat(0.8660456363859079)

 

f1 = HFloat(-1.4267722412308892e-4), f[2] = HFloat(-1.2576398193964167e-6)

 

J*[3] = J[3]

 

HFloat(0.50000000001492), HFloat(0.8660254018170033)

 

f1 = HFloat(3.45245787514159e-9), f[2] = HFloat(-5.089167087746205e-9)

 

J*[4] = J[4]

 

HFloat(0.5), HFloat(0.8660254037844386)

 

f1 = HFloat(1.1102230246251565e-16), f[2] = HFloat(-2.220446049250313e-16)

 

J*[5] = J[5]

 

HFloat(0.5), HFloat(0.8660254037844387)

(5)

NULL

NULL


 

Download q1nwtnnonlinearsys.mw

the print output is too ugly, any help in making it more elegant would also be appreciated .

First 855 856 857 858 859 860 861 Last Page 857 of 2219