gkokovidis

2355 Reputation

13 Badges

20 years, 120 days
Draeger Medical Systems, Inc.

 

 

Regards,
Georgios Kokovidis
Dräger Medical

MaplePrimes Activity


These are answers submitted by gkokovidis

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

 

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.]];

[[65., 77.], [61., 74.], [81., 80.], [88., 76.]]

(1)

X2:=[seq(Data2[i,1],i=1..nops(Data2))];

[65., 61., 81., 88.]

(2)

Y2:=[seq(Data2[i,2],i=1..nops(Data2))];

[77., 74., 80., 76.]

(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

 

hypothesis = true, confidenceinterval = HFloat(-23.013491066355524) .. HFloat(17.013491066355524), distribution = StudentT(HFloat(3.227061451796068)), pvalue = HFloat(0.6756552452824065), statistic = HFloat(-0.45860802898049535)

(4)

ans;

hypothesis = true, confidenceinterval = HFloat(-23.013491066355524) .. HFloat(17.013491066355524), distribution = StudentT(HFloat(3.227061451796068)), pvalue = HFloat(0.6756552452824065), statistic = HFloat(-0.45860802898049535)

(5)

ans[4];

pvalue = HFloat(0.6756552452824065)

(6)

rhs(ans[4]);

HFloat(0.6756552452824065)

(7)

 

Download ttest_pvalue.mw

Regards,

Georgios

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

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):

Data:=readdata("c:/Users/kokoge00/Desktop/methods.dat",float,10);

[[.1, 0.769540597e-1, .1477783335, .1393069312, 0.763361154e-1, .1477867626, .1393072151, 0.763361266e-1, .1477867830, .1393071934], [.3, .1093424148, .1120401102, .1509302274, .1072278404, .1121142033, .1509369166, .1072278479, .1121142168, .1509369024], [.5, .1392030568, 0.853083077e-1, .1558066181, .1353291378, 0.855066806e-1, .1558355785, .1353291558, 0.8550671332e-1, .1558355439], [.7, .1662374563, 0.652194693e-1, .1562235596, .1604342222, 0.655908735e-1, .1562974878, .1604342352, 0.6559089617e-1, .1562974637], [.9, .1903821623, 0.500537619e-1, .1537887672, .1825594352, 0.506356391e-1, .1539346707, .1825594528, 0.5063567192e-1, .1539346352], [1.1, .2117168860, 0.385555127e-1, .1496220815, .2018541863, 0.393727175e-1, .1498707561, .2018542024, 0.3937274753e-1, .1498707234], [1.3, .2303874000, 0.298096396e-1, .1444864012, .2185409755, 0.308687065e-1, .1448804021, .2185409880, 0.3086872986e-1, .1448803765], [1.5, .2465077820, 0.231661161e-1, .1388614678, .2328759081, 0.244336214e-1, .1394893808, .2328759200, 0.2443364533e-1, .1394893543]]

(1)

x:=[seq(Data[i,1],i=1..nops(Data))];

[.1, .3, .5, .7, .9, 1.1, 1.3, 1.5]

(2)

y1:=[seq(Data[i,2],i=1..nops(Data))];

[0.769540597e-1, .1093424148, .1392030568, .1662374563, .1903821623, .2117168860, .2303874000, .2465077820]

(3)

y2:=[seq(Data[i,3],i=1..nops(Data))];

[.1477783335, .1120401102, 0.853083077e-1, 0.652194693e-1, 0.500537619e-1, 0.385555127e-1, 0.298096396e-1, 0.231661161e-1]

(4)

y3:=[seq(Data[i,4],i=1..nops(Data))];

[.1393069312, .1509302274, .1558066181, .1562235596, .1537887672, .1496220815, .1444864012, .1388614678]

(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);

 

Download dataIO_Column.mw

@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

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

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));

 

"sys1:=[[[`Transfer Function`],[continuous],[`1 output(s); 1 input(s)`],[inputvariable=[u1(s)]],[outputvariable=[y1(s)]]]"

(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);

 

 

 

Download rc_impulse.mw

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);

exp(Psi(n+1))/exp(-gamma)

(1)

fsolve(x-100,n);

55.64520627

(2)

round(%);

56

(3)

evalf(product(exp(1/i), i = 1 .. 56));

100.6319054

(4)

 

Download prod.mw

@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));

-.154

(1)

[seq(Generate(float(range=-0.5..0.5,digits=3)),i=1..10)];

[-0.3e-2, -.451, -.373, .264, -.300, .390, -.147, -.204, -.415, .239]

(2)

 

Download rand.mw

Regards,

Georgios

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();

"C:\Users\kokoge00\Desktop"

(1)

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

x^2+y^2+z^2+x+y+z

(2)

ee:=convert(ee,string);

"x^2+y^2+z^2+x+y+z"

(3)

fd := fopen("temp_file.txt", WRITE):

fprintf(fd, "ee = %s", ee):

fclose(fd):

 

ssystem[launch]("temp_file.bat"):

 

Download clip.mw

Regards,

Georgios

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

Regards,

Georgios

See help file for convert(pwlist). 

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

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

Regards,

Georgios

Without the actual worksheet, it is difficult to determine.  You can try running the simplify command, like this, at the command prompt.

>simplify(%);

Since your last line is not assigned to anything, the % sign tells Maple to simplify the output from the previous command.  See if this will help.

Regards,

Georgios

Consider using the DirectSearch toolbox, available here.

Regards,

Georgios

restart: assume(0 < t, t < 20*Pi): Digits:=15:

eqns:={ 10*cos(6/10*t) - 10*cos(3/10*t+1/4*Pi) , 10*sin(6/10*t)-10*sin(3/10*t+1/4*Pi) };

solutions:=solve(eqns,allsolutions,explicit);

assign(solutions);

seq(eval(solutions, op(indets(solutions)) = i), i = 0 .. 3);
 

Regards,

Georgios

1 2 3 4 5 6 7 Last Page 3 of 75