Maple 2018 Questions and Posts

These are Posts and Questions associated with the product, Maple 2018

Using the definition of a derivative as a limit i.e., lim h->0  f(x+h)-f(x)/h  .Find the derivative of the following functions:

a) f(x)=3x^3-2x^2+5x-7

 

how do i solve and type in maple? please help

Hi, I've created an array from a do loop, where the number in the array is the number of degrees for which I've calculated the answer, I now wish to graph the angle against the value in the array. i.e. the value a[50]=156.21 should graph to the point (50,156.21). Ideally as well I'd like for it to be joined up by a smooth curve of best fit, but I'll take what I can get, I can't seem to figure out how to plot it at all at the moment.

See code below:

restart;

for i from 50 by 5 to 85 do
ThetaBn := (1/180)*i*Pi;
s := cos(2*ThetaBn)*x+(2*sin(ThetaBn)*sin(ThetaBn))*sin(x);
a[i] := 180.0*fsolve(s = 0, x, 1 .. 6)*(1/Pi)
end do;

 

Thanks

I would like to understand why the 'solve' command is unable to find any solution to the system of equation { x^2=2, x^3=2*sqrt(2) }  (which obviously has a unique solution x=sqrt(2) ). The syntax that I used is
> solve({x^2 = 2, x^3 = sqrt(2)^3}, [x]);
and the output is the empty list.

I suspect that this is related to the presence of the algebraic number sqrt(2). Does anyone have a better understanding ?

I am using Maple version 2018.0, build ID 1298750.

Thank you.

I discovered incidentally that the command  Matrix(3, 3, `-`) (the number 3 is purely illustrative) returned the same result than the command Matrix(3, 3, (i,j) -> i-j).
In the same way `+` realizes (i,j) -> i+j), `*` realizes (i,j) -> i*j), ...

More surprisingly `.` realizes (i,j) -> i*j while I'm in worksheet mode, with "old" maple input style, and that the command 2.3 does not answer 6 but concatenates 2 and 3.

Is this a known behaviour or an undocumented feature?

 

 

 

 

 

Hello,

I am attempting to check solutions to a system of ODEs using odetest. However, odetest only appears to partially substitute the provided solution. Furthermore, it appears to be related to the alphabetical order of the functions.

For instance, here I have two functions, phiL and phiM, that satisfy Laplace's equation and are coupled through the boundary conditions, BCs.

laplace := {-phiL(z) + diff(phiL(z),z$2)=0, -phiM(z) + diff(phiM(z),z$2)=0}:
BCs := {phiL(d1)=0,phiM(-d1)=0,phiL(0)=phiM(0), D(phiL)(0)-D(phiM)(0)=-n}:
sol := {
phiM(z) = n/2/coth(d1)*(cosh(z)+coth(d1)*sinh(z)),
phiL(z) = n/2/coth(d1)*(cosh(z)-coth(d1)*sinh(z))
}:

odetest(sol, laplace union BCs,{phiL(z),phiM(z)});

This returns

{0, 1/2*(2*phiL(0)*coth(d1)-n)/coth(d1), D(phiM)(0)-1/2*n}

Here, phiL(0) and phiM(0) are unevaluated even though the provided solutions are valid there.

Furthermore, while renaming phiL to an alphabetically earlier name (eg, phiJ) causes the corresponding change in the output. However, renaming it to something alphabetically after phiM (eg, phiN) causes the terms in the output to switch. That is, changing phiL to phiN in the above code results in

{0, 1/2*(2*phiM(0)*coth(d1)-n)/coth(d1), D(phiN)(0)+1/2*n}

Therefore, it seems to be related to the way Maple internally stores the list of variables.

Is this a bug? Or is there something I'm missing?

Thanks!

My question has two steps:

STEP 1:  The multiplication  of is defined as follows

 

if n<>l, then

.

if n=l and m<=s,

Question 1: I wrote a code for calculating the multiplication  of. Is it right?

The code for Step 1  

restart;

multiply:=proc(n,m,l,s) local g,a: 
a:=unapply(doublefactorial(2*j-1)/factorial(j),j):
g:=unapply((a(m-j)*a(j)*a(s-j)/a(m+s-j))*(2*m+2*s-4*j+1)/(2*m+2*s-2*j+1),j):

if n<>l then 0 else
sqrt((2*m+1)*(2*s+1))*2^(K/2-1).add((g(j)/sqrt(m+s-2*j+1/2))*phi[n, m+s-2*j],j=0..m) 
end if
end proc:
 
n:=2:
l:=2:
m:=1:
s:=1:
multiply(n,m,l,s);

when I compared the results which I got and the results which is given in the book as follows, I think it is right.

Step 2:

We know that the outer product matrix is calculated as follows 

  

We found the elements of the outer product matrix in Step 1. 

Question 2 : I want to write the elements which are derived in step 1 to the outer product matrix in step 2. In here, the outer product matrix is NxN matrix. N=(M+1).2^(K-1) where K, M are any integers.

Hello

Could you please help me to solve the following problem

I want to catch the optimized values for df, tf, hw, and tw using considered constraint.

Thank you very much.

Dear Community,

 

I'm trying to import a simple Excel (xlsx) file into my Maple worksheet.

1st problem: Maple reads it only, if I put it into my root directory. As soon as I try to read it from the directory I'm working in, and provide full file name (Path + file name)  it fails. Why?

2nd problem: The real surprise comes, when I manage to import it. Its a 150 x 2 matrix, but as soon as I try to retrieve a value, I get an error message "Error, bad index into Matrix". Why is this? Should be very simple. Files attached.

 

Tx in advance

best regards

Andras

ImportTest.mw

RC_Rate_Schedule.xlsx


Suggestions for a Maple program entering the coordinates of three points and giving the equation of the circle passing through these three points, non-aligned?
Thank you.

 

 

This application solves a set of compatible equations of two variables. It also graphs the intersection point of the variable "x" and "y". If we want to observe the intersection point closer we will use the zoom button that is activated when manipulating the graph. If we want to change the variable ("x" and "y") we enter the code of the button that solves and graphs. In spanish.

System_of_Equations_Determined_Compatible_2x2_and_3x3.mw

Lenin Araujo Castillo

Ambassador of Maple


Hello everyone! 

I have the following Maple code: 

with(CurveFitting); with(plottools); with(Statistics); A := [[1.364, 0.64765768e-1], [2.05, -.182176113], [2.664, -0.13914542e-1], [2.728, 0.2193938e-1], [4.092, -0.18349139e-1], [4.1, -.312968801], [5.328, -0.1819837e-2], [5.456, -.28840961], [6.15, -.57076866], [7.992, .175022254]];
F := LeastSquares(A, x);
plot([F, A], x = 0 .. 8, legend = ["Метод наименьших квадратов", "Экспериментальные данные"], legendstyle = [font = ["Roman", 15]], labels = ["d, ìì", "ln(I/I_0)"], labelfont = ["Roman", 15], labeldirections = ["horizontal", "vertical"], axesfont = ["ROMAN", "ROMAN", 15], color = [red, blue], style = [line, point], linestyle = [solid], symbolsize = 20, title = "Определение линейного коэффициента поглощения", titlefont = [Roman, bold, 20]);

This produces a plot:

How can I add error bars to the points that are colored in blue?

Thank you in advance for any help!

Hello all,

I'm trying to do kinetic modeling of sequential dissociations with DE. I'm hitting a snag when modeling the third dissociation. The population should start at zero at t=0, but some of my model functions are non-zero at t=0. Is there anyway to fix this to force the funtions to go through zero?

Scheme:
PPPP -> intermediates -> PPP -> intermediates -> PP -> intermediates -> P  
(where P is a subunit and intermediates are confirmational changes before dissociation of a subunit)

a'..d' is the first dissociation
e' is the second dissociation
f'..l' is the third dissociation
Fits are evaluated by the residual sum of squares.

sol := dsolve([a' = -k1*a(x), b' = k1*a(x)-k1*b(x), c' = k1*b(x)-k1*c(x), d' = k1*c(x)-k1*d(x),
e' = k1*d(x)-k2*e(x), 
f' = k2*e(x)-k3*f(x), g' = k3*f(x)-k3*g(x), h' = k3*g(x)-k3*h(x), i' = k3*h(x)-k3*i(x), j' = k3*i(x)-k3*j(x), k' = k3*j(x)-k3*k(x), l' = k3*k(x)-k3*l(x), 
a(0) = 1, b(0) = 0, c(0) = 0, d(0) = 0, e(0) = 0, f(0) = 0, g(0) = 0, h(0) = 0, i(0) = 0, j(0) = 0, k(0) = 0, l(0) = 0],
{a(x), b(x), c(x), d(x), e(x), f(x), g(x), h(x), i(x), j(x), k(x), l(x)}, method = laplace);

f1 := sol[6];
f1 := rhs(f1);
g1 := sol[7];
g1 := rhs(g1);
h1 := sol[8];
h1 := rhs(h1);
i1 := sol[9];
i1 := rhs(i1);
j1 := sol[10];
j1 := rhs(j1);
kk := sol[11];
kk := rhs(kk);
l1 := sol[12];
l1 := rhs(l1);

xdata := Vector([0,10,20,30,40,50,60,70,80,90,100,110,120,130,140,150,160,170,180,200,210,220,230,240,250,260,270,280,290,300,310,320,330,340,350,360,370,380,390,400], datatype = float);
ydata := Vector([0.0034,0.00392,0.00184,0.00782,0.01873,0.03683,0.11016,0.09838,0.18402,0.24727,0.20901,0.2972,0.37635,0.49235,0.57845,0.4457,0.50285,0.5672,0.62783,0.57264,0.54918,0.44792,0.49795,0.55218,0.47512,0.46473,0.37989,0.32236,0.3323,0.20894,0.28473,0.21273,0.19855,0.13548,0.12725,0.13277,0.0784,0.07969,0.06162,0.03855], datatype = float);

k1 := 0.391491454107626e-1; 
k2 := 0.222503562261129e-1; 


z1:=f1;
z2:=f1+g1;
z3:=f1+g1+h1;
z4:=f1+g1+h1+i1;
z5:=f1+g1+h1+i1+j1;
z6:=f1+g1+h1+i1+j1+kk;
z7:=f1+g1+h1+i1+j1+kk+l1;

Statistics[NonlinearFit](z1,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z1,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z2,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z2,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z3,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z3,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z4,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z4,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z5,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z5,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z6,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z6,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

Statistics[NonlinearFit](z7,xdata, ydata, x, initialvalues = [k3=0.1], output = [parametervalues, residualsumofsquares]); 
A:=plot(xdata, ydata, style=point, symbol=solidcircle, color=blue, symbolsize=12,labels = ["time (minutes)", "Relative Abundance"], labeldirections = [horizontal, vertical]):
F:=Statistics[NonlinearFit](z7,xdata, ydata, x,initialvalues = [k3=0.1]):
B:=plot(F, x=xdata[1]..xdata[-1], color=red):
plots[display](A, B);

3rd_diss.mw

Dear All,

Gretting from me. I have faced a problem in Maple program due to some errors. Could you please help me about the solution of that problem?
Thanks

@Preben Alsholm
@tomleslie
Sourse File: solution.mw

Duo:=proc(a)  #a nombre congruent connu
local u,v,n,m,k,t:
t:=8000:
for m to t do
  for n to m do
    if (igcd(m,n)=1 and m>n) then
      u:=(m^2-n^2-2*m*n)^2:v:=(m^2+n^2)^2:
      k:=op(2,sqrt(v-u))^2: # k nombre congruent réduit
        if k=a then return (m,n): break 
        elif n=t then break fi:
    fi:
  od:
od:
end:

Duo(30);
                              3, 2
Duo(1794);
                             26, 23
Duo(6);
                              2, 1
u, v, w sont des carrés en progression arithmétique dont la raison est un nombre congruent
Procédure permettant de trouver un triplet pythagoricien primitif correspondant au nombre congruent a connu
TriPy:=proc(m,n)# triangles pythagoriciens
local a,a1,b1,c1,d,k,q,u,v,w:
 if (igcd(m,n)=1 and m>n) then
 u:=(m^2-n^2-2*m*n)^2:v:=(m^2+n^2)^2:w:=(m^2-n^2+2*m*n)^2:
 a:=(op(2,sqrt(v-u)))^2:#nombre congruent réduit
 a1:=2*m*n:b1:=(m^2-n^2):c1:=m^2+n^2:
 q:=sqrt((v-u)/a)/2:#rapport de réduction
 print(a1/q,b1/q,c1/q):fi
end:
TriPy(Duo(34));
                              17  145
                          24, --, ---
                              6    6 

TriPy(Duo(39));
                          156  5  313
                          ---, -, ---
                           5   2  10 

TriPy(Duo(111));
                         444  35  1513
                         ---, --, ----
                         35   2    70 
TriPy(Duo(1794));
                         1196      1205
                         ----, 21, ----
                          7         7  
TriPy(Duo(23));don't work, "part dans les choux"

How  I can use from equations 1-6 and repleacing them into equation 7 to remove qx,qy,qz?

Thank you

simpl2.mw
 

A := q__x(x, y, z, t)+`&tau;__q`*(diff(q__x(x, y, z, t), t))+(1/2)*`&tau;__q`^2*(diff(q__x(x, y, z, t), t, t)) = -k*(diff(T(x, y, z, t), x))-k*`&tau;__T`*(diff(T(x, y, z, t), x, t))-(1/2)*k*`&tau;__T`^2*(diff(T(x, y, z, t), x, t, t))
NULL

q__x(x, y, z, t)+tau__q*(diff(q__x(x, y, z, t), t))+(1/2)*tau__q^2*(diff(diff(q__x(x, y, z, t), t), t)) = -k*(diff(T(x, y, z, t), x))-k*tau__T*(diff(diff(T(x, y, z, t), t), x))-(1/2)*k*tau__T^2*(diff(diff(diff(T(x, y, z, t), t), t), x))

(1)

A__x := diff(A, x)

diff(q__x(x, y, z, t), x)+tau__q*(diff(diff(q__x(x, y, z, t), t), x))+(1/2)*tau__q^2*(diff(diff(diff(q__x(x, y, z, t), t), t), x)) = -k*(diff(diff(T(x, y, z, t), x), x))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), x), x))-(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), x), x))

(2)

NULL

B := q__y(x, y, z, t)+`&tau;__q`*(diff(q__y(x, y, z, t), t))+(1/2)*`&tau;__q`^2*(diff(q__y(x, y, z, t), t, t)) = -k*(diff(T(x, y, z, t), y))-k*`&tau;__T`*(diff(T(x, y, z, t), y, t))-(1/2)*k*`&tau;__T`^2*(diff(T(x, y, z, t), y, t, t))

q__y(x, y, z, t)+tau__q*(diff(q__y(x, y, z, t), t))+(1/2)*tau__q^2*(diff(diff(q__y(x, y, z, t), t), t)) = -k*(diff(T(x, y, z, t), y))-k*tau__T*(diff(diff(T(x, y, z, t), t), y))-(1/2)*k*tau__T^2*(diff(diff(diff(T(x, y, z, t), t), t), y))

(3)

B__y := diff(B, y)

diff(q__y(x, y, z, t), y)+tau__q*(diff(diff(q__y(x, y, z, t), t), y))+(1/2)*tau__q^2*(diff(diff(diff(q__y(x, y, z, t), t), t), y)) = -k*(diff(diff(T(x, y, z, t), y), y))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), y), y))-(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), y), y))

(4)

NULL

C := q__z(x, y, z, t)+`&tau;__q`*(diff(q__z(x, y, z, t), t))+(1/2)*`&tau;__q`^2*(diff(q__z(x, y, z, t), t, t)) = -k*(diff(T(x, y, z, t), z))-k*`&tau;__T`*(diff(T(x, y, z, t), z, t))-(1/2)*k*`&tau;__T`^2*(diff(T(x, y, z, t), z, t, t))

q__z(x, y, z, t)+tau__q*(diff(q__z(x, y, z, t), t))+(1/2)*tau__q^2*(diff(diff(q__z(x, y, z, t), t), t)) = -k*(diff(T(x, y, z, t), z))-k*tau__T*(diff(diff(T(x, y, z, t), t), z))-(1/2)*k*tau__T^2*(diff(diff(diff(T(x, y, z, t), t), t), z))

(5)

C__z := diff(C, z)

diff(q__z(x, y, z, t), z)+tau__q*(diff(diff(q__z(x, y, z, t), t), z))+(1/2)*tau__q^2*(diff(diff(diff(q__z(x, y, z, t), t), t), z)) = -k*(diff(diff(T(x, y, z, t), z), z))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), z), z))-(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), z), z))

(6)

NULL

expand(simplify(-A__x-B__y-C__z+Q = rho*c__p*(diff(T(x, y, z, t), t))))

(-(diff(q__x(x, y, z, t), x))-tau__q*(diff(diff(q__x(x, y, z, t), t), x))-(1/2)*tau__q^2*(diff(diff(diff(q__x(x, y, z, t), t), t), x))-(diff(q__y(x, y, z, t), y))-tau__q*(diff(diff(q__y(x, y, z, t), t), y))-(1/2)*tau__q^2*(diff(diff(diff(q__y(x, y, z, t), t), t), y))-(diff(q__z(x, y, z, t), z))-tau__q*(diff(diff(q__z(x, y, z, t), t), z))-(1/2)*tau__q^2*(diff(diff(diff(q__z(x, y, z, t), t), t), z))+Q = k*(diff(diff(T(x, y, z, t), x), x))+k*tau__T*(diff(diff(diff(T(x, y, z, t), t), x), x))+(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), x), x))+k*(diff(diff(T(x, y, z, t), y), y))+k*tau__T*(diff(diff(diff(T(x, y, z, t), t), y), y))+(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), y), y))+k*(diff(diff(T(x, y, z, t), z), z))+k*tau__T*(diff(diff(diff(T(x, y, z, t), t), z), z))+(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), z), z))+Q) = rho*c__p*(diff(T(x, y, z, t), t))

(7)

NULL

``


 

Download simpl2.mw

 

First 7 8 9 10 11 12 13 Last Page 9 of 40