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

Copy and paste each of these to open the help pages.  The last one shows how to create a functional operator.

?Student[Calculus1][FunctionChart]

and

?Student[Calculus1][Asymptotes]

and

?->

A simple example that shows how to plot with an expression and then plot a function:

plot(3*x^2-15,x=-5..5);

f := x -> 3*x^2-15;

plot(f,-5..5);

Once you define a function, f, as above, you can substitute in numbers like this:

f(2);

Search for the keywords that you are looking for in the help pages for more examples.

Regards,

Georgios Kokovidis

Dräger Medical

Maple does not directly support a 3d equivalent of the 'inequal' command, which is part of the 'plots' package.

The following link will take you to the Application Center.  It introduces the InequalityGraphics package, with examples.  You will have to download and install in order to use it. 

 

Regards,

Georgios Kokovidis


Try this link here and see if it addresses your question.

If not, then you can do it like this:

> restart:
> with(plots):
> p1:=implicitplot(x^2+y^2=1, x=-1..1, y=-1..1):
> fprintf("c:/temp/implotdata.txt","%f",Array([op([1,1..-2],p1)])):
> fclose("c:/temp/implotdata.txt");

On a Win platform, this will create a file called implotdata.txt in the C:\temp directory with two columns of data.

The problem has to do with comparison of numbers that are not type "numeric".  In a boolean context, if this does not return true, then you get the erorr message that you reported above.  You already know what the workaround is.

> type(Pi,numeric);
                                false

> type (3.14,numeric);

                                 true

> type(evalf(Pi),numeric);

                                 true

 

>?type

for more help on this.

 

Your question is not clear with respect to what you want to do.  An exampe would be helpful.  Below is an example that uses the "degree" function.  For details look at help.



restart:

a := x^3+5*x^2+11*x+15;

(1)

pp:=[op(a)];

(2)

nops(pp);

(3)

seq(degree(pp[i]),i=1..nops(pp));

(4)

degree(5*x^3+y^4);

(5)

 



Download polypower.mws

 

 

Look @ ArrayTools[SearchArray]

(i, j, v) := ArrayTools:-SearchArray(x);

 

@tirazheh , I got the same error if I replace the mat_mult.dll with another file (non dll) and rename it.  So, it seems like you have a corrupt .dll file.  Try it with the Watcom compiler that ships with Maple, to determine whether or not the problem is with Visual Studio 2010.

This usually implies that Maple cannot find the .dll that it needs.  For the example, I created a directory in my temp folder called share, just like the example.  Then, using Visual C++ 9.0 Express, I launched the command line compiler, and changed to the directory that the .c file was located in.  Below is what it looks like in the dos command prompt window.

 

Setting environment for using Microsoft Visual Studio 2008 x86 tools.

C:\Program Files\Microsoft Visual Studio 9.0\VC>cd c:\temp\share

C:\temp\share> cl -Gz mult.c -link -dll -export:mult -out:mult.dll
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

mult.c
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:mult.exe
-dll
-export:mult
-out:mult.dll
mult.obj
   Creating library mult.lib and object mult.exp

C:\temp\share>

 

In Maple, if I delete the .dll file from the share directory, I get the same error that you reported.


Error, external linking: error loading external library c:/temp/share/mult.dll: The specified module could not be found.

 

When the .dll is in the right spot, it works fine.

 

restart:

my_mult := define_external('mult', LIB = "c:/temp/share/mult.dll", 'a'::(integer[4]), 'b'::(integer[4]), RETURN::(integer[4])):

my_mult(10, 3);

(1)

 

 



Download mat_mult.mws

 

 

You can use "display", which is part of the plots package to combine more than one plot (it can be a mix of plot structures, like spacecurve and plot3d for example), or you can combine the curves you wish to plot in one statement.  See example below.  The first part is right out of the help page for the "spacecurve" command.

 



 

restart:with(plots):

spacecurve({[sin(t),0,cos(t),t=0..2*Pi],[cos(t)+1,sin(t),0,numpoints=10]},t=-Pi..Pi,axes=FRAME);

 

plot1:=spacecurve([sin(t),0,cos(t),t=0..2*Pi],t=-Pi..Pi):

plot2:=spacecurve([cos(t)+1,sin(t),0,numpoints=10],t=-Pi..Pi):

display(plot1,plot2,axes=FRAME);

 

spacecurve({[2*t+3,5*t-2,-t+1],[-2*t+7,t+8,2*t-1]},t=-4..4,axes=Normal,orientation=[45, 56,0],thickness=3);

 

eq1:=2*t+3=-2*s+7;

(1)

eq2:=5*t-2=s+8;

(2)

eq3:=-t+1=2*s-1;

(3)

solve({eq1,eq2},{t,s});

(4)

eval(eq1,{t=2,s=0});

(5)

eval(eq2,{t=2,s=0});

(6)

eval(eq3,{t=2,s=0});

(7)

ss:=spacecurve({[2*t+3,5*t-2,-t+1],[-2*t+7,t+8,2*t-1]},t=-4..4,axes=Normal,orientation=[45, 56,0],thickness=3):

pp:=pointplot3d([7,8,-1],symbol=solidcircle,symbolsize=30,color=red):

display(ss,pp);

 

 

 



Download IntersectingLinesSpa.mws

 

See if the command FromMatlab can convert your Matlab code for you.  There are a couple of examples in the help pages.

?Matlab[FromMatlab]

 

You can change the limit value to something greater than 1000000 under Options - Precision.

 

 

 

It did not occur to me to try the Standard interface, V14, because I rarely use it.  The other version I have @ home is v9.51, and with this version it works with both interfaces. 

 

 

The above code that you posted works for me, but it is hard to see what is going on with the default "point" style.  I changed the symbol to circle so that I could use the symbolsize option to make them bigger.  I also changed the axes to boxed to see what is going on.  From the animation, you are rotating the phi viewpoint of the plot, which gives the impression that the points are moving, even though they are static.  Is this what you are looking for with respect to the animation, or something else?



restart:

with(plots):
animate(pointplot3d,[[[1,2,3],[4,5,3],[2,2,2]],symbol=circle,color=blue,symbolsize=30,orientation=[45,A]],A=45..315,axes=boxed);

   



Download animpp3d.mws

 

 

 

 

For your particular example above, you could also do the following:

seq(convert(mylist[i],binary),i=1..nops(mylist));

 

 



restart:

M := Matrix(5, 5, proc (i, j) options operator, arrow; 7*j-i end proc);

(1)

with(LinearAlgebra):

ColumnOperation(M, 2, 10);

(2)

Using the deprecated linalg command mulcol:

with(linalg):

mulcol(M,2,10);

(3)

 

 

 



Download columnOperations.mws

 

 

 

 

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