Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

In trying to create a plot that shades the region between two concentric circles, I decided to try using the Picture procedure found here: https://www.mapleprimes.com/posts/145922-Perimeter-Area-And-Visualization-Of-A-Plane-Figure-

This is as far as I got.


 

"Picture := proc (L, C, N::posint := 100, Boundary::list := [linestyle = 1])    local i, var, var1, var2, e, e1, e2, P, Q, h;    global Border;    for i to nops(L) do    if type(L[i], listlist(algebraic)) then P[i] := op(L[i]) else    var := lhs(L[i, 2]); var1 := lhs(rhs(L[i, 2])); var2 := rhs(rhs(L[i, 2])); h := (var2-var1)/N;    if type(L[i, 1], algebraic) then e := L[i, 1];    if nops(L[i]) = 3 then P[i] := seq(subs(var = var1+h*i, [e*cos(var), e*sin(var)]), i = 0 .. N) else    P[i] := seq([var1+h*i, subs(var = var1+h*i, e)], i = 0 .. N) end if else    e1 := L[i, 1, 1]; e2 := L[i, 1, 2]; P[i] := seq(subs(var = var1+h*i, [e1, e2]), i = 0 .. N) end if end if    end do;    Q := [seq(P[i], i = 1 .. nops(L))];    Border := plottools[curve]([op(Q), Q[1]], op(Boundary));    [plottools[polygon](Q, C), Border];    end proc:"

L := [[3, t = 0 .. 2*Pi, polar], [2, t = 0 .. 2*Pi, polar]]; plots[display](Picture(L, color = yellow, [color = brown, thickness = 3]), scaling = constrained, view = [-4 .. 4, -4 .. 4])

 

NULL


Clearly, this is not what I want. I am probably missing something simple here. How can I get only the region between the two circles to be shaded?

Download shading_annular_regions.mw

 

 

 

Hello friends
PLEASE HELP 

I have the following issue 

I want to make one plot with specific values of argument 

here is an example of 2d plot ,


what i want is to plot the same graph only with specific values of x for example x =-pi..pi/2  , -pi/4..pi/4  and so on 

but this has to be in one plot , could please tell me the options how I can manage this problem .  

 

At the end its a 3Dplot , x is a function of y and t  

so actually i want to make 3d plot in a different ares of y and t 

something like this plot3d(u ,x=-1..1,t=-1..1 , x=2..3 , t=2..3 .... ) 
or maybe in opposite way ,to restrict some values of x and t 

( idea is that function is periodic but I dont want to get crazy high values of the function, especially where functuon goes to infinity  ) 

PLEASE HELP 

thank you very much in advance 

Hi

 

Can anyone please help me Ive been stuck on this program for ages and cant see what I'm doing wrong?

Here is the code:

restart;
randomize();
npaths := 10;
nsteps := 1;
S0 := 100.0;
K := 100;
T := 0.25;
r := 0.05;
sig := 0.15;
lambda := 0.1;
a := -0.9;
nu := 0.45;
m := exp(a + (0.5*nu)*nu);
mu := r - (m - 1.0)*lambda;
dt := T/nsteps;
with(Statistics);
N := RandomVariable(Poisson(lambda*dt));
Z := RandomVariable(Normal(0, 1));
                           1059210787

                            K := 100

                           T := 0.25

                           r := 0.05

                          sig := 0.15

                         

Xsum:=0.0: #`Initialise sum of payoffs over all paths` Asum:= 0.0:   for i from 1 to npaths do    S[0]:=S0 : #` initialise`   lnS:=ln(S[0]):    Stot := 0.0:    for i from 1 to nsteps do  N1:=Sample(N,1)[1]: #` sample number from poisson distribution`  Z1:=Sample(Z,1)[1]: #` sample number from normal distribution`   dlnS:=r*dt+(mu-r)*dt-0.5*sig^(2)*dt+N1*ln(m)-0.5*nu^(2)*N1+sqrt(sig^(2)*dt+nu^(2)*N1) *Z1: #` Joshi 15.12`   lnS:=lnS+dlnS:  #print(cal,N1*ln(m)-0.5*nu^(2)*N1);  S[i]:=exp(lnS):  Stot:= Stot + S[i]:     end do:    #`European Call Option (Parrott)`  X1:=max(0.0,K-S[nsteps]):  Xsum:=Xsum+X1:    #`Asian Call Option`  Save := Stot/(nsteps):  A1 :=max(0.0, K-Save):  Asum := Asum + A1:     if(k mod 10 = 0) then print (k, Euro Call,X1, Asian  Call, A1)end if:   if (k=1) then Sp1:=copy(S) end if:   if (k=2) then Sp2:=copy(S) end if:   if (k=3) then Sp3:=copy(S) end if:     end do:    #`Euro Call`  X0:=exp(-r*T)*(  Xsum)/(npaths);   print("Euro call price at t=0",X0, "actual",3.1490);       #`Asian Call`  A0:=exp(-r*T)*(  Asum)/(npaths);   print("Asian call price at t=0",X0, "actual", A0);   #`Plot of three sample paths: to generate decent looking paths, set npaths=3, and nsteps=1000 above and rerun`    data1:=[seq([ i*dt,Sp1[i]],i=0..nsteps)]:  data2:=[seq([ i*dt,Sp2[i]],i=0..nsteps)]:  data3:=[seq([ i*dt,Sp3[i]],i=0..nsteps)]:  plot([data1,data2,data3]);               ;

 

The errors i get are unterminated loop and parse.

 

Thank you
 

Hello friends,

I'm trying to get the exact result from the following operation:

I'm getting:

for i=0,

for i=1,

for i=2,

I want to get:

for i=0, 1

for i=1, -1/2 + sqrt(3)/2 i

for i=2, -1/2 - sqrt(3)/2 i

Thanks for the light.

Maple has issues integrating products of Bessel functions over an infinite range, and in fact, this extends to trig functions. The integrals in the attached should return as delta functions but don't. 

Spherical_Bessel_identity.mw

Is there like https://oeis.org/   Library available in maple for enumerate in for loop?

i would like to like shift 9 times and create 100 mapping for each sequence 

Hello Users!

I want to assign some specific names of elements in a vector A:

A:=Vector[row](19, {(1) = 14.9057064333276, (2) = 14.4384716751962, (3) = 14.0155569170648, (4) = 13.6381346589334, (5) = 13.3075724008020, (6) = 13.0254476426706, (7) = 12.7935628845392, (8) = 12.6139606264079, (9) = 12.4889383682765, (10) = 12.4210636101451, (11) = 12.4131888520137, (12) = 12.4684665938823, (13) = 12.5903643357509, (14) = 12.7826795776196, (15) = 13.0495548194882, (16) = 13.3954925613568, (17) = 13.8253703032254, (18) = 14.3444555450940, (19) = 14.9584207869626});

like

y[1,1]:=14.9057064333276;

y[1,2]:=14.4384716751962;

y[1,3]:=14.0155569170648;

...

y[1,19]:=14.9584207869626;

Later, I have to use y[1,1], y[1,2],...,y[1,19] for further calculations. I used op command but it does not work. Please help me how I can assign the name. 

I am waiting for your respone. Thanks in advance.

when I define piecwise function as

f := x -> piecewise(0 <= t, 1, t < 0, t - 1)

and I define his antiderivative

F := x -> int(f(t), t = 1 .. x)

F(x)

Maple gives

x - 1

which is obviously wrong (but I guess it's ok only for x=>0)

what to do to be correct?

f := n->local p := round(n) mod 2; 1/2 + (-1)^p/n/2^p;
f := proc (n) options operator, arrow; `if`(1 < modr(n-1/2, 2),

   1/2+1/n, 1/2-(1/2)/n) end proc


     f := proc (n) local p; options operator, arrow; p :=

f := n->local p := round(n) mod 2; 1/2 + (-1)^p/n/2^p;

f~([$1..10]);

Correct plot
plot('f'(n),n=1..10,0..1);

 

Wrong plot

plot(f(n),n=1..10,0..1);

 

Can someone explain why I have to put ' ' around f to get the right plot? Clearly it has something to do with round and/or mod. Why does maple have this stupid issues? Cause it seems like it is very error prone. I know it's wrong only cause I know what to expect.

I'm trying to lad a comma separated data set and I get an "Invalid minus error".  Neither the filename nor the data set has a minus anywhere in them.  See attached file:  SST Gm Stats.mw  

Download SST_Gm_Stats.mwDownload SST_Gm_Stats.mw

Since I can't upload a .csv file here are its contents:

5248.65,5178.95,5231.01,5161.78,5329.23,5258.52,5311.33,5241.1,5268.2,5198.26,5250.5,5181.03,5348.75,5277.8,5330.79,5260.32,5248.91,5179.21,5231.27,5162.03,5329.49,5258.77,5311.59,5241.35,5268.47,5198.53,5250.77,5181.29,5349.02,5278.06,5331.06,5260.58,5238.16,5168.61,5220.56,5151.47,5318.58,5248.01,5300.72,5230.63,5257.68,5187.88,5240.02,5170.68,5338.06,5267.25,5320.15,5249.81,5238.42,5168.86,5220.82,5151.72,5318.84,5248.27,5300.98,5230.88,5257.95,5188.14,5240.28,5170.94,5338.33,5267.52,5320.41,5250.07,5249.41

Where's the "minus" let alone an invalid one?

John

 

Let's say I have an mpl file and in this file there are several lines $include<~/~/~.mpl> and in some of those called mpl files, there are also some more include lines. And assume the paths of these files are given relative to a specific folder. Now I guess this specific folder has to be mentioned by modifying includepath. But looking at the help pages related to includepath (here and here) I get this sentence "it can be modified by calling kernelopts(includepath)", but I tired typing things like kernelopts(includepath):="C:\\Homes\\testFolder"; and still I see "" for kernelopts(includepath);. How can I tell Maple to look for the files relative to this location either by typing something at the Maple worksheet before typing read("C:\\Home\\testFolder\\main.mpl); or by adding a line at my main mpl file?

Is there a Maple command to obtain a Taylor series and partial sums of exp(A) where A is a square matrix ?

Some of you know me from my occasional posts on Maple’s typesetting and plotting features, but today, I am here in my new role as co-chair (along with Rob Corless of Western University) of the 2021 Maple Conference. I am pleased to announce that we have just opened the Call for Presentations.

This year’s conference will be held Nov. 2 – Nov. 5, 2021. It will be a free virtual event again this year, making it an excellent opportunity to share your Maple-related work with others without the expenses and inconveniences of travel.

Maple Conference 2021 invites submissions of proposals for presentations on a range of topics related to Maple, including Maple in education, algorithms and software, and applications. All presenters will be given the option of submitting a full paper, which will undergo peer review, and if accepted, be included in the conference proceedings.

Presentation proposals are due June 1, 2021.

You can find more information about the themes of the conference, how to submit a presentation proposal, and the program committee on Maplesoft Conference Call for Presentations.

Registration for attending the conference will open in June. Another announcement will be made at that time.

I sincerely hope that all of you here in the Maple Primes community will consider joining us for this event, whether as a presenter or attendee.

Hi everyone, i want to draw 3d graphics of fractional solution with given by Mittag Leffler function in cantor sets. I want to see like this graphic. I added maple file. Thanks in advance.

3D_graphic.mw3D_graphic.mw

Dear all

I tried to used insert code edit region, to write many subcodes 

but no return varibales names.

example, x:=3;

when I run the code, I get only the number affected to x, I would like to get 

x:=3

No_return_variable.mw

Thank you 

 

 

First 291 292 293 294 295 296 297 Last Page 293 of 2097