Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

I can use a whole package in a procedure or a command from a package. 
Writing your own code needs sometimes external code from outside a procedure used ( a package..what else more?)
This i don't find back in the Maple helpfiles easily using external code in procedure  
 

 This old example uses display3d naming what is the same as display ( there is no display3d command in Maple ) 
It gives the error 

diskmethod(f,0,2,10,fig);
Error, (in with) package plots does not export display3d

The disk methode calculates 
V = int(Pi*f(x)^2, x = a .. b)

 The Code for diskmethoddisplay

diskmethod:=proc(f,a,b,N,figure::evaln)
  local X,Y,s,x,dX,i,disk;
  with(plots,display3d);
  X:=array(0..N);Y:=array(1..N);disk:=array(1..N);
  dX:=evalf((b-a)/N);
  X[0]:=a;s:=0;
  for i to N do
    X[i]:=a+i*dX; Y[i]:=evalf(f(X[i]));
    s:=s+evalf(Pi*Y[i]^2*dX);
    disk[i]:=plot3d([x,Y[i]*cos(theta),Y[i]*sin(theta)],
                x=X[i-1]..X[i],theta=0..2*Pi,grid=[2,51]):

  end do;
  figure:= display3d({seq(disk[i],i=1..N)},
            axes=box,projection=0.8,orientation=[-60,70]);
  print(`The approximate volume using`,N,`disks is V =`, s);
end proc:

 

Can anyone help me to draw a zoom picture of any plotted function as shown in the picture??

would like to show a list system one by one and ask question and wait for answer and then plot graph and ask question and wait for answer and then show next system ask question and contiune this for loop

but my script show all system at once but can not one by one and no pop up dialog and no wait for answer

how to do?

 

restart:
interface(prettyprint=2):
with(ListTools):
with(StringTools):
with(ExcelTools):
with(SumTools):
with(Maplets[Elements]):
count := 1:

RR := Import("C:\\Users\\ohungyeeel\\Documents\\EquationsLists.xls", "Candidate", "A1:Q65535"):

for mm from 2 to 20 do

try:
if RR[count,13] = "Complex" or RR[count,13] = "Beautiful system but no result" then
dummy := 0:
else
print(RR[count,1],RR[count,2]):
sol := solve(RR[count,2]):
print("Source:",RR[count,3]):
print("Solution:",sol):

choosesystem := Maplet(InputDialog['ID1']("Choose system?", 'Yes1' = Shutdown(['Yes']), 'No1' = Shutdown(['No']))):
Maplets[Display](maplet):

if choosesystem = "Yes" then
RR[count,15] := "SystemChosenAndSolutionCorrect":
else
RR[count,15] := "NotChosenAndSolutionWrong":
end if:

plot(sol):

choosesystem := Maplet(InputDialog['ID1']("Like and it works?", 'Yes1' = Shutdown(['Yes']), 'No1' = Shutdown(['No']))):
Maplets[Display](maplet):

if choosesystem = "Yes" then
RR[count,16] := "Best":
else
RR[count,16] := "NotSelected":
end if:

end if:

catch:
print("error at ",RR[count,1],RR[count,2]):
end try:

count := count + 1:
od:
Export(RR, "C:\\Users\\ohungyeeel\\Documents\\EquationsLists10092020.xls", "Candidate", "A1"):

eq1 := diff(f(eta), eta, eta, eta, eta)+(2*f(eta)*(diff(f(eta), eta, eta, eta))+2*g(eta)*(diff(g(eta), eta)))*(1-phi)^2.5*(1-phi+phi*rhos/rhof)-sigmanf*M*(diff(f(eta), eta, eta))*(1-phi)^2.5/sigmaf = 0

eq2 := diff(g(eta), eta, eta)-(1-phi)^2.5*(1-phi+phi*rhos/rhof)*(2*(diff(f(eta), eta))*g(eta)-2*(diff(g(eta), eta))*f(eta))-sigmanf*M*g(eta)*(1-phi)^2.5/sigmaf = 0

eq3 := k[nf]*(diff(theta(eta), eta, eta))/(Pr*k[f])+((1-phi+phi*rhos*cps/(rhof*cpf))*2)*f(eta)*(diff(theta(eta), eta))-4*lambda*(1-phi+phi*rhos*cps/(rhof*cpf))*(f(eta)^2*(diff(theta(eta), eta, eta))+f(eta)*(diff(f(eta), eta))*(diff(theta(eta), eta)))+sigmanf*M*Ec*((diff(f(eta), eta))^2+g(eta)^2)/sigmaf = 0

eq4 := (1-phi)^2.5*(diff(chi(eta), `$`(eta, 2)))+2*Sc*f(eta)*(diff(chi(eta), eta))-sigma*Sc*(1+delta*theta(eta))^n*exp(-E/(1+delta*theta(eta)))*chi(eta) = 0

Boundary Conditions

f(0) = 0, (D(f))(0) = A1+gamma1*((D@@2)(f))(0), f(10) = 0, (D(f))(10) = 0, g(0) = 1+gamma2*(D(g))(0), g(10) = 0, theta(0) = 1+gamma3*(D(theta))(0), theta(10) = 0, chi(0) = 1, chi(10) = 0

Parameters

lambda = 0.1e-1, sigma = .1, Ec = .2, E = .1, M = 5, delta = .1, n = .1, Sc = 3, A1 = .5, gamma1 = .5, gamma2 = .5, gamma3 = .5, Pr = 6.2, phi = 0.1e-1, rhos = 5.06*10^3, rhof = 997, cps = 397.21, cpf = 4179, k[nf] = .6358521729, k[f] = .613, sigmanf = 0.5654049962e-5, sigmaf = 5.5*10^(-6)

 

 

Here are the inputs and output:

Why is it not possible to simplify the meter and the second (which are units).  If I do "simplify(pmin), the unit MeV becomes J and that is not what I want.  Simply said, is Maplesoft planning to include particle physics where c = h = 1 in the future version of the package "Physics"?

Until that happens, does someone knows how to give the answer in MeV/c.  The preceding problem was asking the mass of a particle in MeV/c^2.

Thank you in advance for your trouble.

Mario Lemelin

Geometry := 2;
if Geometry = 1 then
    f_obj := 4.5;
    f_fluo := 125;
    f_TIE := 45;
    d_sample := f_obj;
    d_max := 250;
    d_cam := f_TIE;
    d_interlens := d_max - d_cam;
end if;
if Geometry = 2 then
    f_obj := 4.5;
    f_fluo := 125;
    f_TIE := 45;
    d_sample := 4.6;
    d_max := 250;
    d_interlens := d_max - d_cam;
end if;
                               2

                              4.5

                              125

                               45

                              4.6

                              250

                          250 - d_cam

TIE := (((((Distance(d_cam)) . (Lens(f_TIE))) . (Distance(d_interlens))) . (Lens(f_obj))) . (Distance(d_sample))) . (Vector(2, [distance, angle]));
           Vector[column](%id = 18446746239510517390)

d_cam_solved := fsolve(coeff(TIE[1], angle, 1), d_cam, d_cam = 20 .. 100);
Error, `,` unexpected

Hello, if I set d_sample to 4.6 then I get "Error, ',' unexpected when I try to find a solution using fsolve. However if I set it to 4.5 then the fsolve computes no problem and I get a solution. Does somebody know if this means fsolve has no solution or have I made a mistake somewhere else? Thanks

Could please help me what is the problem of the following and how I can plot it

restart;
with(LinearAlgebra);
with(plots, implicitplot);
M := Matrix([[sigma + Gamma*ik + 0.5 + 0.5*tanh(c - v) + beta*v, -0.5 + 0.5*tanh(c - v), 0.5*(w - u)*sech^2*(c - v) - beta*u], [-0.5 - 0.5*tanh(c - v), sigma - i*k*Gamma + 0.5 + 0.5*tanh(c - v) + beta*v, 0.5*(u - w)*sech^2*(c - v) - beta*w], [-beta*v, -beta*v, sigma - beta*alpha*(u + w)]]):

Eq := Determinant(M):

alpha := 0.1;
beta := 0.01;
mu := 0.5;
u := 0.5;
v := 1;
Gamma := 0.1;
c := 2;
w := 0.5;

p1r := evalc(Re(Eq)):

p1 := implicitplot(Eq, k = 0 .. 10, sigma = -0.01 .. 0.01);
Error, (in plots/implicitplot) invalid input: the following extra unknowns were found in the input expression: {i, ik}

Hollo everybody,

I want to plot the product u^4*j_{alpha+4}(u)*j_{alpha}(v)??

Or j_{alpha} is the modified Bessel function of the first kind and order alpha.

 

Best regards

Hello everyone

I am trying to plot some vectors that have both numeric entries and NA. The vectors represent the root of some function depending on certain parameters (NA means that there is no root for these parameters) and I want to represent the value of the root (vertical) vs the vector that store the variable parameter (horizontal) omitting the values that yield NA. Is there a fast way to do that?

 

Thank you so much in advance

I recently got a question answer regarding drawing a weighted digraph. That got me thinking about more "complicated" networks, i.e., electrical networks. Is it possible to draw the following electrical network in Maple? I know it can be done quite easily in MapleSim, but how about Maple?

When I give symgen a HINT, using functional form f(x),g(x)*y it does not generate the infinitesimals of the Lie group for this ODE.

But from the answer given using way=abaco1 it is clear they have this form, where f(x)=-1/x and g(x)=1/x^2

From help, it says

HINT=[e1,e2], indicates to the solver that it should take e1 and e2 as the infinitesimals, where e1 and e2 can contain a maximum of two indeterminate functions. The solver tries to determine the infinitesimals to solve the problem.

And I am using only two indeterminate functions. These are f(x) and g(x)

Am I making a mistake somewhere? Please see worksheet below.


 

restart;

interface(version)

`Standard Worksheet Interface, Maple 2020.1, Windows 10, July 30 2020 Build ID 1482634`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 801 and is the same as the version installed in this computer, created 2020, September 7, 14:32 hours Pacific Time.`

restart;
ode:=diff(y(x),x)=(1-y(x)^2)/(x*y(x))+1;
#why this below do not give result?
DEtools:-symgen(ode,HINT=[f(x),g(x)*y]);

diff(y(x), x) = (1-y(x)^2)/(x*y(x))+1

DEtools:-symgen(ode,way=abaco1);

[_xi = -1/x, _eta = y/x^2]

#it works for this though. May be the two functions
#can  not be both functions of x at same time?
#one function must be function of x and the other of y?
#But help does not say that.

ode :=diff(y(x),x)=(x+cos(exp(-x)*(1+x)+exp(y(x))))/(exp(x+y(x)));
DEtools:-symgen(ode,HINT=[f(x),x*g(y)]);

diff(y(x), x) = (x+cos(exp(-x)*(1+x)+exp(y(x))))/exp(x+y(x))

[_xi = exp(x), _eta = x*exp(-y)]

 


 

Download symgen_issue_2.mw

Hi. I recently downloaded Maple 2020 for school and I've run into some issues when trying to use it. I downloaded it for MS-Windows. I got the activation code from my school (it was provided for me for free) and inputed it during set up when I was prompted for the code. After I open Maple and start trying to use it I can't because it doesn't let me edit anything I typed (won't let me use backspace) and when I try to press enter to evaluate something nothing happens. When I try to use anything in the context bar it just freezes the application entirely and won't even let me close it so I have to restart my computer. How do I fix this and actually be able to use Maple? 

How can this alteration occur by itself and what is the point of doing so? How do I change it back to $\cup$ and $\cap$?

I use "cat" to concatinate greek letters but the output is not correct.test_cat.mw
 

restart; with(linalg); QPT := proc (q) local nc, qp, qpp, i, p, pp; nc := vectdim(q); qp := Vector(nc); qpp := Vector(nc); for i to nc do qp[i] := cat(p, q[i]); qpp[i] := cat(pp, q[i]) end do; return qp, qpp end proc

q := convert([alpha, beta], Vector); QPT(q)

q := Vector(2, {(1) = alpha, (2) = beta})

 

Vector(2, {(1) = palpha, (2) = pbeta}), Vector(2, {(1) = ppalpha, (2) = ppbeta})

(1)

``


 

Download test_cat.mw

 

hi

i have expression like

z:=f0(x) + f1(x)*diff(y(x),x) + f2(x)*diff(y(x),x,x) + f4(x)*diff(y(x),x,x,x,x) ... etc ;

always linear terms diff((y(x),x) etc, never like diff((y(x),x)^2

want vector with coeffs of diff((y(x),x) etc in order low to high so want

<f1(x), f2(x), 0, f4(x) ...>

if z:=f0(x) + f2(x)*diff(y(x),x,x) + f4(x)*diff(y(x),x,x,x,x) ... etc ; want <0, f2(x), 0, f4(x) ...>

first term in vector always for diff((y(x),x)

how to do thanks

 

 

 

 

First 377 378 379 380 381 382 383 Last Page 379 of 2097