MaplePrimes Questions

In reference to the nice application: https://www.mapleprimes.com/posts/209845-Dataframes--Looking-For-A-New-Flashlight by @Christopher2222 ,  my question is: 

is there a simple way to sort primarily by one column, but if two elements possess identical values, then using a second column to determine the order? For example, what if we wanted to sort the flashlight dataframe primarily by "B-type" but use a subsort by "Minutes". 

I wrote a function which used recursion. It worked fine for small dataframes, but was painfully slow with a multi-thousand element spreadsheet.

 

Hello,

I have a nonhomogeneous heat conduction problem, where the thermal conductivity, the density, and the specific heat of the
material are piecewise functions.

The thermal conductivity derivative has a discontinuity that causes a problem in the pdsolve command (see the first test).

To avoid this problem, I did a second test where the product rule was calculated directly.

Is there a better way to deal with this problem?

thank you

problem.mw

Dear Maple community,

I am trying to import from a .csv (or .xls) a matrix, whose symbolic elements have subscripts of a type "a[1, 2, 3, 4]" (i.e., datatype=indexed). However, when I enter "ImportMatrix(csvFile, datatype = indexed)", I receive an error message "Error, (in ImportMatrix) unable to store '0' when datatype=indexed". I would highly appreciate your help with importing an indexed matrix. Thank you.

Are there any established (or not established but cool) methods to exchange data between different worksheets or workbooks?

Actually there are 2 questions.

  1. If I have 2 different worksheets or workbooks open in Maple, and want to exchange data between them.
  2. One workbook, but different worksheets in the same workbook.

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

First 512 513 514 515 516 517 518 Last Page 514 of 2427