Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I have written the following commands in Maple 18.

implicit_func := x^3+y^3 = 9*x*y;
c := 2;
s := evalf(solve(subs(x = c, implicit_func)));
m1 := evalf(eval(implicitdiff(implicit_func, y, x), {x = c, y = s[1]}));
                          0.8000000000
m2 := evalf(eval(implicitdiff(implicit_func, y, x), {x = c, y = s[2]}));
                          -1.257321410
m3 := evalf(eval(implicitdiff(implicit_func, y, x), {x = c, y = s[3]}));
                          0.4573214099

How can I graph all "implicit_func, y - s[1] = m1*(x-c), y - s[2] = m2*(x-c), y - s[3] = m3*(x-c), and the points (c,s[1]), (c,s[2]), and (c,s[3])" in a plane? (Each of them in a different color)     

Hello,

I try to install MapleToolbox2018.0LinuxX64Installer.run I run it as root or with sudo command, but everytime I finish with below message:

Choose Maple 2018 Folder

Please specify the path to your existing Maple 2018 Installation.

 [/opt/maple2018]:  /opt/exp_soft/local/generic/maple/2018

----------------------------------------------------------------------------
Choose MATLAB Folder

Select your MATLAB installation.

 []: /opt/exp_soft/local/generic/matlab/R2016b

Warning: The installer has detected a previous version of the Maple Toolbox in
your MATLAB installation.
Press [Enter] to continue:
Warning: The directory
/opt/exp_soft/local/generic/matlab/R2016b
is not writable by the current user

I'm not sure what to do with it.

---
Regards,

Bartek

 

I am writting the following commands in Maple 18.

imp_fun := -4*x + 10*(x^2)*(y^(-2)) + y^2 =11: c := 2: s := evalf( solve( subs( x = c, imp_fun))): m1 := evalf( subs ( { x = c, y = s[1] }, implicitdiff( imp_fun, y,x)));

Now I expect to see a value for m1 but I see again the last command in blue.

Could you please help me to see the value for m1 by writting these commands?

eval(sin(x), x = .2) is evaluated, eval(sin(x), x = 4) is not evaluated. Why? What should we do to get the answer. x-2n k (pi) can be obtained and evaluated. Why Maplesoft does not simplify and evaluate?

Is there a way out to give proper command for Maple soft to know what to do?

Thanks for answer.

Ramakrishnan V
 

eval(sin(x), x = .2)``

.1986693308

(1)

eval(sin(x), x = 4)

sin(4)

(2)

``


 

Download evalDoubtSinx.mw

How to plot multiple functions with multiple lines (Dot, Dash, Dash-Dot, )  all in one colour?

Like following plot:

I have written a code for minimizing a multivariable function using Gauss newton method. But i am getting error 
 

restart; with(LinearAlgebra); with(Student[MultivariateCalculus]); f := unapply(x1*exp(t*x2-y), x1, x2); tt := Matrix(5, 1, [1, 2, 4, 5, 8]); yy := Matrix(5, 1, [3.2939, 4.2699, 7.1749, 9.3008, 20.259]); ff := f(2.50, .25); for ii to 5 do t := tt[ii][1]; y := yy[ii][1]; Jf := Student[MultivariateCalculus][Gradient](f(x1, x2), [x1, x2] = [2.50, .25]); JF := Transpose(Jf[1]); JR := Transpose(Transpose(ff).JF); HF := Transpose(JF).JF; P := LinearSolve(HF, -JR); printf("%a  \n", P) end do

Vector(2, [0.,-1.], datatype = float[8])  

Error, (in LinearAlgebra:-LA_Main:-BackwardSubstitute) inconsistent system

 

``


 

Download GAUSS_NEWTON_METHOD3.mw

I have a vector A. I want to re-index vector A.

After re-indexing it, I will use the elements of the vector in new calculations.

For example:

 

k:=2:
M:=3:
A:=Vector[column]([seq(seq(p*q,q=0..M-1),p=1..2^(k-1))]);
C:=Vector[column]([seq(seq(c(p,q),q=0..M-1),p=1..2^(k-1))]); 
Equate(C,A);
c(1,0)+c(2,1);

c(1,0)+c(2,1)=2.

But the above code doesn' t work.

How I can solve algebraic differential equation of index 2 in Mae 15?

I have modeled a simple pendulum with large intital amplitude (so we do not approx sin(theta) by theta).

I have a plot of theta agains time but would like to have both theta (position) and theta' (velcocity) on same graph.

Grateful for any suggestions

Pendulum2time.mw
 

Simple pendulum without approximating sin(θ) to θ

restart; with(DEtools)

ode := diff(theta(t), t, t)+g*sin(theta(t))/L = 0; ics := theta(0) = 1, (D(theta))(0) = 0

diff(diff(theta(t), t), t)+g*sin(theta(t))/L = 0

 

theta(0) = 1, (D(theta))(0) = 0

(1)

g := 9.8; L := .75

ans := dsolve({ics, ode}, theta(t), numeric, output = Array([0, .1, .2, .3]))

Matrix(%id = 18446746279246469110)

(2)

NULL

DEplot(ode, theta(t), t = 0 .. 3.5, theta = -1 .. 1, [{ics}], linecolour = blue)

 

with(plots); odeplot(dsolve({ics, ode}, theta(t), numeric), t = 0 .. 3.5, colour = blue)

 

NULL


 

Download Pendulum2time.mw

 

In the uploaded worksheet a block slides up the Hill from an initial position at an initial horizontal velocity. The block's motion is subject to sliding friction.

How can the equations of the block's motion be obtained to include the effects of gravity and friction?

It may simplify the answer to end the block's upward motion when gravity and friction bring it to an instantaneous halt.

Block_sliding.mw

Hello,

I am currently using NonliearFit to curve fit my data. 

The problem is that If I use a very long function that I should use for my project,

an error message appears as shown below.

The equation seems OK since I can plot them when parameters are set to certain values.

And if I use a simple equation NonlinearFit works fine. 

I will appreciate your helpful comments. Thank you!

-----------------------------------------------------Nonlinear_Fit_Complex_Equation.mw
 

restart 

with(Statistics) 

  X1 := Vector([0, 1, 2, 3, 4, 5, 6, 7, 8], datatype = float)

Y1 := Vector([0, -0.18e-1, -0.36e-1, -0.44e-1, -0.49e-1, -0.51e-1, -0.52e-1, -0.54e-1, -0.54e-1], datatype = float)

k__plot := proc (beta, k, t) options operator, arrow; [.1544730161*beta*(Sum((-1)^n*exp(-10000000000*Pi^2*(1+2*n)^2*k*t)*(-(1/2)/sqrt(Pi)+(1/2)*cos((1/2)*(1+2*n)*Pi)/sqrt(Pi)+(1/4)*sqrt(Pi)*(1+2*n)*sin((1/2)*(1+2*n)*Pi))/((2*Pi*n+Pi)*(1+2*n)^2), n = 0 .. infinity))+(-1)*0.1343994407e-1*beta+(-1)*0.6807477066e-1*beta*(9.869604401+8.*(Sum(-exp(-10000000000*Pi^2*(1+2*n)^2*k*t)/(1+2*n)^2, n = 0 .. infinity)))] end proc

plot0 := plot(k__plot(0.78e-1, 3*10^(-12), t), t = 0 .. 20)

 

``

``

[.1544730161*beta*(Sum((-1)^n*exp(-10000000000*Pi^2*(1+2*n)^2*k*t)*(-1/(2*sqrt(Pi))+cos((1/2)*(1+2*n)*Pi)/(2*sqrt(Pi))+(1/4)*sqrt(Pi)*(1+2*n)*sin((1/2)*(1+2*n)*Pi))/((2*Pi*n+Pi)*(1+2*n)^2), n = 0 .. infinity))-0.1343994407e-1*beta-0.6807477066e-1*beta*(9.869604401+8.*(Sum(-exp(-10000000000*Pi^2*(1+2*n)^2*k*t)/(1+2*n)^2, n = 0 .. infinity)))]

[.1544730161*beta*(Sum((-1)^n*exp(-10000000000*Pi^2*(1+2*n)^2*k*t)*(-(1/2)/Pi^(1/2)+(1/2)*cos((1/2)*(1+2*n)*Pi)/Pi^(1/2)+(1/4)*Pi^(1/2)*(1+2*n)*sin((1/2)*(1+2*n)*Pi))/((2*Pi*n+Pi)*(1+2*n)^2), n = 0 .. infinity))-0.1343994407e-1*beta-0.6807477066e-1*beta*(9.869604401+8.*(Sum(-exp(-10000000000*Pi^2*(1+2*n)^2*k*t)/(1+2*n)^2, n = 0 .. infinity)))]

(1)

  NonlinearFit([.1544730161*beta*(Sum((-1)^n*exp(-10000000000*Pi^2*(1+2*n)^2*k*t)*(-(1/2)/Pi^(1/2)+(1/2)*cos((1/2)*(1+2*n)*Pi)/Pi^(1/2)+(1/4)*Pi^(1/2)*(1+2*n)*sin((1/2)*(1+2*n)*Pi))/((2*Pi*n+Pi)*(1+2*n)^2), n = 0 .. infinity))-0.1343994407e-1*beta-0.6807477066e-1*beta*(9.869604401+8.*(Sum(-exp(-10000000000*Pi^2*(1+2*n)^2*k*t)/(1+2*n)^2, n = 0 .. infinity)))], X1, Y1, t)

Error, (in Statistics:-NonlinearFit) invalid input: no implementation of NonlinearFit matches the arguments in call, 'NonlinearFit([.1544730161*beta*(Sum((-1)^n*exp(-10000000000*Pi^2*(1+2*n)^2*k*t)*(-(1/2)/Pi^(1/2)+(1/2)*cos((1/2)*(1+2*n)*Pi)/Pi^(1/2)+(1/4)*Pi^(1/2)*(1+2*n)*sin((1/2)*(1+2*n)*Pi))/((2*Pi*n+Pi)*(1+2*n)^2), n = 0 .. infinity))-0.1343994407e-1*beta-0.6807477066e-1*beta*(9.869604401+8.*(Sum(-exp(-10000000000*Pi^2*(1+2*n)^2*k*t)/(1+2*n)^2, n = 0 .. infinity)))], op(w), t)'

 

``

NonlinearFit(beta+4*t+5*exp(k*t), X1, Y1, t)

-HFloat(17.773016167748086)+4*t+5*exp(-HFloat(0.37019659804002825)*t)

(2)

``


 

Download Nonlinear_Fit_Complex_Equation.mw

 

 

 

Hi,

I get the error message "Error, invalid input: diff expects 2 or more arguments, but received 1" from the following program. Could you please help me? Thank you i,n advance for your help!

som:=0:

for b1 from 10 to 10 by 1 do
for b2 from 1 to 2 by 1 do
for alpha from 0.5 to 0.5 by 0.1 do
for beta from 0.33 to 0.5 by 0.1 do
for c from 1 to 1 by 1 do
for f from 1 to 10 by 1 do
for g from 1 to 10 by 0.1 do
for lambdaj from 0.2 to 0.4 by 0.1 do
for gammaj from 0.2 to 0.4 by 0.1 do

p:='p';

aiSQ:=(alpha*b1)/(alpha*b2+beta*b2+c);
ajSQ:=(beta*b1)/(alpha*b2+beta*b2+c);
UiSQ:=(1/2)*alpha*b1^2*(alpha^2*b2+2*alpha*beta*b2+c*alpha+beta^2*b2+2*beta*c)/(alpha*b2+beta*b2+c)^2;
UjSQ:=(1/2)*beta*b1^2*(alpha^2*b2+2*alpha*beta*b2+2*c*alpha+beta^2*b2+beta*c)/(alpha*b2+beta*b2+c)^2;
USQ:=(1/2)*b1^2*(alpha+beta)*(alpha*b2+beta*b2+2*c)/(alpha*b2+beta*b2+c)^2;
UTSQ:=UiSQ+UjSQ+USQ;

ai:=(-alpha*b2*f*p+alpha*b1*c-b2*f*p+b1*c)/(c*(alpha*b2+b2*beta+b2+c));
aj:=(alpha*b2*f*p+b1*beta*c+b2*f*p+c*f*p)/(c*(alpha*b2+b2*beta+b2+c));

aineg:=-(alpha*b2*f*lambdaj*p+b2*f*lambdaj*p+alpha*b1*c+b1*c)/(c*(alpha*b2*lambdaj-2*alpha*b2-b2*beta+b2*lambdaj-2*b2-c));
ajneg:=(alpha*b2*f*lambdaj*p+alpha*b1*c*lambdaj+b2*f*lambdaj*p+c*f*lambdaj*p-alpha*b1*c-b1*beta*c+b1*c*lambdaj-b1*c)/(c*(alpha*b2*lambdaj-2*alpha*b2-b2*beta+b2*lambdaj-2*b2-c));
uj:=beta*(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)-(c/2)*ajneg^2-p*f*(ajneg-aj);
uL:=(alpha+1)*(b1*(aineg+ajneg)-(b2/2)*(aineg+ajneg)^2)-(c/2)*aineg^2+p*f*(ajneg-aj);
eqtj:=gammaj*(uL-USQ)-((1-gammaj)/(1-lambdaj))*(uj-UjSQ)-tj;
tj:=solve(eqtj,tj);

dai:=diff(ai,p);
daj:=diff(aj,p);
daineg:=diff(aineg,p);
dajneg:=diff(ajneg,p);
dtj:=diff(tj,p);
Ujp:=beta*(b1*(ai+aj)-(b2/2)*(ai+aj)^2)-(c/2)*aj^2-p*f*(ajneg-aj)+(1-lambdaj)*tj;
ULp:=(alpha+1)*(b1*(ai+aj)-(b2/2)*(ai+aj)^2)-(c/2)*ai^2+p*f*(ajneg-aj)-tj-g*((p^2)/2);
eqp:=diff(ULp,p);
eqpp:=diff(eqp,p);
p:=solve(eqp,p);

CSQ:=b1-b2*(aiSQ+ajSQ);
Cabat:=b1-b2*(ai+aj);
Cneg:=b1-b2*(aineg+ajneg);

if (ai>aineg) then f*(aineg-ai)=0
else if (aj>ajneg) then f*(ajneg-aj)=0
else if (CSQ>0 and Cabat>0  and Cneg>0 and eqpp<0 and p>0 and p<1 and beta<alpha and aiSQ>0 and ajSQ>0 and ai>0 and aj>0 and aineg>0 and ajneg>0 and tj>0)
then
#print(b1,b2,alpha,beta,c,f,g,lambdaj,gammaj,p);
som:=som+1;
fi;fi;fi;
od;od;od;od;od;od;od;od;od;
som;
 

How to make maple sheet background transparent?

and change word color ?

First 609 610 611 612 613 614 615 Last Page 611 of 2097