Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

https://drive.google.com/file/d/0B2D69u2pweEvMV92SGhtRGZONFk/edit?usp=sharing

a error and code in this attachment mw

i can pdsolve it, but numeric pdsolve it get error

Hi -

 

    It is often useful useful to generate two procedures --- one to evaluate a function and one to evaluate its gradient.  The procedure codegen[GRADIENT] does not treat functions of array variables.  Why doesn't GRADIENT support array variables?  Would it be possible to replace the array variables by variables, apply GRADIENT, and then replace the array variables by variables again?

 

Best wishes,

David

 

https://drive.google.com/file/d/0B2D69u2pweEvU3NpWWQwS3U1XzQ/edit?usp=sharing
https://drive.google.com/file/d/0B2D69u2pweEvMnFabkdiX1hpYVk/edit?usp=sharing

 

a1 := Diff(x1(s,t),s$2) = a*x1(s,t)+b*x2(s,t)+c*x3(s,t)+d*u(t);
a2 := Diff(x1(s,t),t)=x1(s,t);
b1 := Diff(x2(s,t),s$2) = e*x1(s,t)+f*x2(s,t)+g*x3(s,t)+h*u(t);
b2 := Diff(x2(s,t),t)=x2(s,t);
c1 := Diff(x3(s,t),s$2) = i*x1(s,t)+j*x2(s,t)+k*x3(s,t)+l*u(t);
c2 := Diff(x3(s,t),t)=x3(s,t);
sys := [a1, a2, b1, b2, c1, c2];
sol := pdsolve(sys);

length exceed limit

Hi,

I get the error in the following code

restart:

gama1:=0.01:

zet:=0;
#phi0:=0.00789:
Phiavg:=0.02;
lambda:=0.01;
Ha:=1;


                               0
                              0.02
                              0.01
                               1
rhocu:=2/(1-zet^2)*int((1-eta)*rho(eta)*c(eta)*u(eta),eta=0..1-zet):

eq1:=diff(u(eta),eta,eta)+1/(mu(eta)/mu1[w])*(1-Ha^2*u(eta))+((1/(eta)+1/mu(eta)*(mu_phi*diff(phi(eta),eta)))*diff(u(eta),eta));
eq2:=diff(T(eta),eta,eta)+1/(k(eta)/k1[w])*(-2/(1-zet^2)*rho(eta)*c(eta)*u(eta)/(p2*10000)+( (a[k1]+2*b[k1]*phi(eta))/(1+a[k1]*phi1[w]+b[k1]*phi1[w]^2)*diff(phi(eta),eta)+k(eta)/k1[w]/(eta)*diff(T(eta),eta) ));
eq3:=diff(phi(eta),eta)+phi(eta)/(N[bt]*(1+gama1*T(eta))^2)*diff(T(eta),eta);
      /  d   /  d         \\   mu1[w] (1 - u(eta))
      |----- |----- u(eta)|| + -------------------
      \ deta \ deta       //         mu(eta)      

           /             /  d           \\               
           |      mu_phi |----- phi(eta)||               
           | 1           \ deta         /| /  d         \
         + |--- + -----------------------| |----- u(eta)|
           \eta           mu(eta)        / \ deta       /
                                /      /                        
                                |      |                        
/  d   /  d         \\     1    |      |  rho(eta) c(eta) u(eta)
|----- |----- T(eta)|| + ------ |k1[w] |- ----------------------
\ deta \ deta       //   k(eta) |      |         5000 p2        
                                \      \                        

                                /  d           \
     (a[k1] + 2 b[k1] phi(eta)) |----- phi(eta)|
                                \ deta         /
   + -------------------------------------------
                                          2     
         1 + a[k1] phi1[w] + b[k1] phi1[w]      

            /  d         \\\
     k(eta) |----- T(eta)|||
            \ deta       /||
   + ---------------------||
           k1[w] eta      ||
                          //
                                      /  d         \
                             phi(eta) |----- T(eta)|
          /  d           \            \ deta       /
          |----- phi(eta)| + ------------------------
          \ deta         /                          2
                             N[bt] (1 + 0.01 T(eta))
mu:=unapply(mu1[bf]*(1+a[mu1]*phi(eta)+b[mu1]*phi(eta)^2),eta):
k:=unapply(k1[bf]*(1+a[k1]*phi(eta)+b[k1]*phi(eta)^2),eta):
rhop:=3880:
rhobf:=998.2:
cp:=773:
cbf:=4182:
rho:=unapply(  phi(eta)*rhop+(1-phi(eta))*rhobf ,eta):
c:=unapply(  (phi(eta)*rhop*cp+(1-phi(eta))*rhobf*cbf )/rho(eta) ,eta):
mu_phi:=mu1[bf]*(a[mu1]+2*b[mu1]*phi(eta)):

a[mu1]:=39.11:
b[mu1]:=533.9:
mu1[bf]:=9.93/10000:
a[k1]:=7.47:
b[k1]:=0:
k1[bf]:=0.597:
zet:=0.5:
#phi(0):=1:
#u(0):=0:
phi1[w]:=phi0:
N[bt]:=0.2:
mu1[w]:=mu(0):
k1[w]:=k(0):

eq1:=subs(phi(0)=phi0,eq1):
eq2:=subs(phi(0)=phi0,eq2):
eq3:=subs(phi(0)=phi0,eq3):

#A somewhat speedier version uses the fact that you really need only compute 2 integrals not 3, since one of the integrals can be written as a linear combination of the other 2:
Q:=proc(pp2,fi0) local res,F0,F1,F2,a,INT0,INT10,B;
global Q1,Q2;
print(pp2,fi0);
if not type([pp2,fi0],list(numeric)) then return 'procname(_passed)' end if:
res := dsolve(subs(p2=pp2,phi0=fi0,{eq1=0,eq2=0,eq3=0,u(1)=lambda/(phi(1)*rhop/rhobf+(1-phi(1)))*D(u)(1),D(u)(0)=0,phi(1)=phi0,T(1)=0,D(T)(1)=1}), numeric,output=listprocedure):
F0,F1,F2:=op(subs(res,[u(eta),phi(eta),T(eta)])):
INT0:=evalf(Int((1-eta)*F0(eta),eta=0..1-zet));
INT10:=evalf(Int((1-eta)*F0(eta)*F1(eta),eta=0..1-zet));
B:=(-cbf*rhobf+cp*rhop)*INT10+ rhobf*cbf*INT0;
a[1]:=2/(1-zet^2)*B-10000*pp2;
a[2]:=INT10/INT0-Phiavg;
Q1(_passed):=a[1];
Q2(_passed):=a[2];
if type(procname,indexed) then a[op(procname)] else a[1],a[2] end if
end proc;
#The result agrees very well with the fsolve result.
#Now I did use a better initial point. But if I start with the same as in fsolve I get the same result in just about 2 minutes, i.e. more than 20 times as fast as fsolve:

Q1:=proc(pp2,fi0) Q[1](_passed) end proc;
Q2:=proc(pp2,fi0) Q[2](_passed) end proc;
Optimization:-LSSolve([Q1,Q2],initialpoint=[6.5,exp(-1/N[bt])]);


proc(pp2, fi0)  ...  end;
proc(pp2, fi0)  ...  end;
proc(pp2, fi0)  ...  end;
              HFloat(6.5), HFloat(0.006737946999)

 

 

the error is :

Error, (in Optimization:-LSSolve) system is singular at left endpoint, use midpoint method instead

how can I fix it.

Thanks

 

Amir

I have exported Maple code as a Maplet file.  When I click on the file Maplet Launcher opens but nothing "runs".  It looks like it's trying because the icon flashes, but no window opens.  The Maple worksheet from which the Maplet was generated runs fine.

Any suggestions as to how to get Maplet Launcher to run my Maplets?

 

Thanks,

Rollie

Hello,

In a mechanical problem, i have to deal with a system with trigonometric expression. The variables are gamma[1](t), psi[1](t), phi[1](t), alpha(t), beta(t), x(t). The orthers are parameters.

I would like to have a explicit relations between  gamma[1](t), psi[1](t), phi[1](t) and alpha(t), beta(t), x(t).

In orthers words, i would like to have 

alpha(t)= f(gamma[1](t), psi[1](t), phi[1](t)).

beta(t)= f(gamma[1](t), psi[1](t), phi[1](t)).

 x(t) = f( gamma[1](t), psi[1](t), phi[1](t)).

Of course, the expresions of alpha(t), beta(t), and x(t) should be complex. Nevertheless, it will avoid me to have to solve Newton Raphson algorithm to solve these constraints equations.

Normally, it should be feasible.

When i have only one equation and not a system, isolate function is helpful.

But in this case, i don't manage to have my relations.

Have you some ideas to expression these relations ?

alpha(t)= f(gamma[1](t), psi[1](t), phi[1](t)).

beta(t)= f(gamma[1](t), psi[1](t), phi[1](t)).

 x(t) = f( gamma[1](t), psi[1](t), phi[1](t)).

Here the code of the equations :

restart:
with(LinearAlgebra):
with(Student[MultivariateCalculus]):
with(plots):
constants:= ({constants} minus {gamma})[]:
`evalf/gamma`:= proc() end proc:
`evalf/constant/gamma`:= proc() end proc:
unprotect(gamma);
restart:
with(LinearAlgebra):
with(Student[MultivariateCalculus]):
with(plots):
constants:= ({constants} minus {gamma})[]:
`evalf/gamma`:= proc() end proc:
`evalf/constant/gamma`:= proc() end proc:
unprotect(gamma);
eq_liai[1]:= rF[1]*cos(a[1])-cos(a[1])*cos(gamma[1](t))*e[1]-l[1]*(cos(phi[1](t))*cos(a[1])*cos(gamma[1](t))*cos(psi[1](t))-cos(phi[1](t))*cos(a[1])*sin(gamma[1](t))*sin(psi[1](t))-sin(a[1])*sin(phi[1](t)))-cos(alpha(t))*rBTP[1]*cos(a[1])-sin(alpha(t))*sin(beta(t))*rBTP[1]*sin(a[1])-sin(alpha(t))*cos(beta(t))*h = 0;
eq_liai[2]:= rF[1]*sin(a[1])-sin(a[1])*cos(gamma[1](t))*e[1]-l[1]*(cos(phi[1](t))*sin(a[1])*cos(gamma[1](t))*cos(psi[1](t))-cos(phi[1](t))*sin(a[1])*sin(gamma[1](t))*sin(psi[1](t))+cos(a[1])*sin(phi[1](t)))-cos(beta(t))*rBTP[1]*sin(a[1])+sin(beta(t))*h = 0;
eq_liai[3] := h[1]+sin(gamma[1](t))*e[1]+l[1]*(sin(gamma[1](t))*cos(psi[1](t))+cos(gamma[1](t))*sin(psi[1](t)))*cos(phi[1](t))+sin(alpha(t))*rBTP[1]*cos(a[1])-cos(alpha(t))*sin(beta(t))*rBTP[1]*sin(a[1])-cos(alpha(t))*cos(beta(t))*h-z(t) = 0;

or directly a maple file

constraints.mw

Thanks a lot for your help

Maple Player seems like it could be an outstanding piece of software, yet with the new operating system for Ipad, the program crashes immediately. I am unable to find any solutions. I also stumbled across a post in which Maplesoft is no longer providing support for the APP. Is this true?

When you use the slider without Do(%MathContainer1 = StandardError(Variance, R)):
everything works ok but when you add Do(%MathContainer1 = StandardError(Variance, R)):
Maple Crashes.....

Strange...

LL_102)_Covariance_M.mw

hi,

     there is a common  differential equation in my maple note,the solution of the eq. can be expressed by

associated Legendre function(s),but i get a result by hypergeometric representation.how i can translate the later into a  single Legendre fun?

 Thank you in advance  

ode := 'sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))'/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

sin(theta)*(diff(sin(theta)*(diff(Theta(theta), theta)), theta))/Theta(theta)+l*(l+1)*sin(theta)^2 = m^2

(1)

dsolve(ode)

Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2)

(2)

`assuming`([simplify(dsolve(ode))], [l::posint, m::integer, l >= m])

Theta(theta) = ((1/2)*cos(2*theta)-1/2)^((1/2)*m)*(sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)*_C1+2^(1/2)*(1-cos(2*theta))^(1/2)*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*_C2)/(1-cos(2*theta))^(1/2)

(3)

convert(Theta(theta) = _C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*hypergeom([(1/2)*m+(1/2)*l+1, (1/2)*m-(1/2)*l+1/2], [3/2], (1/2)*cos(2*theta)+1/2)/(1-cos(2*theta))^(1/2)+_C2*hypergeom([(1/2)*m-(1/2)*l, (1/2)*m+(1/2)*l+1/2], [1/2], (1/2)*cos(2*theta)+1/2)*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/(1-cos(2*theta))^(1/2), `2F1`)

Theta(theta) = (1/2)*_C1*((1/2)*cos(2*theta)-1/2)^((1/2)*m)*sin(2*theta)*Pi^(1/2)*GAMMA(-(1/2)*m-(1/2)*l)*JacobiP(-(1/2)*m-(1/2)*l-1, 1/2, m, -cos(2*theta))/((1-cos(2*theta))^(1/2)*GAMMA(1/2-(1/2)*m-(1/2)*l))+_C2*Pi^(1/2)*GAMMA(1-(1/2)*m+(1/2)*l)*JacobiP(-(1/2)*m+(1/2)*l, -1/2, m, -cos(2*theta))*(-2*cos(2*theta)+2)^(1/2)*((1/2)*cos(2*theta)-1/2)^((1/2)*m)/((1-cos(2*theta))^(1/2)*GAMMA(-(1/2)*m+(1/2)*l+1/2))

(4)

``

 

Download question_12.19.mw

 

I have an ipad air 16G running ios 7.0.4 and downloaded the MaplePlayer APP.  t seems to crash on several of the routines for example, "Approximaing Sphere" and "Linear System Tutor". The app was last updated in 2011.  Do you have plans to any upgrades plan in the near future?

I have an ipad air 16G running ios 7.0.4 and downloaded the MaplePlayer APP.  t seems to crash on several of the routines for example, "Approximaing Sphere" and "Linear System Tutor". The app was last updated in 2011.  Do you have plans to any upgrades plan in the near future?

Hi MaplePrimers,

I'm trying to solve a system of algebraic equations using 'solve' [float].  I'd prefer to use 'solve' over 'fsolve', as 'solve' solves my system in about 0.05s, whereas fsolve takes about 5 seconds.  I need to solve the system repeatedly at a different points, so time is important.  I don't know why there is such a large difference in time ... 

I have a few piecewise functions of order 3 to 5.  It solves fine with the other (piecewise) equations, but adding one piecewise function which gives me an error while trying to solve:

Error, (in RootOf) _Z occurs but is not the dependent variable.

I think this is due to solve finding multiple solutions.  Is there a way to limit solve to only real solutions?

Thanks in advance!

Hello, please i would like someone to please explain Hermite Polynomial for me. I have zero knowledge of this and if possible give examples and references. Also, on how to Normalize Hermite Polynomial and Ortogonarity of Hermite Polynomial. Thanks

I have a TextArea component on the worksheet. Is it possible to create on the worksheet some number of Sliders, where the number of sliders is defined by the number entered in the TextArea?

First 227 228 229 230 231 232 233 Last Page 229 of 2218