Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello!

Using a geometry package, I ran into a problem: the area() function returns the wrong value for square elements.

What am I doing wrong?

_local(D)

with(geometry)

b := 2

h := 1

square(sq1, [point(A, 0, 0), point(B, b, 0), point(C, b, h), point(D, 0, h)])

evalf(area(sq1))

2.500000000

(1)

draw([sq1, A(printtext = true), B(printtext = true), C(printtext = true), D(printtext = true)])

 

triangle(tr1, [point(A, 0, 0), point(B, b, 0), point(C, b, h)])

evalf(area(tr1))

1.

(2)

draw([tr1, A(printtext = true), B(printtext = true), C(printtext = true)])

 

NULLNULL

NULL

b := .1

h := 1

square(sq2, [point(A, 0, 0), point(B, b, 0), point(C, b, h), point(D, 0, h)])

evalf(area(sq2))

.5050000000

(3)

draw([sq2, A(printtext = true), B(printtext = true), C(printtext = true), D(printtext = true)])

 

triangle(tr2, [point(A, 0, 0), point(B, b, 0), point(C, b, h)])

evalf(area(tr2))

0.5000000000e-1

(4)

draw([tr2, A(printtext = true), B(printtext = true), C(printtext = true)])

 

``


 

Download GeometryAreaTest.mw

h1=-i(c1*exp(A)-c2*exp(-A));

h2=c2*exp(A)+c1*exp(-A);

A=(i*a/2)*(x+b*t);

c1=sqrt(a+2*lambda)/a;

c2=sqrt(a-2*lambda)/a;

How to simplify the product of h1 and h2 in terms of trignometric functions?

h1*h2=?

Hi,

In the attached file I have added four equations and four unknown values. I would like to find the unknown values a[1], b[1], A[1], and B[1]. At the moment Maple cannot find the solutions. Can I add some conditions to help this?

 

SimulteniousEq.mw

Thanks,

Baharm31

Word-cloud is popular function which many languages have as add-on. Sometime called tag-cloud. https://en.wikipedia.org/wiki/Tag_cloud

"A tag cloud (word cloud or wordle or weighted list in visual design) is a novelty visual representation of text data"

I did help and did some google search, but can not find function in Maple. May be I did not search correctly.

In Mathematica is it called WordCloud. Here is an example of its use

WordCloud[Import["http://maplesoft.com"]]

And it returns this image back to the screen

 

Can one do the above in Maple? And what is the function name? Is it in special package?

 

Hi

Is seem that maple change the order of the equation when I convert the system to matrix form

1) Can I kee the same order of the equations proposed in the system in order to get a special matrix form

2) Can I display the vector used in generating matrix maybe the order of unknown is inverted

system.mw

many thanks

 

Hi, 

The present work is aimed to show how bayesian inference methods can be used to infer (= to assess) the probabilility that a person detected infected by the SARS-Cov2  has to die (remark I did not write "has to die if it" because one never be sure of the reason of the death).
A lot of details are avaliable in the attached pdf file (I tried to be pedagogic enough so that the people not familiar with bayesian inference can get a global understanding of the subject, many links are provided for quick access to the different notions).

In particular, I explain why simple mathematics cannot provide a reliable estimate of this probability of death (sometimes referred to as the "death rate") as long as the epidemic continues to spread.

Even if the approach presented here is rather original, this is not the purpose of this post. 
Since a long time I had in mind to post here an application concerning bayesian methods. The CoVid19 outbreak has only provided me with the most high-profile topic to do so.
I will say no more about the inference procedure itself (all the material is given in the attached pdf file) and I will only concentrate on the MAPLE implementation of the solution algorithm.

Bayesian Inference uses generally simple algorithms such as MCMC (Markov Chain Monte Carlo) or ABC (Approximate Bayesian Computation) to mention a few, and their corresponding pseudo code writes generally upon a few tens of lines.
This is something I already done with other languages but I found the task comparatively more difficult with Maple. Probably I was to obsess not to code in Maple as you code in Matlab or R for instance.
At the very end the code I wrote is rather slow, this because of the allocated memory size it uses.
In a question I posed weeks ago (How can I prevent the creation of random variables...) Preben gave a solution to limit the burst of the memory: the trick works well but I'm still stuked with memory size problems (Acer also poposed a solution but I wasn't capable to make it works... maybe I was too lazzy to modify deeply my code).

Anyway, the code is there, in case anyone would like to take up the challenge to make it more efficient (in which case I'll take it).

Note 1: this code contains a small "Maplet" to help you choose any country in the data file on which you would like to run the inference.
Note 2: Be careful: doing statistics, even bayesian statistics, needs enough data: some countries have history records ranging over a few days , or no recorded death at all; infering something from so loos date will probably be disappointing

The attached files:

  • The pdf file is the "companion document" where all or most of it is explained.It has been written a few days ago for another purpose and the results it presents were not ontained from the lattest data (march 21, 2020 coronavirus)
  • xls files are data files, they were loaded yesterday (march 28, 2020) from here coronavirus
  • the mw file... well, I guess you know what it is.
     

Bayesian_inference.pdf

total-cases-covid-19_NF.xls

total-deaths-covid-19_NF.xls

Bayesian_Inference_ABC+MCMC_NF_2.mw


 

Dear all

I have a second order partial differential equation.

I addeded some boundary conditions.

I tried to use plot3d for a function u(x,y) but there is no figure displayed.

 

plot_3d_curve.mw

 

I use Maple 18

Many thanks for your help

 

 

In maple plot, very many symbols like, diamond, star, solidcircle are available. Many of them may have been used also for teaching purposes.

Recently, someone encountered the need to draw graphs with arrowheads and many solutions may be available as well. But it requires a thorough understanding of maple's features which are infinitely many. My feeling was that an arrow symbol also could be added in the symbol feature so that the option can be used as a plot point in the graph at the graph end points very easily. It can be just like adding a solidbox symbol at any point on the curve.

Hope my suggestions are in order.

Thanks.

Ramakrishnan V

In Maple, the  function returns the ith prime number. Note that 1 is not a prime number. The first prime number is 2. For example,

 

 

Hello.

I'd like to extract numerical data from the plot of a implicit function and write it to the txt file. But, unfortunately due to a strong oscillating function and as a consequence extremely dense meshgrid I got a message that [Length of output exceeds limit of 1000000]. How to resolve this problem? Below is my code

restart;
R0 := 1+w_c*(sum((2*(-1)^(n+1)*Pi^2/n*n)*t*sin(2*Pi*n*mu/w_c)*cos(Pi*n)*exp(-2*Pi*n*G/w_c)/(w_c*sinh(2*Pi^2*n*t/w_c)), n = 1 .. 3000))/Pi-mu;
with(plots, implicitplot);
G := 0.; t := 0.1e-2;
R1 := implicitplot(R0, w_c = 0 .. 5, mu = 0 .. 3, gridrefine = 10):
data := getdata(R1);

Thank you in advance.

Knowing X's PDF is a piecewise function,=cx^2 for 0<=x<3, 0,otherwise

Q1 solve P{-1<=X<=1}

Is it possble to use CDF solve?or I must use calculus?

 

 

 

 

Dear Friends

I would like to know how I can show a simple arrow on a curve in a plot. For example for the simple sample y=x^2, for x>0, I want to show with an arrow in the figure that the trajectory begins from the point (0,0) and tends to come to the point (3,9). Or any other examples you want.

Thanks a lot

i want to plot

u(x,y,z,t)=tanh(x+y+z-wt),  (w is a constant)

could you help me please? 

i would like to to test and do hash on a 2d array and then predict this hash and then reverse back to another hash which can convert back to 2d array , how to do?

First 448 449 450 451 452 453 454 Last Page 450 of 2097