MaplePrimes Questions

Dear Maple experts,

I have a system of several nonlinear equaitons. My code can solve it for a given parameter. But when I want to plot it, it takes too much time with no results. So, I decided to plot it for several given points. I get the answer for the points individually, but I don't know how to apply this to 'plot' command. Would you please help?

restartNULL

with(plots); with(RealDomain)

NULL

c := 1; cr := 0.3e-1*c; u := 5; sExp := 0.6e-1*c; s := .65*c; v := 3*c

NULL

NULL

FirmModelPartial1 := proc (alpha, beta, delta) local L1s, qs, ps, prs, hs, `&kappa;s`, `&lambda;__1s`, `&lambda;__2s`, `&lambda;__3s`, q, p, pr, h, kappa, `&lambda;__1`, `&lambda;__2`, `&lambda;__3`, FirmpfSiS, RecpfSiS, UnsoldSiS, EnvironSiS, p0, OldSoldPrim, xi, prof1, prof2, L1, L2, E1, E2, E3, E4, E5, E6, E7, E8, E9, E10, E11, E12; prof1 := (ps-c)*qs+((1/2)*beta^2*`&kappa;s`^2/(u*(1-alpha))-(1/2)*(qs+beta*`&kappa;s`)^2/u)*(ps-s)+hs*prs*(beta*`&kappa;s`-(1/2)*beta^2*`&kappa;s`^2/(u*(1-alpha))); L1s := prof1+`&lambda;__1s`*(1-sExp/prs-hs)+`&lambda;__2s`*(qs-`&kappa;s`)+`&lambda;__3s`*(qs-alpha*beta*`&kappa;s`/(1-alpha)); E1 := qs*(diff(L1s, qs)) = 0; E2 := hs*(diff(L1s, hs)) = 0; E3 := `&lambda;__1s`*(1-sExp/prs-hs) = 0; E4 := `&lambda;__2s`*(qs-`&kappa;s`) = 0; E5 := `&lambda;__3s`*(qs-alpha*beta*`&kappa;s`/(1-alpha)) = 0; E6 := qs = alpha*u*(v-ps)/(v-s); E7 := prs = ps-delta*v; E8 := `&kappa;s` = (beta*prs*(1-hs)+sExp*(1-beta))/(beta^2*(prs*(1-hs)-sExp)/(u*(1-alpha))+2*cr); p, q, pr, h, kappa, `&lambda;__1`, `&lambda;__2`, `&lambda;__3` := (eval([ps, qs, prs, hs, `&kappa;s`, `&lambda;__1s`, `&lambda;__2s`, `&lambda;__3s`], solve({0 <= qs-alpha*beta*`&kappa;s`/(1-alpha), 0 <= qs-`&kappa;s`, 0 <= 1-sExp/prs-hs, 0 <= `&lambda;__1s`, 0 <= `&lambda;__2s`, 0 <= `&lambda;__3s`, diff(L1s, qs) <= 0, diff(L1s, hs) <= 0, c < ps, (1/2)*beta*`&kappa;s`/(u*(1-alpha)) < 1, sExp+delta*v < ps, E1, E2, E3, E4, E5, E6, E7, E8}, [ps, qs, prs, hs, `&kappa;s`, `&lambda;__1s`, `&lambda;__2s`, `&lambda;__3s`])[1]))[]; xi := kappa/q; FirmpfSiS := max(0, eval(prof1, [ps = p, qs = q, prs = p-delta*v, hs = h, `&kappa;s` = kappa])); RecpfSiS := ((1-h)*pr-sExp)*(beta*kappa-(1/2)*beta^2*kappa^2/(u*(1-alpha)))+(sExp-cr)*kappa; UnsoldSiS := (1/2)*(q+beta*kappa)^2/u-(1/2)*beta^2*kappa^2/(u*(1-alpha)); EnvironSiS := q+UnsoldSiS; return p, q, FirmpfSiS, RecpfSiS, EnvironSiS, h, UnsoldSiS, h, xi end proc

NULL

NULL

FirmModelPartial1(.1, .2, .1)[3]

Error, (in FirmModelPartial1) invalid subscript selector

 

NULL

FirmModelPartial1(.2, .2, .1)[3]

Error, (in FirmModelPartial1) invalid subscript selector

 

FirmModelPartial1(.3, .2, .1)[3]

.2200894743

(1)

NULL

FirmModelPartial1(.4, .2, .1)[3]

.2892440018

(2)

FirmModelPartial1(.5, .2, .1)[3]

.3801240291

(3)

FirmModelPartial1(.6, .2, .1)[3]

.4921660779

(4)

FirmModelPartial1(.7, .2, .1)[3]

.6227094789

(5)

FirmModelPartial1(.8, .2, .1)[3]

.7668402612

(6)

FirmModelPartial1(.9, .2, .1)[3]

.9161921261

(7)
 

plot('FirmModelPartial1(alpha, .2, .2)[3]', alpha = .1 .. .90, adaptive = false, sample = [.1, .2, .3, .4, .5, .6, .7, .8, .9])

 

Download Reza_Tchno_(v3).mw

Besdies, it seems for some points there is no feasible solution. So, there is no need to have plot for them.

I attach the code. Thank you so much!

dS/dt=qnv-alpha_1*S*H-mu_sh*S

dH/dt=lamda_h-alpha_1*S*H-mu_h*H

dI/dt=alpha_1*S*H-beta_1*I-mu_i*I

dS/dt=beta_1*I-delta_1*S-mu_s*S

DATA:

q=0.75; n=15;v=20; alpha_You1=0.001; S=2000; H=3000; mu_sh=0.000000000012; lambda=3000;mu_h=0.94; beta_1=0.125; I=0; mi_i=0.95; delta_1=0.0975; S=0; mu_s=0.029

Good day all,

please I am new Maple user, i used the same code to solve boundary layer flow. Itried to use the same code in solving nanofluid but the solution is not coverging at some point. But the author i want to compared my results with had solution at those points.

Is there any way i can get solution of this model at this with these values?. Please i need your help. Thank you in advance

secod_code.mw

NULL

restart

with*plots; ode1 := (1+1/bet)*(diff(f(eta), eta, eta, eta))-(diff(f(eta), eta))^2+f(eta)*(diff(f(eta), eta, eta))+Gr*(theta(eta)+lambda1*theta(eta)^2)+Gc*(phi(eta)+lambda2*phi(eta)^2)-M*(diff(f(eta), eta)) = 0

(1+1/bet)*(diff(diff(diff(f(eta), eta), eta), eta))-(diff(f(eta), eta))^2+f(eta)*(diff(diff(f(eta), eta), eta))+Gr*(theta(eta)+lambda1*theta(eta)^2)+Gc*(phi(eta)+lambda2*phi(eta)^2)-M*(diff(f(eta), eta)) = 0

(1)

ode2 := (diff(theta(eta), eta, eta))*(1+(4*R*(1/3))*(theta(eta)+CT)^3)/Pr+4*R*(theta(eta)+CT)^2*(diff(theta(eta), eta))^2+f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))^2-de*(f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(theta(eta), eta, eta))) = 0

(diff(diff(theta(eta), eta), eta))*(1+(4/3)*R*(theta(eta)+CT)^3)/Pr+4*R*(theta(eta)+CT)^2*(diff(theta(eta), eta))^2+f(eta)*(diff(theta(eta), eta))+Nb*(diff(phi(eta), eta))*(diff(theta(eta), eta))+Nt*(diff(theta(eta), eta))^2-de*(f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta))+f(eta)^2*(diff(diff(theta(eta), eta), eta))) = 0

(2)

ode3 := diff(phi(eta), eta, eta)+Pr*Le*(diff(phi(eta), eta))*f(eta)+Nt*(diff(theta(eta), eta, eta))/Nb-Pr*Le*dc*(f(eta)*(diff(f(eta), eta))*(diff(phi(eta), eta))+f(eta)^2*(diff(phi(eta), eta, eta))) = 0

diff(diff(phi(eta), eta), eta)+Pr*Le*(diff(phi(eta), eta))*f(eta)+Nt*(diff(diff(theta(eta), eta), eta))/Nb-Pr*Le*dc*(f(eta)*(diff(f(eta), eta))*(diff(phi(eta), eta))+f(eta)^2*(diff(diff(phi(eta), eta), eta))) = 0

(3)

bcs1 := f(0) = 0, (D(f))(0) = 1+xi*((D^2)(f))(0), (D(f))(6) = 0, theta(6) = 0, phi(0) = 1+`&varsigma;`*(D(phi))(0), theta(0) = 1+Zeta*(D(theta))(0), phi(6) = 0

f(0) = 0, (D(f))(0) = 1+xi*(D(f))(0)^2, (D(f))(6) = 0, theta(6) = 0, phi(0) = 1+varsigma*(D(phi))(0), theta(0) = 1+Zeta*(D(theta))(0), phi(6) = 0

(4)

NULL

 

L := [0., .1, .4, 1]

[0., .1, .4, 1]

(5)

 
  

NULL


  for k to 10 do
      sol_All := dsolve
                 ( eval
                   ( {bcs1, ode1, ode2,ode3},
                     [xi= L[k],R=1, CT=0.2, Gr=0.5, Gc=0.5, lambda1=0.2, lambda2=0.2, Pr=0.72, Nb=0.5,  Le=1, dc=0.2, de=0.2, Nt=0.5, Zeta=0.5, varsigma=0.5, M=1.5, bet=1.5]
                   ),
                   [f(eta), theta(eta),phi(eta)],
                   numeric,
                   output = listprocedure
                 );
      Y_sol || k := rhs(sol_All[5]);
      YP_sol || k := -rhs(sol_All[6]);

feta || k := rhs(sol_All[4]);
      fpeta || k := rhs(sol_All[3]);

phieta || k := rhs(sol_All[8]);
      phipeta || k := rhs(sol_All[7])
  end do:

Error, (in dsolve/numeric/bvp) initial Newton iteration is not converging

 

for k to 10 do L[k], [(Y_sol || k)(0), (YP_sol || k)(0)] end do

0., [Y_sol1(0), YP_sol1(0)]

 

.1, [Y_sol2(0), YP_sol2(0)]

 

.4, [Y_sol3(0), YP_sol3(0)]

 

1, [Y_sol4(0), YP_sol4(0)]

 

Error, invalid subscript selector

 

for k to 10 do L[k], [(feta || k)(0)] end do

0., [feta1(0)]

 

.1, [feta2(0)]

 

.4, [feta3(0)]

 

1, [feta4(0)]

 

Error, invalid subscript selector

 

NULL

Error, mismatched or missing bracket/operator

"for k  from 1 to  10 do L[k], ([phieta ||k(0),phipeta||k(0)]); od; "

 

NULL

  plot( [ seq((Y_sol||j)(eta), j = 1..6)],
         eta = 0 .. 6,
         labels = [eta, theta(eta)],
         axes = boxed
      );
plot( [ seq((YP_sol||j)(eta), j = 1..6)],
         eta = 0 .. 8,
         labels = [eta, thetaprime(eta)],
         axes = boxed
      );

 plot( [ seq((feta||j)(eta), j = 1..6)],
         eta = 0 .. 8,
         labels = [eta, f(eta)],
         axes = boxed
      );
  plot( [ seq((fpeta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, fprime(eta)],
         axes = boxed
      );
plot( [ seq((phipeta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, phiprime(eta)],
         axes = boxed
      );

plot( [ seq((phieta||j)(eta), j = 1..6)],
         eta = 0 .. 5,
         labels = [eta, phi(eta)],
         axes = boxed
      );

Warning, expecting only range variable eta in expression Y_sol1(eta) to be plotted but found name Y_sol1

 

 

Warning, expecting only range variable eta in expression YP_sol1(eta) to be plotted but found name YP_sol1

 

 

Warning, expecting only range variable eta in expression feta1(eta) to be plotted but found name feta1

 

 

Warning, expecting only range variable eta in expression fpeta1(eta) to be plotted but found name fpeta1

 

 

Warning, expecting only range variable eta in expression phipeta1(eta) to be plotted but found name phipeta1

 

 

Warning, expecting only range variable eta in expression phieta1(eta) to be plotted but found name phieta1

 

 

Sometimes the canvas in the 2d-workspace of a subsystem (or component) is grayed out and the parameters in the parameter pane cannot be changed.

Example from the Model Gallery where the mass cannot be changed

Another example of a CAD geometry where I would like to change color and transparency:  seeshell.msim

How to unprotect the parameters?

I have observed that copy and pasting (Edit2: in a new document) and deleting the original component and copy/paste back into the original document and reconnection of the pasted  component works. Are there shorter ways to unprotect? 

And: How to do the reverse action (i.e. protecting a component)?

(I could not find a "when" and "why" for the protection in the documentation. Maybe I overlooked something)

Edit:

Other reasons why to unprotect are suppressions of components and highlight of multibody ports and axes.

Adding or reformating automatically generated ports (Edit3).


 

Hello Everyone;

Can anybody help me to solve the analytical solution of the following ODE?
AAS := C*diff(y(t), t) + (-B0*y(t)^3 - B1*y(t)^2 - B2*y(t) - B3);y[0] := 1

C,B0,B1,B2 are constants.

How did Maple arrive at the following, implicit solution,

MSimplicitesolution := (-9*y(x)*(-y(x)*x^2)^(1/3)*6^(2/3)*x^2 + 16*_C1*x^(8/3) - 24*x^2 + 6)/(16*x^(8/3)) = 0, 

to the following 'ode',

ODE:= (2/3)*(int[(y'(x)*(x^2)/((x^2) -1)]) =int(-sqrt [2*y(x)])?

'odeadvisor' suggested y=G(x,y'(x), but I could not see how this could be implimented with this equation.

(Unfortunately, I am unable to download the Maple worksheet onto this sheet at this time.  Any assitance

would be appreciated.                

I want to write the expresstion x^3 + (-m - 1)*x^2 + (-4*m - 3)*x in the form x^3 - (m-1) x^2 - (4m + 3). I tried
collect(expand(x^3 + (-m - 1)*x^2 + (-4*m - 3)*x), x)

I get x^3 + (-m - 1)*x^2 + (-4*m - 3)*x

Why is Maple not calculating 'sqrt' and continuously showing 'Evaluating'?


 

restart

with(LinearAlgebra); with(PDEtools); with(DifferentialGeometry)

with(plots)

with(Physics)

q := (31.00000000*exp(-4.976*t+2.*x)*exp((-2.488+.8336000001*I)*t+(1.+.2*I)*x)-3.000000000*exp(-4.976*t+2.*x)*exp((2.488+.8336000001*I)*t+(-1.+.2*I)*x)+(94.0*I)*exp(I*(.8336*t+.2000*x))*exp(-4.976*t+2.*x))/((11.50000000*I)*exp(-2.488*t+x)+132.44*exp(-4.976*t+2.*x)-(104.5000000*I)*exp(-7.464*t+3.*x)-5.25*exp(-9.952*t+4.*x)+.25)

(31.00000000*exp(-4.976*t+2.*x)*exp((-2.488+.8336000001*I)*t+(1.+.2*I)*x)-3.000000000*exp(-4.976*t+2.*x)*exp((2.488+.8336000001*I)*t+(-1.+.2*I)*x)+(94.0*I)*exp(I*(.8336*t+.2000*x))*exp(-4.976*t+2.*x))/((11.50000000*I)*exp(-2.488*t+x)+132.44*exp(-4.976*t+2.*x)-(104.5000000*I)*exp(-7.464*t+3.*x)-5.25*exp(-9.952*t+4.*x)+.25)

(1)

assume(x::real); assume(t::real)

q1 := simplify(subs({I = -I}, q))

(-(94.*I)*exp(-I*(.8336*t+.2000*x))+31.*exp((-2.488-.8336000001*I)*t+(1.-.2*I)*x)-3.*exp((2.488-.8336000001*I)*t+(-1.-.2*I)*x))*exp(-4.976*t+2.*x)/(-(11.50000000*I)*exp(-2.488*t+x)+132.44*exp(-4.976*t+2.*x)+(104.5000000*I)*exp(-7.464*t+3.*x)-5.25*exp(-9.952*t+4.*x)+.25)

(2)

q2 := simplify(sqrt(q*q1))

NULL

NULL


 

Download q_sqrt.mw

Help me please?

ElzakiTransform := proc(f, t) int(f*exp(-t/v)*v, t = 0 .. infinity); end proc;
f := e^(n*t);
result := ElzakiTransform(f, t);
result;

Is this true?

For_MaplePrimes_question.mw

In the above Maple document, I present a puzzling problem:  When I use plot3d, the options

font = [Times, bold, 16], labels = ['u', 'v', 'z'], labelfont = [Times, bold, 40] in the command

with(plots);
plot3d([u*sin(2*v), u^2, u*cos(2*v)], transparency = 0.60, shading = none, font = [Times, bold, 16], labels = ['u', 'v', 'z'], labelfont = [Times, bold, 40], grid = [60, 60]);

produces nice big labels on the axes, which are visible as opposed to the almost invisible default size, especially on printouts but when I use these options as in below command:

fieldplot3d([0, 0, -y], x = -2 .. 2, y = -2 .. 2, z = -2 .. 2, arrows = `3-D`, fieldstrength = maximal(0.5), font = [Times, bold, 16], labels = ['x', 'y', 'z'], labelfont = [Times, bold, 40], grid = [4, 4, 4])

the lables x, y and z on the fieldplot are small, the default.  I used the same option and get different results.

I have been researching this for almost 2 hours and I can't find a way to increase the font size in the fieldplot command.

Is this a bug or does the fieldplot command not use these options the way it is used in the plot3d command?

Thank You for reading my question. (I am relatively inexperienced with Maple.)

Tom K.

I somehow managed to turn off autosave some time ago. Now I have reenabled it, but Maple still doesn't create any backups. Am I missing something?

Any help is appriciated.

There are various variants of graph coloring, such as when I want to compute the star chromatic number of a graph, Maple (or Mathematica) seems not to provide relevant functions.

Fortunately, the software ColPack   offers this functionality (Note: I just noticed that this software also uses greedy coloring instead of accuracy). However, it supports the MTX format. So, the question is: 

  •  How can I write a graph in MTX format?

And 

  •  how can the MTX format be converted into a graph format?

Of course, I would like to perform these operations in Maple.  (SageMath may have something)


The following is an example (bcsstk01.mtx) in the directory `ColPack-master/Graphs directory` of the source code of ColPack.

bcsstk01.mtx.txt

./ColPack -f ../../Graphs/bcsstk01.mtx -m STAR
 Out: 11

But I do not know what the graph in the example is. On the contrary, I would like to compute the star chromatic number of the Petersen graph, and I also don't know how to convert it into the MTX format like the above.

with(GraphTheory):
with(SpecialGraphs):
P:=PetersenGraph()

I don't understand what the very long decimal numbers (like 2.8322685185200e+06) in the third column in the MTX-file. Will it affect the  imformation of the entire graph?

 

For MTX format, see https://math.nist.gov/MatrixMarket/formats.html.  For graphs, the numbers in the third column can all be considered as 1 (with the first two columns representing vertices, and their adjacency). Of course, this is my interpretation and may not necessarily be correct.

How to conver a patial differetial equation to ordinary differential equation with or without dchange?
 

restart

declare(u(x, y, t), v(x, y, t), T(x, y, t), C(x, y, t), eta(x, y, t), psi(x, y, t), f(eta), theta(eta), phi(eta));

declare(u(x, y, t), v(x, y, t), T(x, y, t), C(x, y, t), eta(x, y, t), psi(x, y, t), f(eta), theta(eta), phi(eta))

(1)

eta := proc (x, y, t) options operator, arrow; y/(nu*t+nu*x/U[w])^(1/2) end proc:

eq1 := diff(T(x, y, t), t)+u*(diff(T(x, y, t), x))+v*(diff(T(x, y, t), y))-sigma*(diff(T(x, y, t), y, y))-epsilon*D[B]*(diff(T(x, y, t), y))*(diff(C(x, y, t), y)) = 0

diff(T(x, y, t), t)+U[w]*(D(f))(y/(nu*t+nu*x/U[w])^(1/2))*(diff(T(x, y, t), x))+(-(1/2)*f(y/(nu*t+nu*x/U[w])^(1/2))*nu/(nu*t+nu*x/U[w])^(1/2)+(1/2)*(D(f))(y/(nu*t+nu*x/U[w])^(1/2))*y*nu/(nu*t+nu*x/U[w]))*(diff(T(x, y, t), y))-sigma*(diff(diff(T(x, y, t), y), y))-epsilon*D[B]*(diff(T(x, y, t), y))*(diff(C(x, y, t), y)) = 0

(2)

``


 

Download pde_to_ode.mw

I make more and more use of the FunctionAdvisor. I have started to apply rules from the advisor to expressions. Here are two examples with questions:

NULL

Expression to apply an identiy to

JacobiSN(sin((1/2)*`&varphi;__0`)*t, csc((1/2)*`&varphi;__0`)) = JacobiSN(z, k)

JacobiSN(sin((1/2)*varphi__0)*t, csc((1/2)*varphi__0)) = JacobiSN(z, k)

(1)

map(op, JacobiSN(sin((1/2)*varphi__0)*t, csc((1/2)*varphi__0)) = JacobiSN(z, k))

(sin((1/2)*varphi__0)*t, csc((1/2)*varphi__0)) = (z, k)

(2)

solve([(rhs-lhs)((sin((1/2)*varphi__0)*t, csc((1/2)*varphi__0)) = (z, k))], {k, z})[]

k = csc((1/2)*varphi__0), z = sin((1/2)*varphi__0)*t

(3)

Using the following identity from Maples FunctionAdvisor and the correspondence in (3)

FunctionAdvisor(identities, JacobiSN(z, 1/k))[5]

JacobiSN(z, k) = JacobiSN(z*k, 1/k)/k

(4)

convert(subs(k = csc((1/2)*varphi__0), z = sin((1/2)*varphi__0)*t, JacobiSN(z, k) = JacobiSN(z*k, 1/k)/k), sincos)

JacobiSN(sin((1/2)*varphi__0)*t, 1/sin((1/2)*varphi__0)) = sin((1/2)*varphi__0)*JacobiSN(t, sin((1/2)*varphi__0))

(5)

That worked. Q1: But is it a good way to do so?

Now  a new example: Converting InverseJacobinAM to InverseJacobiSN

NULL

NULL

FunctionAdvisor(identities, InverseJacobiSN(z, k))[3]

InverseJacobiSN(z, k) = InverseJacobiAM(arcsin(z), k)

(6)

InverseJacobiAM((1/2)*`&varphi;__0`, sqrt(2)/sqrt(1-cos(`&varphi;__0`))) = rhs(InverseJacobiSN(z, k) = InverseJacobiAM(arcsin(z), k))

InverseJacobiAM((1/2)*varphi__0, 2^(1/2)/(1-cos(varphi__0))^(1/2)) = EllipticF(z, k)

(7)

map(op, InverseJacobiAM((1/2)*varphi__0, 2^(1/2)/(1-cos(varphi__0))^(1/2)) = EllipticF(z, k))

((1/2)*varphi__0, 2^(1/2)/(1-cos(varphi__0))^(1/2)) = (z, k)

(8)

solve({(rhs-lhs)(((1/2)*varphi__0, 2^(1/2)/(1-cos(varphi__0))^(1/2)) = (z, k))}, {k, z})

{k = 2^(1/2)/(1-cos(varphi__0))^(1/2), z = (1/2)*varphi__0}

(9)

This is of course wrong since comparing the InverseJacobiAM expression in (6) and (7) z should be

(1/2)*`&varphi;__0` = arcsin(z)

(1/2)*varphi__0 = arcsin(z)

(10)

solve((1/2)*varphi__0 = arcsin(z), {z})

{z = sin((1/2)*varphi__0)}

(11)

Q2: How to avoid simplification of InverseJacobiAM(arcsin(z), k)to EllipticF(z, k)


Any advice?

Download Applying_identities_from_FunctionAdivisor.mw

First 53 54 55 56 57 58 59 Last Page 55 of 2308