MaplePrimes Questions

How do I use ErrorPlots to put error bars on my scatter plot of data, AT THE LOCATION OF THE SCATTER PLOT DATA POINT? Below I write an example demonstrating how I plot the data and error bars using ErrorPlots.  When I use display to combine plots you clearly see that the errorbars are not on the scatter plot data points.  How do I give ErrorPlots, the x-y locations of the data points, so it knows to print the error bars on the location of the data points?  Is there a better approach to putting horizontal and vertical error bars onto scatter plot data?

Hello, 

I have some complicated calculations which result in a lot of 1e(-7) or even 1e(-12). These numbers greatly complicate the expersisions without adding any benefits. 

How do I instrcut Maple to round the calculations to the nearest decimal precision?

I tried "Digits" and "Rounding" and "interface(precisiondisplay)" but none of them get rid of something like 3.343^(-12)* expr. 

I still see such infistimal terms showing up. 

If you're wondering, I am exporting these symbolic terms to Matlab to be used as optimization functions. So, having these extra terms add unnecessary optimization steps. 

Thanks. 

A system of differential equations

But solution I want to express in terms of other specified function

How to dsolve to get a solution that in terms of a list of specified function? For example in terms of sin , cos , Bessel etc ?

Sol := [a(t) = sin(t) + cos(t) , b(t)= sin(t) ....]

I try to eliminate m  in                    X := (a*m^2 + 2*m^2*p + 2*p)/(2*m^2)
                                                      Y := a/(2*m)

eliminate({X, Y}, m);
 allvalues(m);
without results. How can I do ? Thank you.

The following code works in one worksheet but not in another (where it returns the error in the title). What could be the reason?

[> restart:
    with(plots):
    with(plottools):
    with(ColorTools):
    P:=display(polygonplot([[0,0],[0,1],[1,1],[1,0]], color=red,axes=none,style = polygon)):
[> exportplot("Test.jpg",P, plotoptions="height=30,width=30,quality=90");

In the worksheet (.mw) where it does work, I can't put the code in one command line unless the file is already there, in which case it overwrites.

- I create a function of 2 variables based on Procedures as follows:

Test := proc (a, b)

local z;

if not is({args}, set(numeric)) then return ('procname')('args') end if;

z := a*x^2+b*y^2-3*x+3*y+3;

minimize(z, location)[1]

end proc:

- The function calculates its value if given the specific values of the variables:

Test(2, 2.5) --> 0.975

- But somehow I can't graph this function with the following syntax:

plot3d(Test(a, b), a = 1.0 .. 5.0, b = 2.0 .. 3.0)

- MAPLe 17 issues the following notice: "Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct". And no graphs are drawn

In the same way, MAPLE 15 can plot the graph. Does anyone know what the problem is with MAPLE 2017 and how to fix it?

Sincerely thank

I noticed Maple changes 1/(4*(x-2)) to 1/(4*x-8)  when copying the output and pasting it back to the worksheet.  

But in the variable it does remain 1/(4*(x-2))  which is what I wanted, as I am going to look for this form later on and I do not want it expanded.

But I am curious why Maple does this. It is a little annoying when copying something from one worksheet to another and have it change.  Here is a small movie and the code to see it. 

Is there a way to prevent this automatic expansion?  Maple 2021.2 on windows 10

 

code

r:=(x^4-8*x^3+24*x^2-24*x+12)/((4*x^2*(x-2)^2)):
rf:=convert(r,fullparfrac,x);

I use worksheet interface and have my display settings as the following

Unless I'm missing something where are the closed integral symbols? 

I couldn't find them but you can create them if you wanted to.  Then I tried adding them to a palette with DocumentTools and couldn't get it to work. 

`∮` `∯` `∰`
                                                        

Creating the double and triple symbols can be done  easily by concatenating as many ∫  as you desire. But can't seem to add them to a palette.

DocumentTools:-AddPalette("Integral Symbols");

AddIcon("Closed Integral",`∮`)

I suppose you need to create a png file for that to work.  However the above would be simpler.

Maybe add functional closed integral operator symbols for the palette? 

how can i factor from 0.03 in this equation and show like the yellow equation

 

 

f := 0.03 - 0.03*cos(5.885*t)

restart;
with(LinearAlgebra):

l_1 := diff(x1(t), t) = 1/2*x1(t) - x2(t) + cos(4*t);
                 d          1                         
         l_1 := --- x1(t) = - x1(t) - x2(t) + cos(4 t)
                 dt         2                         

l_2 := diff(x2(t), t) = 3/2*x1(t) - 2*x2(t) - 1;
                    d          3                    
            l_2 := --- x2(t) = - x1(t) - 2 x2(t) - 1
                    dt         2                    

dsolve({l_1, l_2}, {x1(t), x2(t)});
    /          4               296              28          
   { x1(t) = - - exp(-t) _C1 + ---- sin(4 t) - ---- cos(4 t)
    \          3               1105            1105         

           /  1  \                                    
      + exp|- - t| _C2 + 2, x2(t) = -2 exp(-t) _C1 + 1
           \  2  /                                    

         93              36                /  1  \    \ 
      - ---- cos(4 t) + ---- sin(4 t) + exp|- - t| _C2 }
        1105            1105               \  2  /    / 


A := <<1/2 | -1>, <3/2 | -2>>;
                           [1            ]
                           [-  &uminus0;1]
                           [2            ]
                      A := [             ]
                           [3            ]
                           [-  &uminus0;2]
                           [2            ]

Eigenvectors(A, output = list);
              [                  [        /[2]\ ]]
              [[-1      /[1]\ ]  [        |[-]| ]]
              [[--, 1, { [ ] }], [-1, 1, < [3] >]]
              [[2       \[1]/ ]  [        |[ ]| ]]
              [                  [        \[1]/ ]]

NULL;

I assume, I am getting a result in the format of:

Which implies, that the eigenvalues from dsolve are -1/2 and -1, which are correct according to the eigenvalues gotten from the matrix A.

But the eigenvector for the eigenvalue -1/2 appears to be incorretly given by dsolve, I should get 2/3 and no -4/3 in the top axis of the V_lambda(-1). For the second row I am getting -2 and not 1. It appears that Maple has multiplied the eigenvector for the eigenvalue -1 with -2? Or am I missing something?

If I am not missing anything; what appears to cause this issue?

How to get a general expression here ?

restart

 

f(s) is the function value  expressed as a integral around s  (singularity)  of a complex function.

f(s) = (int(f(z)/(z-s), z))/(2*Pi*I)

f(s) = -((1/2)*I)*(int(f(z)/(z-s), z))/Pi

(1)

f(s) = int(f(z)/(z - s), z)/((2*Pi)*I):

"(->)"

diff(f(s), s) = -((1/2)*I)*(int(f(z)/(z-s)^2, z))/Pi

(2)

"(->)"

diff(diff(f(s), s), s) = -((1/2)*I)*(int(2*f(z)/(z-s)^3, z))/Pi

(3)

"((&DifferentialD;)^(n))/(&DifferentialD;n) f(s)   =  "
                                      

NULL

NULL

                 .......

quote : "Important consequence.

Above it actually says: "If there is a function f(s) that is somewhere analytic, then you can use such an integral as above to make a new function f '(s), which is also analytic there. And from that a new function f '' and so on.
That means something revolutionary for complex numbers:   "

 

================================

Question: how to get the "((&DifferentialD;)^(n))/(&DifferentialD;n) f(s)  "?
===============================

Note : again the form of the answers in Maple : Its not possible to force Maple to come up with this form of answer, ex

``  NULL

Download Maple_primes_bvraag_hoger_orde_singulariteit_henk_hofstede.mw

I do not understand why what I do in my first example does not work in the problem of integral. Can anyone help me? Thank you very much!

 

restart

assume(x > 0)

solve(x^2+3*x-4 = 0, x)

Warning, solve may be ignoring assumptions on the input variables.

 

1, -4

(1)

solve(x^2+3*x-4 = 0, x, UseAssumptions)

1

(2)
   

Download First_example_Maple.mw

 
 
 

f := proc (x) options operator, arrow; sin(100/(x+13)) end proc

proc (x) options operator, arrow; sin(100/(x+13)) end proc

(2.1.1)

g := proc (x) options operator, arrow; 10/(10*x+3) end proc

proc (x) options operator, arrow; 10/(10*x+3) end proc

(2.1.2)
   
 

A := fsolve(f(x) = g(x), x = 1.1)

1.049742001

(2.2.1)

B := fsolve(f(x) = g(x), x = 1.7)

1.676209051

(2.2.2)

C := fsolve(f(x) = g(x), x = 20)

19.35519742

(2.2.3)

 

 

assume(E > C)

solve(int(f(x)-g(x), x = C .. E) = 3, E, UseAssumptions)

Error, (in depends) too many levels of recursion

 

fsolve(int(f(x)-g(x), x = C .. E) = 3, E)

12.00027508

(2.3.1)

fsolve(int(f(x)-g(x), x = C .. E) = 3, E = 30)

28.05987548

(2.3.2)

La valeur de E cherchée est donc d'environ 28,06 unités.

Download Problem_of_integral.mw

This worksheet has an error when executing EulerLagrange.

How can this error be avoided?

Spring_Pendulum.mw

As a Maple user for 10+ years, I've had plenty of stack limit errors, pretty much all of them my fault. But I am currently experiencing a very unusual one after updating my Mac from Maple 2019 to Maple 2021.2.

I am running a long script to fetch json data from a url, parse it, and do a bunch of analysis. In most cases it works fine, but some cases give either an "Execution stopped: Stack limit reached." error, or the error "Error, (in type/polynom) result from type `algfun` must be true or false". Both are being caused by calling the gfun:-ratpolytocoeff command.

I kind of think some internal memory of Maple is being accidentally overwritten because I can cause the error to occur or not occur by adding / commenting out random lines of code that have nothing to do with the part of the code causing the problem. I've managed to find a fairly small script that causes the problem to occur:

with(PolynomialIdeals):
url := "https://api.combopal.ru.is/garpur_run/61e5f7acf2e929ff811caad3":

root_func := F[0, x]:

latex:-Settings(useimaginaryunit=i):

data := URL[Get](url):
json := JSON[ParseString](data):
json := JSON[ParseString](data):

debug_solved := (x^5-3*x^4+5*x^3-7*x^2+4*x-1)/(x^5-5*x^4+10*x^3-10*x^2+5*x-1):

debug_gfun := gfun[ratpolytocoeff](debug_solved, x, n);

If I remove ANY of these lines of code, there is no longer any problem, which is very strange because, for example, I'm not using the PolynomialIdeals package anywhere in the script. This particular script works fine on a Linux machine running 2021.0, but yet I am having similar problems on that machine with other cases.

Here's a slightly simpler example in which gfun[ratpolytocoeff] induces a "division by zero" error ("Error, (in convert/fullparfrac/normal_only) numeric exception: division by zero"):

with(PolynomialIdeals):
url := "https://api.combopal.ru.is/garpur_run/61e5f7acf2e929ff811caad3":

latex:-Settings(useimaginaryunit=i):

data := URL[Get](url):
json := JSON[ParseString](data):
json := JSON[ParseString](data):

debug_gfun := gfun[ratpolytocoeff](1/(1-x), x, n);

After the division by zero error, if I press Ctrl+D to close the Maple command line, it prints
"GC Thread signalAbort 0x7000019a5000 Execution stopped: Stack limit reached.".

Is this an internal Maple bug? Is there any workaround? I am pulling my hair out and would be very grateful for any help.

First 343 344 345 346 347 348 349 Last Page 345 of 2428