dharr

Dr. David Harrington

8320 Reputation

22 Badges

21 years, 1 days
University of Victoria
Professor or university staff
Victoria, British Columbia, Canada

Social Networks and Content at Maplesoft.com

Maple Application Center
I am a retired professor of chemistry at the University of Victoria, BC, Canada. My research areas are electrochemistry and surface science. I have been a user of Maple since about 1990.

MaplePrimes Activity


These are replies submitted by dharr

@MaPal93 Nice progress on making it simpler. Here is a note on using the multivariate chain rule to see some of the structure in terms of derivatives, though this may be obvious.

compact_derivatives2.mw

In 2024 I am not getting this warning. (Typesetting level is extended.)

restart;

interface(version);

`Standard Worksheet Interface, Maple 2024.1, Windows 11, June 25 2024 Build ID 1835466`

for k from 1 to 4 do
    A[k] := Matrix(k, k, (i, j) -> local m; ifelse(i + j < k + 2, add(Y[i - m + j - 1]*binomial(i - 1, m)*(-1)^m, m = 0 .. i - 1), 0));
end do

Vector(1, {(1) = Y[1]})

Matrix(2, 2, {(1, 1) = Y[1], (1, 2) = Y[2], (2, 1) = Y[2]-Y[1], (2, 2) = 0})

Matrix(3, 3, {(1, 1) = Y[1], (1, 2) = Y[2], (1, 3) = Y[3], (2, 1) = Y[2]-Y[1], (2, 2) = Y[3]-Y[2], (2, 3) = 0, (3, 1) = Y[3]-2*Y[2]+Y[1], (3, 2) = 0, (3, 3) = 0})

Matrix(%id = 36893490017533568292)

NULL

Download warning.mw

@MaPal93 Apologies. You are right, and the expression doesn't have any of the alias in it. I must have created it out of sequence. I haven't used Veil much, so can't comment. It should be possible to use it on X_2 before differentiation, and then differentiate.


 

restart;

interface(version);

`Standard Worksheet Interface, Maple 2023.2, Windows 10, November 24 2023 Build ID 1762575`

Physics:-Version();

`The "Physics Updates" package is not installed`

restart;

ode:=a*(1 + diff(y(x), x)^3)^(1/3) + x*diff(y(x), x) - y(x) = 0;

a*(1+(diff(y(x), x))^3)^(1/3)+x*(diff(y(x), x))-y(x) = 0

dsolve(ode,y(x),singsol=all)

y(x) = a*(c__1^3+1)^(1/3)+x*c__1, y(x) = (x^(3/2)*c__1+a^3-x^3)^(1/3), y(x) = -(1/2)*(x^(3/2)*c__1+a^3-x^3)^(1/3)-((1/2)*I)*3^(1/2)*(x^(3/2)*c__1+a^3-x^3)^(1/3), y(x) = -(1/2)*(x^(3/2)*c__1+a^3-x^3)^(1/3)+((1/2)*I)*3^(1/2)*(x^(3/2)*c__1+a^3-x^3)^(1/3)

 

Download strange_warning_message_from_dsolve.mw

@Rio I mainly just played around trying different things. The two simplest things to note are: 

If you just want to add things up and not find some formula for the sum, use add not sum (though, against this rule the formula for f runs more slowly with add than sum, for some reason I didn't analyze).

In general, floats introduce inaccuracy, so avoid them as long as possible; just use them right ar the end. This is critical here, where in A and B you are adding ca 20,000 terms, so errors accumulate to destroy any meaningful answer (unless the terms are all of comparable magnitude).

@Carl Love Nice analysis. Vote up.

@JAMET   {a = 1.354182738 c, b = 1.149311492 c, c = c} means c can be anything, e.g., if c=1, then a = 1.354182738 and b = 1.149311492. If you choose other c values you will get other a and b values.

@JAMET I assume you are talking about the prompts from the geometry package. From the help page ?geometry:

"A simple way to set the names without being prompted is to set the environment variables _EnvHorizontalName and _EnvVerticalName to the axes names that you prefer; otherwise, Maple will prompt you to input of the name of the axes."

@MaPal93 Perhaps a version difference. Pity, since yours has italic "=0".

InertForm:-Display(`%>`(%limit(X[i] %^ (rho = 0), alpha = infinity), 0), inert = false)

plot(x^2,title=InertForm:-Display(`%>`(%limit(X[i]^`&rho;=0`, alpha = infinity), 0), inert = false));

NULL

Download Inertform.mw

@goebeld 

if sol[2]  gives  {x=3, y=5}, then

eval(x, sol[2])  gives 3
eval(y, sol[2]) gives 5

eval(x^2+y, sol[2]) gives 14

eval([x,y], sol[2]) gives [3,5]

Note. sol[2,1] is not recommeneded because the sets do not have a specified order. Solve can give lists instead of sets using

solve([fx, fy], [x, y])

rhs(x=3) gives 3, lhs(x=3) gives x.

@vs140580 Open Maple is for working at the individual command level, e.g., calling a procedure, but if you want to use an existing worksheet file, it would be simplest to have a worksheet that reads a file that python produces, and then writes a file that python uses.

Then probably you could from within python do:

1. write a file for maple to use

2. initiate Maple by some system call from python (most languages have this, but I'm not a python user so I don't know)

3. wait until the file maple writes exists

4. read it in.

Alternatively you could run Python and Maple by turns in a batch file from your operating system.

See help for Jupyter for using Maple directly from Jupyter notebooks (without using Python) in Maple 2022 and later. To call Maple directly from within Python, Open Maple may be used, see ?OpenMaple,Python,API

Note also that there is the possibilty to use Python from within Maple - see help on the Python package. Python code can also be directly entered into a code edit region.

I can use Tools -> Assistants -> Import data to successfuly read an Excel file on my local machine, which I think you can also do (but maybe "copy into Excel" means something else). If so, what sort of file locations can you not successfully read, and what is the result (hangs?, error message?...).

@salim-barzani 

You have a large polynomial system that is going to be slow. Among other changes, removing the explicit option saves about 25%. I have also added general suggestions that may be useful in the future.

new1.mw

@salim-barzani Solve(identity(... takes an equation, not multiple equations as CoefficientNullity is.

So you could use 

solve(identity(J, xi), {k, w, A[0], A[1], B[1], a[1], a[2], a[3], a[4], a[5]})

or (probably faster)

solve(identity(DEq1_1, Z), {k, w, A[0], A[1], B[1], a[1], a[2], a[3], a[4], a[5]})

 

First 21 22 23 24 25 26 27 Last Page 23 of 87