gkokovidis

2370 Reputation

13 Badges

20 years, 291 days
Draeger Medical Systems, Inc.

 

 

Regards,
Georgios Kokovidis
Dräger Medical

MaplePrimes Activity


These are answers submitted by gkokovidis

The worksheet below has two examples using your data.  There are other ways to do this, by reading in your data from an external file.  For help on the commands used, look at plot, display, Scatterplot commands from the Help menu.



restart:with(plots):

v1:=<1.1,1.5,2,2.5,2.71>;

(1)

v2:=<0.751,0.764,0.777,0.796,0.81>;

(2)

v3:=<0,0.419,0.665,0.791,0.81>;

(3)

plot(<v1|v2>,thickness=3);

 

plot(<v1|v3>,thickness=3,color=blue);

 

with(plots):

p1:=plot(<v1|v2>,thickness=3):

p2:=plot(<v1|v3>,thickness=3,color=blue):

display(p1,p2);

 

with(Statistics):

P:=ScatterPlot(v1, v2, lowess, degree = 1, thickness = 2, title="Scatter Plot",color=red):

Q:=ScatterPlot(v1, v3, lowess, degree = 1, thickness = 2, title="Scatter Plot",color=blue):

display(P,Q);

 



Download dataplotvec.mws

 

 


The command modp in Maple can be used the same way that mod can in Matlab.  The mod command will give you the same answer, but the usage is different.

For example, in Matlab

mod(13,5)
ans =
3

mod([1:5],3)
ans =
1 2 0 1 2

In Maple

> modp(13,5);
                                  3

> modp([1,2,3,4,5],3);
                           [1, 2, 0, 1, 2]

> [1,2,3,4,5] mod 3;
                           [1, 2, 0, 1, 2]

 

The DynamicSystems package was built in.  I do not remember which version started to use it, but you can check to see if ver 11 has it by typing the following:

with(DynamicSystems);

If it was part of ver 11, then you will see all of the functions that are supported.  If it is not a part of ver 11, then you will get an error message, similar to the one below:

Error, invalid input: with expects its 1st argument, pname, to be of type {package, module}, but received DynamicSystems

 

Hope this helps.

pds:-value(t=0.5)(0);
pds:-value(t=0.5)(1);

The above will give you values for t=0.5 with z=0 and then with z=1 and so on. 

 


Look at the help pages for the assign command:

?assign

For example: 

>ans:=solve( {x+y=1, 2*x+y=3}, {x, y} );

                    {x = 2, y = -1}

>assign(ans);

>x,y;

                     2, -1                   

 

 

 

restart:

f:=x/sqrt(1-cos(x));

limit(f,x=0,complex);

                             2^(1/2)

 

From the help files:

If dir is complex, the limit point infinity denotes complex infinity, that is, all infinities in the complex plane. If dir is real, the limit point infinity denotes both positive and negative infinity, and the limit is done bidirectionally. Otherwise, the limit point infinity denotes positive infinity, and -infinity denotes negative infinity.

 

restart: with(plots):

deq := (diff(y(x), x, x))*y(x)-1+x*y(x)^2 = cos(x);

sol := dsolve({deq, y(0) = 1, (D(y))(0) = 1}, numeric,range=-2..2);

p1:=odeplot(sol):

p2:=plot(x->op(2,op(2,sol(x))),-1..1,color=blue,style=point,symbol=circle):

display(p1,p2);

 

The plot looks like cos(x) over a small range.

This should clear it up a little.

plots:-display(DEplot(ode1, q(t), t = 0 .. 8760, q(t) = 0 .. 10000, [q(0) = 0], title = "contaminant accumulation and dissipation",linecolor=red,color=red), DEplot(ode2, q(t), t = 8760 .. 17520, q(t) = 0 .. 10000, [q(8760) = 9278],linecolor=blue,color=blue));

 

Regards,
Georgios Kokovidis
Dräger Medical

The method below works using odeplot.  

restart: with(plots):


p1:= dsolve({diff(q(t), t) = 3-3*q(t)/10^4, q(0)=0}, type=numeric, range=0..16000):

plot1:=odeplot(p1):


p2:=dsolve({diff(q(t), t) = -3*q(t)/10^4, q(0)=17520}, type=numeric, range=0..17520):


plot2:=odeplot(p2,color=blue):


display(plot1,plot2,title = "contaminant accumulation in the first year(red) and second year(blue)");
 

 

Regards,
Georgios Kokovidis
Dräger Medical

 

restart:

t:=[1,-1,0,1/2,3,3/2,sqrt(8)];

sort(t);

x:=evalf(t);

sort(x);

identify(%);

For your example as you posted it, you can do this after your t.

identify( sort(evalf(t)) );

 

Regards,
Georgios Kokovidis
Dräger Medical

Can you provide more details as to what you are trying to do, with an example, if possible?

restart:

x:=[Pi,sqrt(2), sqrt(3), sqrt(5), sqrt(10), sqrt(7)];

[x=Pi, 2^(1/2), 3^(1/2), 5^(1/2), 10^(1/2), 7^(1/2)]

identify(sort(evalf(x)));

[2^(1/2), 3^(1/2), 5^(1/2), 7^(1/2), Pi, 10^(1/2)]

 

 

Regards,
Georgios Kokovidis
Dräger Medical

 

This book looks like it covers the topics of intererest.  An advantage is the available code for you to try.

 

Regards,
Georgios Kokovidis
Dräger Medical

NonlinearFit from the Statistics package does not return a very good match to your data, using the model function y=ax^n+bx+c that you supplied.  Your might try another model function.  Otherwise, look into LSSolve, which is part of the Optimization package.

Download 221_Fit_from_data.mws

 

Regards,
Georgios Kokovidis
Dräger Medical

restart:

with(Student[Calculus1]):

Roots(cos(2*theta)=1/2,theta=0..2*Pi,numeric):

identify(%);

 

Regards,
Georgios Kokovidis
Dräger Medical

The help page for the Fit command has an example using X,Y data.

?Fit to bring it up.

 

Regards,
Georgios Kokovidis
Dräger Medical

First 23 24 25 26 27 28 29 Last Page 25 of 75