Ronan

1311 Reputation

14 Badges

12 years, 346 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I am practicing with some diff equations. I am having problem solving for one of the constants. I am having a pproblem assigning a value to derivatives or 2nd derivatives. What is a good general technique is this type of situation?
 

restart

NULL

``

omega^2 = g/l

omega^2 = g/l

(1)

Eq1 := diff(Theta(t), t, t) = -omega^2*Theta(t)

diff(diff(Theta(t), t), t) = -omega^2*Theta(t)

(2)

ics := Theta(0) = 0, (diff(Theta(t), t))(0) = Vmax, (diff(Theta(t), t, t))(0) = 0

Theta(0) = 0, (diff(Theta(t), t))(0) = Vmax, (diff(diff(Theta(t), t), t))(0) = 0

(3)

SHM := dsolve({Eq1, ics})

(4)

SHM := dsolve({Eq1})

{Theta(t) = _C1*sin(omega*t)+_C2*cos(omega*t)}

(5)

SHM := dsolve({Eq1, Theta(0) = 0})

Theta(t) = _C1*sin(omega*t)

(6)

``

diffSHM := diff(SHM, t)

diff(Theta(t), t) = _C1*omega*cos(omega*t)

(7)

``

(Theta(t))(0) = 0, (diff(Theta(t), t))(0) = V

(Theta(t))(0) = 0, (diff(Theta(t), t))(0) = V

(8)

``

``

``

``

``

NULL

NULL


 

Download SHM.mw

In the test package below I want the the Value of Clr to be "B" when the package is loaded. How do I achieve that?
 

restart

mylibdir := cat(kernelopts(homedir), kernelopts(dirsep), "maple", kernelopts(dirsep), "toolbox", kernelopts(dirsep), "personal", kernelopts(dirsep), "lib")

"C:\Users\Ronan.Ronan-PC\maple\toolbox\personal\lib"

(1)

``

libname := mylibdir, libname

"C:\Users\Ronan.Ronan-PC\maple\toolbox\personal\lib", "C:\Program Files\Maple 2016\lib", "C:\Users\Ronan.Ronan-PC\maple\toolbox\personal\lib"

(2)

``

``

``

"RTest:=module()  option package;  export  Sums;    global Clr;  Clr:=B;  Sums:=proc(p1,p2,c:=Clr)  if c=B or c=b  then    p1+p2  elif c=G or c=g then  p1-p2  elif c=R or c=r  then      if p2 =0 then "Not Valid"       else ( p1)/(p2)        end if  else "Error"  end if  end proc;    end module; "

_m655171968

(3)

``

savelib('RTest')

restart

``

with(RTest)

[Sums]

(4)

"At This point I want the value of Clr to be automaticially   B"

Sums(2, 3)

"Error"

(5)

RTest:-Sums(2, 3, b)

5

(6)

``

RTest:-Sums(2, 3, r)

2/3

(7)

RTest:-Sums(2, 3, g)

-1

(8)

Clr := g

g

(9)

RTest:-Sums(2, 3)

-1

(10)

RTest:-Sums(2, 3, b)

5

(11)

RTest:-Sums(2, 3)

-1

(12)

RTest:-Sums(2, 0, r)

"Not Valid"

(13)

``


 

Download Module_Test_global_Var.mw

Trying to write a generat purpose procedure insteat of having 3 or 4 different named procceduers.

Need to determine the input types of say A,B,C

Proc(A,B,C)

1) A,B,C could be for the form 3/2 , 5x-7 , x^2-sqrt(x+3)  i.e numbers or formulas

2) A,B,C could be 2 elenent lists [2,3]  , [5x-6y,8x+2] ,[2,sqrt(3)]  i.e 2D points

3) A,B,C could be 3 element lists as above    i.e 3D points

4) A,B,C could be 2D vectors

5) A,B,C could be 3D vectors

A, B, C will not be of mixed types but would be good to check A, B, C for consistency and if not retrun an error

Looking to calculate output based on

If type 1) ......

elif type 2).....

.

.

elif type 5)...

end if

return.....

end proc

 

 

I am experimenting with creating help files for  my own package.

I have saved  a package overview file and one package command  file into a help data base as a test usingTools, Help Database, Save as Help Page.

These 2 help pages work in principle as i can find them when I search for them and the command  help page opens from the overview page. I now need to edit them. So I edit the original worksheets and use Tools, Help Database, Save as Help Page to update the data base.

Now Maple will not let me overwrite the original page.The Help file savy you can overwrite. So I have to delete the original page first then resave it back in. This involves reentering all the data again. Topic Alisies and Table of contents.

To say the least this is extremely tedious  vastly innefficient and very error prone. I will have upto say 40 help pages to edit and they will require some expirementing with.

Is there a better way to do this?

Edit:-

Hve added this line the the bottom of the worksheet

makehelp('`Rational Trigonometry`', "Rational Trigonometry Overview Help.mw", " C:\Users\Ronan.Ronan-PC\maple\toolbox\UserHelp\lib\maple.help")

get     Error, (in readline) file or directory does not exist

 

Hello:

I want to make a package or module. Not sure. I cant get my head around what to do. I have loads of formulas I would like to be able to use without going back through work sheets. At present just want to keep it simple.

Have loaded a sample work sheet to use

Intend to place package in Maple2016 library folder.

 

restart

Library Folder

C:\Program Files\Maple 2016\lib

``

``

with(LinearAlgebra):

``

``

Points

Point2 := proc (x1, y1) options operator, arrow; [x1, y1] end proc

proc (x1, y1) options operator, arrow; [x1, y1] end proc

(1)

Point3 := proc (x1, y1, z1) options operator, arrow; [x1, y1, z1] end proc

proc (x1, y1, z1) options operator, arrow; [x1, y1, z1] end proc

(2)

a1 := Point3(x1, y1, z1)

[x1, y1, z1]

(3)

a2 := Point3(x2, y2, z2)

[x2, y2, z2]

(4)

a3 := Point3(x3, y3, z3)

[x3, y3, z3]

(5)

Line through 2 points

LinePts := proc (p1, p2) options operator, arrow; (p2[2]-p1[2])*x+(p1[1]-p2[1])*y-p2[2]*p1[1]+p1[2]*p2[1] end proc

proc (p1, p2) options operator, arrow; (p2[2]-p1[2])*x+(p1[1]-p2[1])*y-p2[2]*p1[1]+p1[2]*p2[1] end proc

(6)

``

Line

Line := proc (a, b, c) options operator, arrow; a*x+b*y+c end proc

proc (a, b, c) options operator, arrow; a*x+b*y+c end proc

(7)

Lines s

LnPrll := proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, y)-coeff(l2, x)*coeff(l1, y) = 0) end proc

proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, y)-coeff(l2, x)*coeff(l1, y) = 0) end proc

(8)

Lines t

LnPrpnd := proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, x)+coeff(l1, y)*coeff(l2, y) = 0) end proc

proc (l1, l2) options operator, arrow; is(coeff(l1, x)*coeff(l2, x)+coeff(l1, y)*coeff(l2, y) = 0) end proc

(9)

``

``

Quadrance between 2 points (2D)

Quadrance := proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2 end proc

proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2 end proc

(10)

``

Quadrance between 2 points (3D)

Qd3 := proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2+(a1[3]-a2[3])^2 end proc

proc (a1, a2) options operator, arrow; (a1[1]-a2[1])^2+(a1[2]-a2[2])^2+(a1[3]-a2[3])^2 end proc

(11)

Triple Quad Formula (3 colinear points)

TQF := proc (Q1, Q2, Q3) options operator, arrow; (Q1+Q2+Q3)^2 = 2*Q1^2+2*Q2^2+2*Q3^2 end proc

proc (Q1, Q2, Q3) options operator, arrow; (Q1+Q2+Q3)^2 = 2*Q1^2+2*Q2^2+2*Q3^2 end proc

(12)

Spread*PolynomialsNULL

SpreadPoly := proc (n, s, rn) with(orthopoly); s-factor(1/2-(1/2)*T(n, 1-2*rn)) end proc

proc (n, s, rn) with(orthopoly); s-factor(1/2-(1/2)*T(n, 1-2*rn)) end proc

(13)

SpreadPoly(3, s, r)

s-r*(4*r-3)^2

(14)

``

 

Download Testpackage.mw

First 27 28 29 30 31 32 33 Page 29 of 35