Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hi, my problem is that I have a set of variables stored in a list, then when I try to sum with differentiation inside the sum, Maple immediately tries to differentiate before summing, thus returning zero.

 

So I define a list coords := [t, r, theta, varphi], then call sum(diff(r^2, coords[k]), k = 1 .. 4), however Maple does the differentiation first, so it becomes 0 instead of 8r.

 

I attached the maple worksheet with what I did, on the first line I define the list with variables, on the second line I show that maple evaluates diff(r^2, coords[k]) to zero before doing the sum, where k is what is being summed over, on the third line I show that it copes fine if a specific element of the list is called, on the fourth line I show that summation over elements of the list is fine, and the last two lines show an example of the kind of thing I would like to do

 

Is there a way to make this work?

Dear Maple Primes,

could you, please, help me with numeric integration? I’m new in numeric integration and can’t reach desired precision of a result.
Here is the integral f(xmax) that I try to compute for different values of xmax from the interval 0.025..0.24 :

f:=(xmax)->Int(K*F*Int(G*F,x=x..xmax,method=integrationmethod),x=x0..xmax,method=integrationmethod)

where x0 is lower limit of outer integral, x0 := 0.025

and K, F and G are functions of x

K:=x-x0

F:=(a1+a2*x+a3*x2+a4*x5)/(b1*x+b2*x2+b3*x6)

G:=exp(c1+c2*x+c3*x7)

with

a1:=8e3; a2:=6e4; a3:=3e4; a4:=1.8e8;
b1:=9.2e17; b2:=1.1e18; b3:=4.6e21;
c1:=8.202046; c2:=-12.31377; c3:=-818043.42;

Please, notice, that G (as well as G*F) is a steeply decreasing function on the interval x = 0.025..0.24.

I get "a seemingly correct" result (that means that f increases as xmax intreases), when I try to plot f(xmax) for the following "guessed" options

Digits:=15
integrationmethod:=_d01akc
plot(f,0.21..0.24,color=black)

What is puzzling me is that I get a different "seemingly correct" result, when I modify the integral f by,
at fist, multiplying G by a constant (for example Const:=1e20; G:=Const*exp(c1+c2*x+c3*x7) )
and, second, plotting the f divided by this constant:

plot(f/Const,0.21..0.24,color=red)

The following Figure presents the values of f plotted versus xmax with (red curve) and without (black curve) using of the constant Const:

Dear Primes, could you, please, comment on this difference? Because the only indicator that I have (from the analysis of G, F and K) is that f must be a monotonically (and stricktly) increasing function of xmax.

Please, find the maple worksheet in attachment.

Thank you in advance!
Maks

for_primes_numeric_integration_v02.mw

I want to find the maximize and minimize of the function
f:=x->(cos(x)+sqrt(3)*sin(x))/(cos(x)+sin(x)+2);
I tried 
minimize(f(x), x, location = 'true');
and
maximize(f(x), x, location = 'true');
But I didn't get the results.  How do I find the maximize and minimize of above funciton?

Hello,

     I have a very large expression I'm tring to average (by doing limit(1/L*int(<expr>,t=-L..L),L=infinty) ). However, given that this expression is so large (sum of 11k terms), I'm was looking for ways to speed up the calculation and use less RAM.

     I found that applying the lim@int seperately to each term of the sum helps. Also, since my integrand has various functions of other variables (eg. f(x), g(y), etc), Maple seems to go faster if I freeze those functions using frontend.

     However, the problem I'm running into is that, as I'm running through my for-loop to apply lim@int to each term, Maple starts running slower and slower, as well as taking more and more RAM. Additionally, it doesn't go to completion because it runs out of stack space.

     Is there an optimization trick to avoid this problem? I've tried garbage collecting after each iteration; that helps the RAM problem (at a cost of speed), but it still slows down over time.

      I've attached my code: MWE.maple. Fair warning: on a non-server computer, it is liable to run very slow.

Is it possible to convert E1(x) to Ei(x) explicitly?

In particular I have this expression which is real, but imaginary numbers appear due to the definition of Ei1 for negative arguments.

(-exp(j*z)*Ei(1, j*z)+I*Pi*exp(-j*z)+exp(-j*z)*Ei(1, -j*z))/(2*j)

 

j>0,z>0

 

Thank you

In the application whose link is below, an error message results when I right click the fsolve command and select explore.

https://www.maplesoft.com/applications/view.aspx?SID=119851

I would like to explore changes to several of the parameters in the equations named "sys", especially the value of Qoutflow. Can this be done and, If so, how can the solved values, Q1, Q2, Q3, and H be graphed as the slider values of individual parameters values are modified?

1) How can i get the event time. This example 0.69313.

2) I don't want to see the Warning.How can i do it? 

 

Warning, cannot evaluate the solution further right of .69314729, event #1 triggered a halt

how i can dsolve this equations and  convert the equations to an explicit first-order system ?

Also parameter 'p' is unknown and shoud be found.

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system
error2.mw

``

restart

with(PDEtools, casesplit, declare);L:=0.75e-4:

[casesplit, declare]

(1)

eq1:=0.2079268293e-3*(diff(psi(x), x, x))-101.2059621*(diff(u(x), x, x))-101.2059621*(diff(w(x), x))*(diff(w(x), x, x));
##
eq2:=0.2079248162e-3+29.57317072*psi(x)-29.57317072*(diff(w(x), x))-1.996189024*10^(-9)*(diff(psi(x), x, x))-1.996189024*10^(-9)*(diff(w(x), x, x, x));
##
eq3:=151.8089432*(diff(w(x), x))^2*(diff(w(x), x, x))+101.2059621*(diff(u(x), x, x))*(diff(w(x), x))+101.2059621*(diff(u(x), x))*(diff(w(x), x, x))-0.2079268293e-3*(diff(psi(x), x, x))*(diff(w(x), x))-0.2079268293e-3*(diff(w(x), x, x))*(diff(psi(x), x))+29.57317070*(diff(w(x), x, x))-29.57317072*(diff(psi(x), x))-1.996189024*10^(-9)*(diff(psi(x), x, x, x))-1.996189024*10^(-9)*(diff(w(x), x, x, x, x))-p*(diff(w(x), x, x));

0.2079268293e-3*(diff(diff(psi(x), x), x))-101.2059621*(diff(diff(u(x), x), x))-101.2059621*(diff(w(x), x))*(diff(diff(w(x), x), x))

 

0.2079248162e-3+29.57317072*psi(x)-29.57317072*(diff(w(x), x))-0.1996189024e-8*(diff(diff(psi(x), x), x))-0.1996189024e-8*(diff(diff(diff(w(x), x), x), x))

 

151.8089432*(diff(w(x), x))^2*(diff(diff(w(x), x), x))+101.2059621*(diff(diff(u(x), x), x))*(diff(w(x), x))+101.2059621*(diff(u(x), x))*(diff(diff(w(x), x), x))-0.2079268293e-3*(diff(diff(psi(x), x), x))*(diff(w(x), x))-0.2079268293e-3*(diff(diff(w(x), x), x))*(diff(psi(x), x))+29.57317070*(diff(diff(w(x), x), x))-29.57317072*(diff(psi(x), x))-0.1996189024e-8*(diff(diff(diff(psi(x), x), x), x))-0.1996189024e-8*(diff(diff(diff(diff(w(x), x), x), x), x))-p*(diff(diff(w(x), x), x))

(2)

dsys3 := {eq1, eq2, eq3, psi(0) = 0, psi(L) = 0, u(0) = 0, u(L) = 0, w(0) = 0, w(L) = 0, ((D@@1)(psi))(0) = 0, ((D@@1)(w))(0) = 0, ((D@@1)(w))(L) = 0}; dsol5 := dsolve(dsys3, 'maxmesh' = 1200, numeric, abserr = .1, output = array([L]))

Error, (in dsolve/numeric/bvp/convertsys) unable to convert to an explicit first-order system

 

L

0.75e-4

(3)

``


 

Download error2.mw

 

 

The procedure F computes the smallest prime factor of  ithprime(n)-2

F := n -> ifactors((ithprime(n)-2))[2][1][1]:

F(11);
                               29
Strangely, print(F)  must be interrupted!
print(F);
Warning,  computation interrupted
 
Also,

F := n -> ifactors((ithprime(n)-2))[2][1][1];

Warning,  computation interrupted
Warning,  computation interrupted

(F is defined, only the display fails).
This happens only for interface(typesetting=extended).
In Maple 2017 it was OK.

 

how I can remove this error.

Error, numeric exception: division by zero

code2.mw

Hello,

      I was trying to apply some assumptions to a pdsolve command and noticed a strange error. Here's a minimal working example.

restart():

pdsolve(diff(f(t,x),t) = 0, {f(t,x)}, ivars = {x, t}) assuming x::real:

returns

Error, (in simpl/relopsum) invalid terms in sum: diff(f(t,x),t) = 0

Is this indeed a bug, or is it expected behavior?

Hello I don't mean this to the discredit of any others, and attempted to use the "contact user" feature, but the emails bounced, anyway I was hoping to get the user @Carl Love or @acer to assist me with this subject https://math.stackexchange.com/questions/2814343/finding-a-better-approximation-to-a-prime-number-relation

with(numtheory):

q := proc (h) options operator, arrow; min(`minus`(divisors(h*floor(ithprime(h)/h)), {1})) end proc;

DATA := [seq([h, simplify((h*igcd(h, h*q(h))-floor(sqrt(h))*igcd(floor(sqrt(h)), q(h)))^(1/2), 'radical')], h = 1 .. 300)];

 


plots[:-pointplot](DATA, color = "Black");
 

 

 

We have released an update to Maple, Maple 2018.1. This release provides enhancements to the mathematical computation engine, including physics and DEs.  It also provides substantial improvements to the command line version, easier access to group management tools in the MapleCloud, and a few other interface improvements.

This update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2018.1 download page, where you can also find more details.

I was using the following idea to get the computation time of my computations in Maple;

s:=time():
my computation
print(time()-s);

But it seems if I use

Grid:-Map(m->My computation(m),[some sequence]);

Where the sequence has more than one element, this idea doesn't work! It seems Maple time() remains fixed during this Grid:-Map when the sequence has more than one element. So then how should I check the computation time?

In the following pictures you can see when the sequence has one element, it works normal, but when it has two elements, it doesn't work the same.

What is the best way to solve the coupled differential equation sets (like below) in Maple?

 

First 795 796 797 798 799 800 801 Last Page 797 of 2219