Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

If A is an m × n matrix and B is a p × q matrix, then the Kronecker product C = A ⊗ B is the mp × nq block matrix. Assume I have matrix C and want to find matrix A and B. This problem has known solution called "Nearest Kronecker Product". So I just need a function like this: A,B:=NearestKroneckerProduct(C)  which minimizes ||C - A ⊗ B||F  where denotes frobenius norm. 

Here is an Image that shows a mathematica code:

I took it from the link below:

https://mathematica.stackexchange.com/questions/91651/nearest-kronecker-product

Also there is a matlab code:

https://gist.github.com/tholden/58dd9a8991daa750ae36a633fe7060a4/revisions

can you convert mathematica code to maple?

If I do:

df:=DataFrame(Matrix(3,4,[seq(1..12)]), rows=[a,b,c],columns=[A,B,C,D]);Tabulate(df, width=100)

 

The font that Maple uses for the Tablulate is much larger than the font used to display the Dataframe. How does one choose the font size that Tabluate() uses? 

Peter

We put A = {1,2,3,4} and B is the set of lower cubes
to 100 of positive integers.Determine A ∪ B  A ∩ B , A ∩ {6,8} and A \ B 

Hi,

i am trying to solve a differential equation numercially but since it is second degree,I can not achieve the proper answer.What should I do?

thank you
diff1.mw
 

restart

h := 1-.8*x+.5*(x^2-x)

1-1.3*x+.5*x^2

(1)

z := 3^(3/2)*(((2+k*De^2*(diff(p(x), x))^2*h^2)^3*h^2+108*k*De^2)/k)^(1/2)

3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2)

(2)

c := (1/6)*((-54*De+z)*k^2*h^2)^(1/3)/(k*De*h)-(1/2)*h*(2+k*De^2*(diff(p(x), x))^2*h^2)/(De*((-54*De+z)*k^2*h^2)^(1/3))-(1/2)*h*(diff(p(x), x))

(1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x))

(3)

ode1 := ((1/2)*c*(diff(p(x), x))^2*h^4+(diff(p(x), x))*c^2*h^3+(1/10)*(diff(p(x), x))*h^5+c^3*h^2)*k*De^2+(1/2)*c*h^2+(1/6)*(diff(p(x), x))*h^3+h = 0

((1/2)*((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^4+(diff(p(x), x))*((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))^2*(1-1.3*x+.5*x^2)^3+(1/10)*(diff(p(x), x))*(1-1.3*x+.5*x^2)^5+((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))^3*(1-1.3*x+.5*x^2)^2)*k*De^2+(1/2)*((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))*(1-1.3*x+.5*x^2)^2+(1/6)*(diff(p(x), x))*(1-1.3*x+.5*x^2)^3+1-1.3*x+.5*x^2 = 0

(4)

ivp := {ode1, p(0) = 0}

{((1/2)*((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^4+(diff(p(x), x))*((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))^2*(1-1.3*x+.5*x^2)^3+(1/10)*(diff(p(x), x))*(1-1.3*x+.5*x^2)^5+((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))^3*(1-1.3*x+.5*x^2)^2)*k*De^2+(1/2)*((1/6)*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3)/(k*De*(1-1.3*x+.5*x^2))-(1/2)*(1-1.3*x+.5*x^2)*(2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)/(De*((-54*De+3*3^(1/2)*(((2+k*De^2*(diff(p(x), x))^2*(1-1.3*x+.5*x^2)^2)^3*(1-1.3*x+.5*x^2)^2+108*k*De^2)/k)^(1/2))*k^2*(1-1.3*x+.5*x^2)^2)^(1/3))-(1/2)*(1-1.3*x+.5*x^2)*(diff(p(x), x)))*(1-1.3*x+.5*x^2)^2+(1/6)*(diff(p(x), x))*(1-1.3*x+.5*x^2)^3+1-1.3*x+.5*x^2 = 0, p(0) = 0}

(5)

dsolve(ivp, p(x), numeric, parameters = [k, De])

Error, (in dsolve/numeric/make_proc) Could not convert to an explicit first order system due to 'RootOf'

 

``


 

Download diff1.mw

 

 


 

Download diff1.mw

Hello,

Is it possible to expand vector calculus identities directly in Maple without taking them to basis form (i.e. their component partial derivatives).

For example: 

restart

with(Physics[Vectors]):

%Curl(u*%Gradient(v)) = u*%Curl(%Gradient(v)+`&x`(%Gradient(u), %Gradient(v)))

 

Given the Left Hand Side, can Maple come up with the RHS on its own?

Many Thanks.

Please, I need to use Maple to solve Euler-Bernoulli Beam on Pasternak Foundation using Homotopy Perturbation Method.

The governing equation is 

initial conditions are 

the boundary condition is 

The governing equation represents Euler-Bernoulli beam on a generalized Pasternak viscoelastic foundation under an
arbitrary distributed dynamic load. in which E, I , ρ ,A are the parameters of the beam, representing Young’s modulus of elasticity, moment of inertia, density and area of cross section, respectively. K,C and Gp are spring stiffness, damping coefficient, and shear coefficient of the foundation. Moreover, y(x, t) and F(x, t) are defined as the vertical deflection of the beam and the generic arbitrary dynamic loads, respectively, where the loads distribute along the x-axis and t is time.

 

I will appreciate anyone who can help me with a Maple solution.

 

Thank you.

How should wirte a while loop for solve nonlinear equations by newton raphson method

Dear Maple friends~

Recently I am thinking a question about how to use Maple to prove an equation based on a known partial differential equationand its boundary conditions.

Although I can Prove it with hand computation ,it still has some difficulty and it will be really hard if its partial differential equation become more complex(As a matter of fact, it will happen).So I think of Maple and want to take advantage of computer.However,I get few ideas how to realize it .The details are as follows:

alias(u=u(x,t)):
pde:=diff(u,t)-diff(u,x$2,t)+4*u^2*diff(u,x)=3*u*diff(u,x)*diff(u,x$2)+u^2*diff(u,x$3);
N:=5;#actually N can be any positive integer!
bcs:=eval(u,x=-infinity)=0,seq(eval(diff(u,x$ha),x=-infinity)=0,ha=1..N),eval(u,x=infinity)=0,seq(eval(diff(u,x$ha),x=infinity)=0,ha=1..N);
E:=Int(u^4+2*u^2*diff(u,x)^2-diff(u,x)^4/3,x=-infinity..infinity);

#try to prove the following equation
diff(E,t)=0

The written proof is as follows:

Therfore,I submit such a problem and look forward your solutions and suggestions sincerely~

Hello,

How I can write a code for the determination of Laplacian in a new form that is introduced in the maple code (First line).

Thank you.

FOR

Maple Worksheet - Error

Failed to load the worksheet //convert/FOR
 

Download FOR

 

 

How may I please use maple tools in communication engineering applications. May I please have any example model

I'm trying to use the ExpectedValue function to get the next close value of a stock.

restart; with(Finance)

W := WienerProcess()

T := 1.0

S := SamplePath(W(t), t = 0 .. T, timesteps = 100, replications = 10^4)

A := S[1 .. 10^4, 50]

TI := 1

AN := 100 (Start Value)

sigma := 3.5 (volatility)

r := 0.5e-1    (interest)

ANF := AN*exp((r-(1/2)*sigma^2)*TI+sigma*W(TI))       (ANF: is the forecasting Value)

ExpectedValue(ANF, timesteps = 100, replications = 10^3)

Is this approach right?

How i can generate Pr matrix when P= -x and x0=-1 , x1=-2/3 , x2=-1/3 , and x3=0 with the help loop?

Hello, i am experiencing some problems when trying to open the maple 2018 software*
I have tried unistalling and download it again.
I have tried to search for sollution but there is very ittle intel
When i open Maple 2018 it just lingeres on the start up (pic below) and just disappears after 10 seconds

Can someone please help i have a very important examination upcoming

how we can get matrix of p[2],p[0] and p[1] when p[2]=1,p[0]=1 and  p[1]=-x and x[0]=-1,x[1]=-2/3 ,x[3]=0 when the general matrices of p are given below.....and answer should be p[2]=p[0]= identity matrix and p[1]= only diagonal values are 1,2/3,1/3,0..

I am using external library function but it shows following error. please help.

 

dll.mw

First 82 83 84 85 86 87 88 Last Page 84 of 2097