Ronan

125 Reputation

6 Badges

5 years, 192 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I have just installed jEdit. Have written 2 files.Started with "open in mode  maple". So text gets nicely coloured. Can save the files ok as .mpl. I have several questions
1) How do I make the code indent/format?

2)How should I test the code? Can jEdit show me errors? I am running jEdit and maple side by side. Save, Read, hit bug...

3)How do I format an imported .mpl from maple?

4)How do I get $include to work?

Testr1:=proc(a,b)
description "Jedit test";
local A,B;
A:=a;B:=b;
if is(A<B) then print ('smaller')
elif is(A>B) then print('bigger')
else print('cant_say')
end if;
return cos(A+B), sin(A-B),A,B;
end proc;
TestjEdit:=module()
option pagkage;
export Testr1;
$include "Testr1.mpl"
end module;
#imported file
Antisym := proc (V::{Matrix(3,3,shape = antisymmetric,algebraic), Vector(3)})
local M; description "converts vector to antisymmetric matrix and back"; if 
type(V,Vector) then M := Matrix(3,3,shape = antisymmetric); M[1,2] := -V[3]; M
[1,3] := V[2]; M[2,3] := -V[1] else M := Vector(3,[-V[2,3], V[1,3], -V[1,2]])
end if; M end proc;

restart

currentdir()

"C:\Users\Ronan\Documents\MAPLE\Rational_Trigonometry"

(1)

read "C:\\Users\\Ronan\\Documents\\jEdit\\Testr1.mpl"

proc (a, b) local A, B; description "Jedit test"; A := a; B := b; if is(A < B) then print('smaller') elif is(B < A) then print('bigger') else print('cant_say') end if; return cos(A+B), sin(A-B), A, B end proc

(2)

"print("'Testr1'")"

(3)

Testr1(2, 4)

cos(6), -sin(2), 2, 4

(4)

Testr1(x, 5)

cos(x+5), sin(-5+x), x, 5

(5)

Testr1(x, x+1)

cos(2*x+1), -sin(1), x, x+1

(6)

restart

read "C:\\Users\\Ronan\\Documents\\jEdit\\TestjEdit.mpl"

$include "Testr1.mpl";
^

Error, while reading ``C:\Users\Ronan\Documents\jEdit\TestjEdit.mpl``

 

TestjEdit:-Testr1(2, 1)

Error, `TestjEdit` does not evaluate to a module

 

``


 

Download Jedit_testing.mw
 

restart

currentdir()

"C:\Users\Ronan\Documents\MAPLE\Rational_Trigonometry"

(1)

read "C:\\Users\\Ronan\\Documents\\jEdit\\Testr1.mpl"

proc (a, b) local A, B; description "Jedit test"; A := a; B := b; if is(A < B) then print('smaller') elif is(B < A) then print('bigger') else print('cant_say') end if; return cos(A+B), sin(A-B), A, B end proc

(2)

"print("'Testr1'")"

(3)

Testr1(2, 4)

cos(6), -sin(2), 2, 4

(4)

Testr1(x, 5)

cos(x+5), sin(-5+x), x, 5

(5)

Testr1(x, x+1)

cos(2*x+1), -sin(1), x, x+1

(6)

restart

read "C:\\Users\\Ronan\\Documents\\jEdit\\TestjEdit.mpl"

$include "Testr1.mpl";
^

Error, while reading ``C:\Users\Ronan\Documents\jEdit\TestjEdit.mpl``

 

TestjEdit:-Testr1(2, 1)

Error, `TestjEdit` does not evaluate to a module

 

``


 

Download Jedit_testing.mw

 


Hi. I would like to learn to use your package. The example  document for it not running (for me). Included a screen shot and my test document. Basicially It would like to import .mpl procedures and use them as the exports of a module/package. I have no experience with code editors and this is the first time I have tried to use the code edit region. Also whathat does the (**) mean/do?

Edit: I redid the documet.


 

restart

``

with(CodeBuilder)

[Build, Directory, Export, File, Import, Mint, Read, Regions, Version]

(1)

"Directory("interface('worksheetdir')")"

"C:\Users\Ronan\AppData\Local\Temp\Rtestm"

(2)

Regions()

["Rtestm.mpl", "NewTest.mpl", "NewTest_ModuleApply.mpl"]

(3)

libname

"C:\Program Files\Maple 2017\lib", "C:\Users\Ronan\maple\toolbox\CodeBuilder\lib", "C:\Users\Ronan\maple\toolbox\personal\lib"

(4)
Rtestm := module ()

_m2199891725024

["C:\Users\Ronan\AppData\Local\Temp\Rtestm\Rtestm.mpl", "C:\Users\Ronan\AppData\Local\Temp\Rtestm\NewTest.mpl", "C:\Users\Ronan\AppData\Local\Temp\Rtestm\NewTest_ModuleApply.mpl"]

``

NewTest:=module()

"This is a NEW TEST"

_m2199890918688

``

``

ModuleApply:=proc()

proc () print("This is a NEW TEST") end proc

``

"" CodeBuilder:-Build"('mint','maplet', 'infolevel'=2,  'prefix' = "#!",  'main' = "Rtestm.mpl");"

mint, maplet, infolevel = 2, prefix = "#!", main = "Rtestm.mpl"

(5)

Rtestm:-Rtest()

"this is a test"

(6)

""Rtestm:-NewTest"()"

``

``

currentdir()

"C:\Users\Ronan\Documents\MAPLE\Rational_Trinonometry"

(7)

restart

Read*"C:\\Users\\Ronan\\AppData\\Local\\Temp\\Rtestm\\Rtestm.mpl"

Read*"C:\Users\Ronan\AppData\Local\Temp\Rtestm\Rtestm.mpl"

(8)

Rtestm:-Rtest()

Error, Rtest is not a command in the Rtestm package

 

Rtestm:-NewTest()

Error, NewTest is not a command in the Rtestm package

 

``


 

Download 1-CodeBuilder_Pkg_test.mw

@Joe Riel 

I have a module with quite a few procedures and it is getting too long and complex. Basicially I write each procedure in a seperate document, them copy and paste it into the module. I want to improve matters as save each proc and read it in to the module

e.g.  Qdim:=proc(A,B).........end proc

        save Qdim , "Qdim.?"   have tried .txt ,.mla , .m  They save fine.

in the module have tried

read "Qdim.txt" etc.   I have included Qdim in export but Qdim doesnt work Qdim(A,B) returns Qdim(A,B)

read "C:\Users\Ronan\Documents\MAPLE\Rational Trinonometry\Qdim.m";

which procuces an error

Error, (in unknown) could not open `C:UsersRonanDocumentsMAPLERational TrinonometryQdim.m` for reading

 

I am plotting a pair of lists of points using

pointplot(Listap, Listbp, symbol = point, symbolsize = 1, size = [1200, 1200])

 

How could is do this with plot so I can add colours? Along the lines Listap(i)^2+Listbp(i)^2 =R, R is in the range 0..1,then colour =R*256 or any other imaginative way of adding colour.
 

restart

with(plots):

with(plottools):

``

``

NULL

``

z := (m+I*n)/(p+I*q)

(m+I*n)/(p+I*q)

(1)

g := proc (z) options operator, arrow; (z-I)/(z+I) end proc;

proc (z) options operator, arrow; (z-I)/(z+I) end proc

(2)

bz := simplify(evalc(Im(z)));

(-m*q+n*p)/(p^2+q^2)

(3)

a := simplify(evalc(Re(g(z))));

(m^2+n^2-p^2-q^2)/(m^2-2*m*q+n^2+2*n*p+p^2+q^2)

(4)

b := simplify(evalc(Im(g(z))));

(-2*m*p-2*n*q)/(m^2-2*m*q+n^2+2*n*p+p^2+q^2)

(5)

``
"  r:=15;   Lista:=Vector();  Listb:=Vector();  j:=1;  for m from -r to r do   for n from -r to r do   for p  from -r to r do   for q from -r to r do  if p<>0 and q<>0 and m^2-2 m q+n^2+2 n p+p^2+q^2<>0 and bz>=0 then  Lista(j):=a; Listb(j):=b;  j:=j+1;  end if;  end do:  end do;  end do;  end do:  j; :"

435713

(6)

``

``

``

``

``

pointplot(Lista, Listb, symbol = plottools:-point, symbolsize = 1, size = [1200, 1200])

 

NULL

``

``


 

Download 096-Chayley_transform_for_MP_question.mw

Try this command.

display(semitorus([0, 0, 0], 0 .. Pi, 1, 2), lightmodel = light4, orientation = [-140, 60], scaling = constrained, style = patchnogrid)

I get this mess. The picture on the help page doesn't look any better.Setting the range 0..2 Pi looks fine though. So I think it is a bug.

What I was trying to do is plot 3/4 of a torus i.e circle disk swept in 3/4 of a carcle with capped ends. What is a good way?

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