Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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

 

 

 

 

Dear Community,

I have a four compartment flow model described with the following system of linear ODEs:

diff(L[1](t), t) = L[2](t)/T[21] - L[1](t)/T[12]

diff(L[2](t), t) = L[1](t)/T[12] - L[2](t)/T[21] + L[3](t)/T[32] - L[2](t)/T[23] + Q(t)

diff(L[3](t), t) = L[2](t)/T[23] - L[3](t)/T[32] + L[4](t)/T[43] - L[3](t)/T[34]

diff(L[4](t), t) = L[3](t)/T[34] - L[4](t)/T[43]

(For easier readability I’ve also described the problem in the attached FourCompartmentModelDescription.docx Word file.)

 

The time constants are as follows:

T12 = 23.1481 d

T21 = 5.4537 d

T23 =  9.752 d

T32 = 14.9007 d

T34 = 8.8235 d

T43 = 363.7255 d

Initial conditions are as follows:

L1(0) = 2500.

L2(0) = 589.

L3(0) = 900.

L4(0) = 37100.

Simulation should run from 0 to 400 d.

Could you pls. help me, to solve it numerically in Maple? As a solution I would need L1(t), L2(t), L3(t) and L4(t) both numerically and graphically. I used Maple to solve ODEs previously, but this time I don’t know, how to correctly specify the problem with an external, tabulated source. I’ve also prepared and attached a Maple worksheet, but did not try to run it yet. (FourCompartments.mw). The external Q(t) source for compartment 2 is attached as Source.xlsx. Should I've forgotten something, pls. let me know.

Your kind help is appreciated in advance,

best regards

Andras

 

MaplePrimesFourCompartmentModelDescription.docx

FourCompartments.mw

Source.xlsx

I'm trying to put image in my maplet interface.

I use this following code

Label(Image(cat(currentdir(),"\\Image Folder\File name.png")))

The code work as well when i run the code in worksheet. But it doesn't work since i export the worksheet to .maplet file.

Please help. Thank you

Hello,

I would like to know if it is possible to Fit data to an expression using NonlinearFit, but in this expression there is a variable that is the result of dsolve and the contains parameters I need to identify.

with(LinearAlgebra):
tensF:=Matrix([[lambdaTrig,0,0],[0,1/sqrt(lambdaTrig),0],[0,0,1/sqrt(lambdaTrig)]]):
tensdF:=diff(tensF,t):
tensFDev:=tensF-(1/3)*Trace(tensF)*Matrix(3,shape=identity):
tensB:=Multiply(tensF,Transpose(tensF)):
tensL:=Multiply(tensdF,MatrixInverse(tensF)):
tensD:=(1/2)*(tensL+Transpose(tensL)):
tensBe:=Matrix([[Be11(t),0,0],[0,1/sqrt(Be11(t)),0],[0,0,1/sqrt(Be11(t))]]):
tensdBe:=diff(tensBe,t):
tensBeDev:=tensBe-(1/3)*Trace(tensBe)*Matrix(3,shape=identity):

Above are the tensors I need in the expression.

Then there is the equation to solve. I tried something with "proc", I found on Maple Help Page.

ode:=tensdBe[1,1]=-(2/3)*tensBe[1,1]*Trace(tensD)+Multiply(tensL[1,1],tensBe[1,1])+Multiply(tensBe[1,1],Transpose(tensL[1,1]))-(2/eta)*a*Multiply(tensBeDev[1,1],tensBe[1,1]): ivp:=[ode,Be11(0)=1]: 
ode_sol:=dsolve(ivp,numeric,parameters=[a,eta]); 
ode_sol(parameters=[a=1,eta=0.1]); 
Be11Num:=proc(aValue,etaValue) global ode_sol,a,eta,t; ode_sol('parameters'=[a=aValue,eta=etaValue]); end proc;

Then I built the expression I need to fit :

tensTemp1:=2*C1*tensB+4*C2*(Trace(tensB)-3)*tensB+6*C3*(Trace(tensB)-3)*tensB-2*C4*MatrixInverse(tensB):
tensTemp1Dev:=tensTemp1-(1/3)*Trace(tensTemp1)*Matrix(3,shape=identity):
tensBe:=Matrix([[Be11Num,0,0],[0,1/sqrt(Be11Num),0],[0,0,1/sqrt(Be11Num)]]):

tensTemp2Dev:=2*G*tensBe-(1/3)*Trace(2*G*tensBe)*~Matrix(3,shape=identity):
sigma:=tensTemp1Dev+tensTemp2Dev-p*~Matrix(3,shape=identity):
p:=sigma[2,2]+p: 
sigma:=tensTemp1Dev+tensTemp2Dev-p*~Matrix(3,shape=identity): 
PK:=sigma.Transpose(MatrixInverse(tensF)):
PK:=PK[1,1]: #expression  to fit

Then I tried to fit

NonlinearFit(PK,t1Expe,PK1Expe,t,output=[parametervalues,residualsumofsquares]);

The problem is that the result is

[[Be11Num = 1.00001503587671, C1 = 0.588252936860393, C2 = 6091.63136742778, C3 = -4061.11176413018, C4 = -0.494824008942008, G = 1409.06089189383], 17.90514021]

It's computing the solution Be11 but I can't get the value of the parameters a and eta. Moreover Be11 is depending on t, so it seems I only get the last value.

What do you think, is it possible to do what I just explained ?

Thnak you in advance,

Manon

interface(prettyprint=2):
with(ListTools):
with(StringTools):
for xx from 1 to 2 do
xx := 1:
Source := FileTools[Text][ReadFile](cat("C:\\hello\\probability1-200-26042020\\home\\probability",xx,"\\probability",xx,".txt")):
openindex := [SearchAll("[",Source)]:
endindex := [SearchAll("]",Source)]:
beforefiltered := []:
for mm from 1 to nops(openindex) do
if mm > 27 then
beforefiltered := [op(beforefiltered), Chop(substring(Source, openindex[mm]..endindex[mm]))]:
end if:
od:
afterfiltered := []:
for mm in beforefiltered do
if Has(mm,"--") or Has(mm,"|") or Has(mm,"{") or Has(mm,"}") then
dummy := 0:
elif Has(mm,"Root") then
dummy := 0:
else
afterfiltered := [op(afterfiltered),mm]:
end if:
od:
afterfiltered[1];

however after chop still has new line, can not make a beautiful csv format, 

"[b(t,k)+ a
(t,k)*
x(t,k)]"

# I try to export to text first and then use Excel to use "|" as delimiter instead comma as delimiter,
#because b(t,k) has comma "," will separate to open a new column

appendto("C:\\Users\\Student\\Documents\\IQ1-200csv.txt"):
for mm in afterfiltered do
AA := parse(mm):
lprint(xx,"|","hello := [","|",AA[1],"|",AA[2],"|","]:");
od:
od:

Expect csv in format
1,b(t,k)+a(t,k)*x(t,k)
2,a(t,k)+s(t,k)*z(t,k)

I have an integral of a sum

Int(Sum(-(Nb*t-n*t__rev)*exp((1/2)*(L+sqrt(-4*C*L*R^2+L^2))*t/(L*R*C)-(1/2)*(Nb*t-n*t__rev)^2/(Nb^2*sigma__b^2)), n = 0 .. Nb-1), t);

that I want to convert into a sum of integrals since Maple will not integrate the sum but it will integrate the summands. I tried IntegrationTools, but none of these tools seem to do it. It is a part of a larger expression so doing this by hand is not a real option.

Mac Dude.

First 8 9 10 11 12 13 14 Last Page 10 of 1731