Maple Questions and Posts

These are Posts and Questions associated with the product, Maple


I have an object in 6d I'd like to visualise. The region of 6d space I am interested in is described by these equations:

{f[10] = -(.2000000000*(5.*f[21]*f[20]*f[22]-5.*f[20]*f[22]^2+20.*f[20]*f[21]-20.*f[20]*f[22]+135.*f[20]+46.*f[21]))/(f[21]*(f[21]-1.*f[22])),
f[11] = -1.*f[22]-4.,
f[12] = -(1.*(f[22]^2+4.*f[22]-27.))/f[21],
f[20] = f[20],
f[21] = f[21],
f[22] = f[22]}

clearly the first three variables are dependant, and the latter three are independant. I'd like to graph the first three as the latter three vary between bounds and then colour the points on the output based on where they came from in the input, so i can get some intuition about what these equations mean.
 

Consider f is a polynomial which is constructed from some polynomials. In other words, f=g_1^{k_1}*g_2^{k_2}*...*g_n^{k_n} where  g_1,g_2,..,g_n are some polynomials and also  k_1,k_2,..,k_n are positive integer numbers.

My question: How to define a procedure such that the output of proc(f) is the following list [g_1 , g_2 , ... g_n]. In fact, the procedure separates the factors of the polynomial f into  a list and also removes the powers of the factors. 

For example, suppose that f=x*(x+1)^4*(x^2+x+1)*(x^3+x^2+1)^5. Then, the output of the proc(f) be as follows [x , x+1 , x^2+x+1 , x^3+x^2+1].

Thanks in advance

I wonder if it is possible to automatically obtain the well-known  binomial theorem  for an arbitrary integer and a positive exponent  n  in Maple. The expansion  (1)  below  I want to get in Maple automatically. But all my attempts were unsuccessful:
 

restart;

(a+b)^n=Sum(binomial(n,k)*a^(n-k)*b^k, k=0..n);  # The binomial theorem

(a+b)^n = Sum(binomial(n, k)*a^(n-k)*b^k, k = 0 .. n)

(1)

expand((a+b)^n) assuming n::posint;
convert((a+b)^n, Sum) assuming n::posint;
convert((a+b)^n, polynom) assuming n::posint;
convert((a+b)^n, binomial) assuming n::posint;

 

(a+b)^n

 

(a+b)^n

 

(a+b)^n

 

(a+b)^n

(2)

 


 

Download binomial_theorem.mw

I am trying to price an option with the explicit fnite difference method. The code works up until   but does not run after that. Any help would be greatly appreicated 


I tried to solve this double integral in Maple but didn't get the solution so how can I solve this?

Please help

restart

a := .5

.5

(1)

b := .6

.6

(2)

R := 0.1e-1

0.1e-1

(3)

E := 210000000000/(1-.3^2)

0.2307692308e12

(4)

h := a/(2*sqrt(-2*y^2+1))

.2500000000/(-2*y^2+1)^(1/2)

(5)

F1 := sqrt(tan((1/2)*Pi*h)/((1/2)*Pi*h))*[.752+2.02*h+.37*(1-sin((1/2)*Pi*h))^3]/cos((1/2)*Pi*h)

2.828427125*(tan(.1250000000*Pi/(-2*y^2+1)^(1/2))*(-2*y^2+1)^(1/2)/Pi)^(1/2)*[.752+.5050000000/(-2*y^2+1)^(1/2)+.37*(1-sin(.1250000000*Pi/(-2*y^2+1)^(1/2)))^3]/cos(.1250000000*Pi/(-2*y^2+1)^(1/2))

(6)

F4 := sqrt(tan((1/2)*Pi*h)/((1/2)*Pi*h))

2.828427125*(tan(.1250000000*Pi/(-2*y^2+1)^(1/2))*(-2*y^2+1)^(1/2)/Pi)^(1/2)

(7)

C1 := (1/2)*u*(F1^2+1.3*F4^2)/(Pi*E*R)

0.2166666666e-9*u*(8.000000001*tan(.1250000000*Pi/(-2*y^2+1)^(1/2))*(-2*y^2+1)^(1/2)*[.752+.5050000000/(-2*y^2+1)^(1/2)+.37*(1-sin(.1250000000*Pi/(-2*y^2+1)^(1/2)))^3]^2/(Pi*cos(.1250000000*Pi/(-2*y^2+1)^(1/2))^2)+10.40000000*tan(.1250000000*Pi/(-2*y^2+1)^(1/2))*(-2*y^2+1)^(1/2)/Pi)/Pi

(8)

B := int(int(C1, u = 0 .. a), y = -b .. b)

int(0.2195292312e-10*tan(.3926990817/(-2.*y^2+1.)^(1/2))*(-2.*y^2+1.)^(1/2)*[.7520000000+.5050000000/(-2.*y^2+1.)^(1/2)+.3700000000*(1.-1.*sin(.3926990817/(-2.*y^2+1.)^(1/2)))^3]^2/cos(.3926990817/(-2.*y^2+1.)^(1/2))^2+0.2853880005e-10*tan(.3926990817/(-2.*y^2+1.)^(1/2))*(-2.*y^2+1.)^(1/2), y = -.6 .. .6)

(9)

evalf(B)

int(0.2195292312e-10*tan(.3926990817/(-2.*y^2+1.)^(1/2))*(-2.*y^2+1.)^(1/2)*[.7520000000+.5050000000/(-2.*y^2+1.)^(1/2)+.3700000000*(1.-1.*sin(.3926990817/(-2.*y^2+1.)^(1/2)))^3]^2/cos(.3926990817/(-2.*y^2+1.)^(1/2))^2+0.2853880005e-10*tan(.3926990817/(-2.*y^2+1.)^(1/2))*(-2.*y^2+1.)^(1/2), y = -.6 .. .6)

(10)

 

(11)

``


 

Download mapleprime.mw

Can Maple perform huge calculations via parallel-pooling (i.e working on multiple or all CPUs) similar to Matlab?

verify(2*cos(phi)^2-1, cos(2*phi), equal); returns FAIL even though is a trig identify. Any ideas why?
 

Maple currently can't integrate things like sin(x)^n or cos(x)^n. These have antiderivative in terms of  hypergeometric functions.

Is there a technical reason why Maple at version 18 still can't integrate these? Will it be able to in next version?

int(cos(x)^k, x) 
int(sin(x)^k, x) 

fyi, These are the antiderivatives

Same problem for tan(x)^n....  I am asking because Maple is able to solve many ODE's but some results contains unevaluated integrals such as the above. 

 

When making this call to dsolve

 

restart;
ode:=diff(y(x),x)=1:
stopat(dsolve);
dsolve(ode,y(x));

Then in the debugger, I see that dsolve signature is

dsolve := proc(ODEs::{anything} := NULL, 
                {atomizenames::truefalse := true, build::truefalse := false, type::name := 'none'})

When typing print(ODEs) inside the debugger, it gives "diff(y(x),x)=1" which is correct.

But where is the second argument I passed to dsolve in the above call, which is "y(x)" gone?  I also do print(_nparams) inside the debugger and Maple returns 1 and not 2.

I expected to see 2 since I passed in two arguments to dsolve.

dsolve actually works without passing y(x), as follows

dsolve(ode);

And it seems Maple figure inside what is the dependent variable.

But my question is, is the second argument being thrown away before calling dsolve? If not, why it does not show in the debugger?   Is there some other pre-processing being done between the time the user calls dsolve() and the time the debugger is called?

 

 

 

So i have beeing working with finite elements and i have the stifness matrix that i came with Maple as you can see here:

Ke := Matrix(4, 4, {(1, 1) = (12*I)*E/l^3, (1, 2) = (6*I)*E/l^2, (1, 3) = -(12*I)*E/l^3, (1, 4) = (6*I)*E/l^2, (2, 1) = (6*I)*E/l^2, (2, 2) = (4*I)*E/l, (2, 3) = -(6*I)*E/l^2, (2, 4) = (2*I)*E/l, (3, 1) = -(12*I)*E/l^3, (3, 2) = -(6*I)*E/l^2, (3, 3) = (12*I)*E/l^3, (3, 4) = -(6*I)*E/l^2, (4, 1) = (6*I)*E/l^2, (4, 2) = (2*I)*E/l, (4, 3) = -(6*I)*E/l^2, (4, 4) = (4*I)*E/l})

How can i re-write this matrix to put in this form:


Thanks

Hi, everybody.

Is there a command or a way to assign an initial value to animate plot?

Trivial example:

animate(plot,[m*x,x=-10..10],m=-10..10)

but initial value for m would be m=1 so the initial render will present the line with slope 1.

As always, thank you all in advanced.

 

Throughout the course of a year, Maple users create wildly varying applications on all sorts of subjects. To mark the end of 2018, I thought I’d share some of the 2018 submissions to the Maple Application Center that I personally found particularly interesting.

Solving the 15-puzzle, by Curtis Bright. You know those puzzles where you have to move the pieces around inside a square to put them in order, and there’s only one free space to move into?  I’m not good at those puzzles, but it turns out Maple can help. This is one of collection of new, varied applications using Maple’s SAT solvers (if you want to solve the world’s hardest Sudoku, Maple’s SAT solvers can help with that, too).

Romeo y Julieta: Un clasico de las historias de amor... y de las ecuaciones diferenciales [Romeo and Juliet: A classic story of love..and differential equations], by Ranferi Gutierrez. This one made me laugh (and even more so once I put some of it in google translate, which is more than enough to let you appreciate the application even if you don’t speak Spanish). What’s not to like about modeling a high drama love story using DEs?

Prediction of malignant/benign of breast mass with DNN classifier, by Sophie Tan. Machine learning can save lives.

Hybrid Image of a Cat and a Dog, by Samir Khan. Signal processing can be more fun that I realized. This is one of those crazy optical illusions where the picture changes depending on how far away you are.

Beyond the 8 Queens Problem, by Yury Zavarovsky. In true mathematical fashion, why have 8 queens when you can have n?  (If you are interested in this problem, you can also see a different solution that uses SAT solvers.)

Gödel's Universe, by Frank Wang.  Can’t say I understood much of it, but it involves Gödel, Einstein, and Hawking, so I don’t need to understand it to find it interesting.

i have two ode equations, when try to solve, i face this error
Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system
any comment or help to solve this? ( or any simplifying comments to solve) . thnx in advance

 

restart

A := 4263736263.736263:B := 11868131.86813187:C := 600146.5201465202:hr := 0.3e7:muz := 0.2632654643708247e-5:P:=1000:

1000

(1)

ode1 := diff(u(r), r, r)+(diff(u(r), r))/r-u(r)/r^2-B*(diff(w(r), r, r, r)+(diff(w(r), r, r))/r-(diff(w(r), r))/r^2)/A = 0;

diff(diff(u(r), r), r)+(diff(u(r), r))/r-u(r)/r^2-0.2783505155e-2*(diff(diff(diff(w(r), r), r), r))-0.2783505155e-2*(diff(diff(w(r), r), r))/r+0.2783505155e-2*(diff(w(r), r))/r^2 = 0

(2)

ode2 := C*(diff(w(r), r, r, r, r))+2*C*(diff(w(r), r, r, r))/r-(C/r^2+muz*hr^2)*(diff(w(r), r, r))+(C/r^3-muz*hr^2/r)*(diff(w(r), r))+muz*hr^2*w(r)/r^2-B*(diff(u(r), r, r, r))-2*B*(diff(u(r), r, r))/r+B*(diff(u(r), r))/r^2-B*u(r)/r^3 = P;

600146.5201465202*(diff(diff(diff(diff(w(r), r), r), r), r))+1200293.040*(diff(diff(diff(w(r), r), r), r))/r-(600146.5201465202/r^2+23693891.80)*(diff(diff(w(r), r), r))+(600146.5201465202/r^3-23693891.80/r)*(diff(w(r), r))+23693891.80*w(r)/r^2-11868131.86813187*(diff(diff(diff(u(r), r), r), r))-23736263.74*(diff(diff(u(r), r), r))/r+11868131.86813187*(diff(u(r), r))/r^2-11868131.86813187*u(r)/r^3 = 1000

(3)

ics := w(.2) = 0, (D(w))(.2) = 0, w(1) = 0, (D(w))(1) = 0, u(.2) = 0, u(1) = 0;

w(.2) = 0, (D(w))(.2) = 0, w(1) = 0, (D(w))(1) = 0, u(.2) = 0, u(1) = 0

(4)

dsolve({ode1,ode2} union {ics},{w(r),u(r)},numeric)

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system

 

 

 

Download zzv.mw

Hi!

I want to plot the approximation of a surface by polynomials. The surface is given by (x,y,f(x,y)) where f(x,y) is given by the following expression

proc (x) options operator, arrow; (sum(i*cos((i+1)*(-2+4*x[1])+i), i = 1 .. 5))*(sum(i*cos((i+1)*(-2+4*x[2])+i), i = 1 .. 5)) end proc

with both variables varying in the interval [0,1]. Then, by using the Bernstein polynomials of two variables (see, for instance, this paper for details  https://www.sciencedirect.com/science/article/pii/0021904589900956), the graph of the resulting (plot3d) surface (x,y,p(x,y))  it is not even like to the original surfaces.

Please, see this PDF of what I have done:  plots.pdf

Some idea or suggestion?

Thanks!

Good day everyone.

Please can help me with this code on the taylor series expansion involving Fractional Differential Equation (FDE)? Particularlly, the lines highlighted blue and green respectively in relation to FDE.

Thank you and kind regards

#k=2
restart:q:=n*h:
P:=sum((a[k]*x^(k))/GAMMA(k+1-alpha), k=0..3):
assume(alpha>0,alpha < 1):
Q:=fracdiff(P,x,alpha):
e1:=simplify(eval(P, x=q+h))=y[n+1]:
e2:=simplify(eval(Q,x=q))=f[n]:
e3:=simplify(eval(Q,x=q+h))=f[n+1]:
e4:=simplify(eval(Q,x=q+2*h))=f[n+2]:
var:=seq(a[i], i=0..3):
M:=e||(1..4):

Cc:=eval(<var>, solve(eval({M}),{var}) ):
for i from 1 to 4 do
	a[i-1]:=Cc[i]:
end do:
Cf:=P:
E:=collect(Cf, [y[n+1], f[n], f[n+1],f[n+2]], recursive):
print():
s2:=y[n+2]=simplify(eval(Cf, x=q+2*h)):
collect(%, [y[n+1], f[n], f[n+1],f[n+2]], recursive):

s1:=y[n]=simplify(eval(Cf, x=q)):
collect(%, [y[n+1], f[n], f[n+1],f[n+2]], recursive):

Y[n+1]:=convert(taylor(y(x+h),h=0,12),polynom):
F[n]:=convert(taylor((D(y))(x), h = 0,12), polynom):
F[n+1]:=convert(taylor((D(y))(x+h), h = 0,12), polynom):
F[n+2]:=convert(taylor((D(y))(x+2*h), h = 0,12), polynom):


W:=asympt(expand(eval(rhs(s2),[y[n+1]=Y[n+1],f[n]=F[n],f[n+1]=F[n+1],f[n+2]=F[n+2]])),h,6);
X:=convert(taylor(y(x+2*h),h=0,12),polynom)-W;
lte:=convert(asympt(X,h,8),polynom);

 

 

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