## 2103 Reputation

14 years, 249 days
Draeger Medical Systems, Inc.

Regards,
Georgios Kokovidis
Dräger Medical

## Create vector and use it in function...

Below is my interpretation of what the OP is trying to do.  I'm not sure if the word Vector is relevant here.

The attached creates a sequence of points, like acer shows, spaced at 0.5.  Then there is a function mapped to these

points ( 5*x^2+3).  Then x and y are plotted against each other.

 > restart:
 > x:=[seq(0..20,0.5)];
 (1)
 > y:=[seq(5*i^2+3,i=x)];
 (2)
 > xylist := zip( (x,y) -> [x,y], x, y);
 (3)
 > plot(xylist);
 >

## convert complex number to exponential fo...

@digerdiga The procedure by Preben Alsholm, from a previous posting here, does what you are looking for.

Regards,

Georgios

## Plot the Function...

restart: with(plots):

f:=(x)->-(2.50000000000000000000000000000*(-2.424176758*10^30*x^5+5.982448001*10^29*x^3+(5.336360731*10^33*I)*exp((4.0405213687327619451756171962*I)/x)+(3.144879905*10^98*I)*exp((48.6318841588794957405477169504*I)/x)+(8.489643736*10^35*I)*exp((4.04052136873276194517561719622*I)/x)))*x^6/((1.009157478*10^101*I)*exp((48.6318841588794957405477169504*I)/x)*x^6-2.760182453*10^32*x^11-(7.651751413*10^37*I)*exp((4.0405213687327619451756171962*I)/x)*x^4+1.887831524*10^32*x^9-(8.567811466*10^36*I)*exp((4.04052136873276194517561719622*I)/x)*x^4-(1.207009672*10^100*I)*exp((48.6318841588794957405477169504*I)/x)*x^4+(6.538572988*10^29*I)*x^6+(1.246166933*10^31*I)*x^10-1.837651455*10^31*x^7+(1.504191760*10^38*I)*exp((4.04052136873276194517561719622*I)/x)*x^6+1.574891043*10^34*exp((4.0405213687327619451756171962*I)/x)*x^5-(7.612867062*10^30*I)*x^8+4.556143298*10^99*exp((48.6318841588794957405477169504*I)/x)*x^5-(2.488678360*10^105*I)*exp((52.6724055276122576857233341466*I)/x)+6.791123646*10^36*exp((4.04052136873276194517561719622*I)/x)*x^5-3.454612059*10^36*exp((4.0405213687327619451756171962*I)/x)*x^3-4.710342238*10^98*exp((48.6318841588794957405477169504*I)/x)*x^3+(3.488285966*10^35*I)*exp((4.0405213687327619451756171962*I)/x)*x^6+5.512268188*10^106*exp((52.6724055276122576857233341466*I)/x)*x);

complexplot(f,0.2..0.4);

Regards,

Georgios

## boundary conditions for the above spin t...

All files from the book can be found on the Springer web site.  Link below.  Available for Maple 5 and 6.

http://extras.springer.com/2000/978-0-8176-4119-1/Maple_6

Regards,

Georgios

## pvalue of TwoSampleTTest...

You can assign the output, and then extract the p-value.  Test example attached.

 > restart:with(Statistics):infolevel[Statistics] := 1:
 > Data2 := [[65., 77.], [61., 74.], [81., 80.], [88., 76.]];
 (1)
 > X2:=[seq(Data2[i,1],i=1..nops(Data2))];
 (2)
 > Y2:=[seq(Data2[i,2],i=1..nops(Data2))];
 (3)
 > ans:=TwoSampleTTest(X2, Y2, 0, confidence = .95);
 Standard T-Test on Two Samples (Unequal Variances) -------------------------------------------------- Null Hypothesis: Sample drawn from populations with difference of means equal to 0 Alt. Hypothesis: Sample drawn from population with difference of means not equal to 0 Sample sizes:            4, 4 Sample means:            73.75, 76.75 Sample standard devs.:   12.842, 2.5 Difference in means:     -3 Distribution:            StudentT(3.22706145179607) Computed statistic:      -0.458608 Computed pvalue:         0.675655 Confidence interval:     -23.0134910663555 .. 17.0134910663555                          (difference of population means) Result: [Accepted] This statistical test does not provide enough evidence to conclude that the null hypothesis is false
 (4)
 > ans;
 (5)
 > ans[4];
 (6)
 > rhs(ans[4]);
 (7)
 >

Regards,

Georgios

## How to convert Pi to a numerical answer....

evalf((1/2)*Pi+I*ln(5+2*sqrt(6)));

you can also change your limits from 0 to 5.0, like this x=0..5.0, and your should get a floating point answer as well.

Regards,

Georgios

## How to Plot Multiple Graphs for Comparis...

It is not clear from your table which of the columns are the ones of interest.  The code below can be modified to give you what you are looking for.  It works with older versions of Maple as well.  The data for this example is in a file on my Windows desktop.  Your data can be anywhere you like, as long as your path in the worksheet matches.  For this example, I left the semicolons at the end of the lines that starts with Data:=, and x:=, y1:= ... just to show that the file was loaded.  Once I know this, I would replace it with a colon, just to avoid the clutter of having all of the data shown in the worksheet.

 > restart:with(plots):
 (1)
 > x:=[seq(Data[i,1],i=1..nops(Data))];
 (2)
 > y1:=[seq(Data[i,2],i=1..nops(Data))];
 (3)
 > y2:=[seq(Data[i,3],i=1..nops(Data))];
 (4)
 > y3:=[seq(Data[i,4],i=1..nops(Data))];
 (5)
 > p1:=plot(x,y1,color=red):
 > p2:=plot(x,y2,color=blue):
 > p3:=plot(x,y3,color=green):
 > display(p1,p2,p3,gridlines=true);

## While Loop plus other repetition stateme...

@asukumari The folling links are useful for examples.

https://www.maplesoft.com/applications/view.aspx?SID=1558&view=html

http://math.pnw.edu/~rlkraft/mfmm/pdf/Worksheet14.pdf

https://www.mapleprimes.com/questions/138251-An-Example-Of-A-While-Loop

There are documents on the web.  Google search for "Maple while loop examples"

If you are looking to do something specific with a while loop, let us know.

Regards,

Georgios

## Evaluate expression at value...

Change the 5 to 5. or 5.0, which will give you a floating point approximation in your answer, which is what the call to evalf is doing in your third line.

eval(f, x = 5.0);

Regards,

Georgios

## RC Impule Response...

See worksheet below, which is derived from the help file link that you provided.

 > restart: with(DynamicSystems):
 >

The transfer function of an RC circuit with RC=1 is 1/(s+1), derived from Nodal Analysis.

 > sys1 := TransferFunction(1/(s+1));
 >
 (1)
 > ImpulseResponsePlot(sys1, 5);
 >

Compare the plot above to the expected response that you show in line 3 of your post.

 > plot(exp(-t),t=0..5);
 >
 >

## Example using the product command...

This works for your example.  You can use the solve command as well.  fsolve was simpler for this case.  Try it and see if it is what you are looking for.

 > restart:
 > x:=product(exp(1/i), i = 1 .. n);
 (1)
 > fsolve(x-100,n);
 (2)
 > round(%);
 (3)
 > evalf(product(exp(1/i), i = 1 .. 56));
 (4)
 >

## rand...

@Teep Here is another way.  The seq version allows you to generate as many numbers as you like.

 > restart:with(RandomTools):randomize():
 > Generate(float(range=-0.5..0.5,digits=3));
 (1)
 > [seq(Generate(float(range=-0.5..0.5,digits=3)),i=1..10)];
 (2)
 >

Regards,

Georgios

## Copying texts to the clipboard...

There is not a single command to do this (that I know of).  The attached is a hack that works in Windows 7 64-bit, Maple 2015.

The contents of the batch file temp_file.bat are as follows:

clip < temp_file.txt

This is a workaround, because the system command, as well as the ssystem command do not support shell or DOS commands.  The batch file and the temp_file.txt need to be in the same directory.

After running the worksheet, executing Ctrl-V in a new text editor window will display

ee = x^2+y^2+z^2+x+y+z

 > restart:currentdir();
 (1)
 > ee := x^2+y^2+z^2+x+y+z;
 (2)
 > ee:=convert(ee,string);
 (3)
 > fd := fopen("temp_file.txt", WRITE):
 > fprintf(fd, "ee = %s", ee):
 > fclose(fd):
 >
 > ssystem[launch]("temp_file.bat"):
 >

Regards,

Georgios

## expand command does not act as it shoul...

Put a multiplication symbol in between the two parentheses.  (x+1)*(x+2)

Regards,

Georgios

## See help file for convert(pwlist).&...

See help file for convert(pwlist).

xx:=convert(f, pwlist, x);

xx[1], for the first element, xx[2], and so on.

Regards,

Georgios

 1 2 3 4 5 6 7 Last Page 1 of 73
﻿