MaplePrimes Questions

I am currently working on a project that generates a set of matrices and I want to find their eigenvalues, but using the inbuilt Maple engine takes too long. The problem is that whenever I try to use the Matlab[eig] command I get the error:

Error, (in Matlab:-setvar) unable to store '-3.*Re(X)' when datatype=float[8]
I found out that solving symbolic matrices in MATLAB requires first defining symbols with the "sym" command but I've been unable to do that in Maple.

why   print(lastexception);  gives `[Length of output exceeds limit of 1000000]` while just doing lastexception; gives no problem?

 

restart;
eq:=x*y*p = y^2+x*(4*x^2+y^2)^(1/2);
try
   sol:= timelimit(20,`assuming`([solve(eq,y)],[real]));
catch:
   print(lastexception);
end try;
lastexception

I know one should use something like

print(StringTools:-FormatMessage( lastexception ))

But I do not know why print(lastexception) gives the length exceeds error. 

whattype(lastexception) gives exprseq

 

Maple 2020.1

 

In this post https://math.stackexchange.com/questions/1196194/asymptotic-behaviour-of-frac1x-1-frac1x2-1-frac1x3-1-cdots

this sum is evaluated in the answer to be

I cannot see how to use eularmac to get this answer as x approaches 1.

 

Maybe using

ge := `assuming`([sum(1/(x^k-1), k = 1 .. infinity)], [k::integer])then something like

 

eulermac(ge, limit(ge, x = 1), 3)

Hi, 

Could anyone help me to numerically solve this ode?
I've tried almost all the methods Maple proposes, trying to adjust stepsizes, tolerances and so on;, always without success.

I give also the exact solution of this ode in order to compare the numerical solution to.

Thanks in advance
 

restart

interface(version)

`Standard Worksheet Interface, Maple 2015.2, Mac OS X, December 21 2015 Build ID 1097895`

(1)

with(plots):

# Source term

F := t*(-600*t/(100*t^2+1)^2+80000*t^3/(100*t^2+1)^3)/(100*t^2+1)-(1/(100*t^2+1)-200*t^2/(100*t^2+1)^2)/(1+(1/(100*t^2+1)-200*t^2/(100*t^2+1)^2)^2);

plot(F, t=0..0.5);

t*(-600*t/(100*t^2+1)^2+80000*t^3/(100*t^2+1)^3)/(100*t^2+1)-(1/(100*t^2+1)-200*t^2/(100*t^2+1)^2)/(1+(1/(100*t^2+1)-200*t^2/(100*t^2+1)^2)^2)

 

 

# Ode

ode := X(t)*diff(X(t), t$2)-diff(X(t),t)/(1+diff(X(t),t)^2) - 'F'

X(t)*(diff(diff(X(t), t), t))-(diff(X(t), t))/(1+(diff(X(t), t))^2)-F

(2)

# Initial conditions

ics := X(0) = 0, D(X)(0) = 1

X(0) = 0, (D(X))(0) = 1

(3)

# I used alot methods with allways either failure or either a HFloat(undefined)

printf("rkf45\n");
sol := dsolve({ode, ics}, numeric):
sol(1e-8);

printf("\n\nrosenbrock\n");
sol := dsolve({ode, ics}, numeric, method=rosenbrock):
sol(1e-8);

printf("\n\ngear\n");
sol := dsolve({ode, ics}, numeric, method=gear):
sol(1e-8);

printf("\n\ngear\n");
sol := dsolve({ode, ics}, numeric, method=classical[heunform]):
sol(1e-8);

rkf45

Error, (in sol) cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

 



rosenbrock

Error, (in dsolve/numeric/SC/firststep) unable to evaluate the partial derivatives of f(x,y) for stiff solution

 

Error, (in sol) cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up

 



gear

 

[t = 0.1e-7, X(t) = HFloat(HFloat(undefined)), diff(X(t), t) = HFloat(HFloat(undefined))]

 



gear

 

[t = 0.1e-7, X(t) = HFloat(HFloat(undefined)), diff(X(t), t) = HFloat(HFloat(undefined))]

(4)

# The solution must be this one

U := t -> t/((t*10)^2+1)

proc (t) options operator, arrow; t/(100*t^2+1) end proc

(5)

# Check ode and ics

eval(ode, X(t)=U(t));
U(0);
D(U)(0);

0

 

0

 

1

(6)

# Plots when a solution is obtained

display(
  plot(U(t), t=0..1, color=blue),
  odeplot(sol, [t, x(t)], t=0..1, color=red, linestyle=3)
);


 

Download Unsuccessful_dsolve.mw

 

xE.mw

I integrate the expression maple but the result is large. How to furtherxE.mw reduce the size of the result? Also, what is dilog on maple?

Just wondering why

restart;
x:=2*{};
has(x,{})

Clearly {} is special. But is there a way to make it return true? 

 

Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up
restart;
with(plots);
p := 10; omega := 0.3e-2; q := 0.234e-1; phi := .2; beta := .1; alpha := .2; sigma := 0.4e-2; tau := 0.2e-1; theta := .13; Omega := 0.23e-1; mu := 0.2e-1; k := 0.18e-1; eta := 0.2e-1; delta := 0.1e-1; unprotect(gamma); gamma := 0.2e-1; rho := 0.2e-1; PI := 0.4e-1; xi := 0.57e-1; a := 0.11e-1; l := 0.73e-1; chi := 0.95e-1; nu := 0.8e-1; unprotect(Zeta); Zeta := 0.26e-1; varphi := 0.2e-1;
funcs := diff(S(t), t) = delta*V(t)+PI*C__Sy(t)+xi*C__Asy(t)+varphi*R(t)+(1-p)*omega-(mu+(q+(1-q)*lambda)*phi+chi*lambda+nu)*S(t), diff(V(t), t) = p*omega-rho*lambda*V(t)+nu*S(t)-(delta+mu+kappa*lambda*eta+(1-kappa)*lambda*eta)*V(t), diff(C__Sy(t), t) = q*phi*S(t)+Omega*C__Sy(t)+eta*kappa*lambda*V(t)+l*i(t)-(PI+theta+mu+beta+sigma)*C__Sy(t), diff(C__Asy(t), t) = (1-q)*phi*S(t)+theta*C__Sy(t)+eta*lambda*(1-kappa)*V(t)+alpha*i(t)-(xi+Omega+mu+alpha+tau)*C__Asy(t), diff(i(t), t) = rho*lambda*V(t)+alpha*C__Asy(t)+beta*C__Sy(t)+chi*lambda*S(t)-(mu+Zeta+gamma+a+l)*i(t), diff(R(t), t) = gamma*i(t)+tau*C__Asy(t)+sigma*C__Sy(t)-(mu+varphi)*R(t), S(0) = 200, V(0) = 100, C__Sy(0) = 80, C__Asy(0) = 50, i(0) = 70, R(0) = 40;
p1 := dsolve({funcs}, type = numeric, abserr = 2.4);
Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
p1i := odeplot(p1, [t, S(t)], 0 .. 120, numpoints = 100, labels = ["Time(Days)", "Susceptible  population"], labeldirections = [horizontal, vertical], style = line, axes = boxed, color = red);
Warning, cannot evaluate the solution past the initial point, problem may be complex, initially singular or improperly set up
 

Apparently the return value of a GetProperty check is not a boolean variable, but something else.

Why?

boolean.mw

I am creating Maple figures that are being used to create camera-ready figures in Adobe Illustrator. The graphic artist doing the Adobe Illustrator has asked me if there is a way to have the text information in the figure (tickmarks, axis labels, ...) saved as text and not created as an image?

I know that other EPS files have text stored this way, but it appears Maple does not do this. I can't find any documentation about this. Does anybody have any knowledge or experience about this?

Thanks in advance,

Doug

.............................................................................

Dear All, 

When I tried to replace all occurrences of an expression (two occurrences in total), only one of them (the last one with 'R__arm/2' coefficient) was replaced. I wonder if there is a way to make sure that all the occurrences are replaced by the intended substitute. 


 

restart;

with(Student[LinearAlgebra]):

eq4:= v__a(t) = (v__an(t)-v__ap(t))/2 - L__arm/2*diff([i__ap(t)-i__an(t)], t) - R__arm/2*(i__ap(t)-i__an(t));

v__a(t) = (1/2)*v__an(t)-(1/2)*v__ap(t)-(1/2)*L__arm*[diff(i__ap(t), t)-(diff(i__an(t), t))]-(1/2)*R__arm*(i__ap(t)-i__an(t))

(1)

eq4_2:= subs([i__ap(t)-i__an(t) = i__a(t)], eq4);

v__a(t) = (1/2)*v__an(t)-(1/2)*v__ap(t)-(1/2)*L__arm*[diff(i__ap(t), t)-(diff(i__an(t), t))]-(1/2)*R__arm*i__a(t)

(2)

 


 

Download Maximum_Modulation_Index_for_MMC_with_CCC.mw

Maple's infolevel is very nice feature, good for learning.

But I'd like to see more steps/info sometimes. Using infolevel set to max 5, does not show everything I like to see. Is there a way to print more info?

This is what I am   interested in. dsolve goes into Kovacic algorithm to solve second oder ODE. This algorithm is general algorithm to solve second oder linear ODE. 

https://www.sciencedirect.com/science/article/pii/S0747717186800104

restart;
infolevel[dsolve]:=5;
ode:=x^2*diff(diff(y(x),x),x)+x*diff(y(x),x)+(x^2-1/4)*y(x)=0;
dsolve(ode)

Changing printlevel to high value, does not really help here. It just prints lots of stuff I am not interested in.

What othere options are there to show more information about flow of logic, like the above?

I do not even know how to trace Kovacic code in Maple, since do not know what function/proc it is in without having to step though dsolve, which could take very long time to reach this specfic proc.

Is it possible to have Maple print the name of each proc it enter and leaves as it runs? That will be very useful addition added to printlevel. 

 

I have set of assumptions. The set happend to be empty at  time I used it. I forgot to change the set to list when calling assuming. This cased 'numeric exception: division by zero'
 

Is this normal and expected?

restart;
u1:=-ln(csc(x)-cot(x));
the_assumptions_on_x:={};
`assuming`([simplify(u1)],[the_assumptions_on_x])

Error, (in assuming) when calling 'signum'. Received: 'numeric exception: division by zero'
 

I fixed my code to use list at time of the call and the error went away

restart;
u1:=-ln(csc(x)-cot(x));
the_assumptions_on_x:={};
`assuming`([simplify(u1)],convert(the_assumptions_on_x,list))

The question is, why passing {} caused division by zero? 

Maple 2020.1

 

Hi,

I just wondering if I could write a variable as y' since when I try it, it will automatically diffrentiate the subject.

 

Thank you.

 

.................................................................................................................

First 393 394 395 396 397 398 399 Last Page 395 of 2308