Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Dear All,

please help me with my problem. i have quite a big program all parts of which are distributed in the several code edit regions and in the main text. i'd like to find all occurenses of gven text in all open documents including code edit regions. i know how to do it manually by openening each code edit regiong and pressing Ctrl-F. however it is very time consuming and defocuses me apart from my main tasks. i'd prefer to use some combinations of 'hot keys' on the keybord or one or two mouse clicks as for example in MS Visual Studio.  

I am creating a plot in Maple17 which will include many line segments and polygons.  I want the axes to be equally scaled, so that line segments that are perpendicular actually look perpendicular.  When I view what I have created so far, line segments that are perpendicular do not appear to be so in a plot, even though I used the "scaling=constrained" option several times.  I created a stripped-down file that isolates the problem.  Here it is:

restart:

with(plots):

segp := proc(pt1, pt2)
  description "plot of line segment between two points";
  local m;
 m:=Matrix([pt1,pt2]):
  polygonplot(m,thickness=1,scaling=constrained);
end proc:

slope := proc(pt1, pt2)
  description "slope of line segment btwn two different points";
  (pt2[2]-pt1[2])/(pt2[1]-pt1[1])
end proc:

 

 

pa9:=[0.1864032968, 0.9824733131];

[.1864032968, .9824733131]

(1)

pa16:=[0.6816387600, 0.7316888689];

[.6816387600, .7316888689]

(2)

pd9:=[0.05940746930, 0.7316888689];

[0.5940746930e-1, .7316888689]

(3)

slope(pa9,pa16)*slope(pa9,pd9);

-1.000000000

(4)

display({segp(pa9,pa16),segp(pa9,pd9)},scaling=constrained);

 

 

 

 


Download perp.mw

 



An angle that should be a right angle looks obtuse in the plot.  I used "scaling=constrained" in both the "display" command and the "segp" procedure.  I am using "polygonplot" to plot line segments (degenerate polygons) because the final plot will contain genuine polygons and this seemed like the easiest way to do it.  If this is a bad idea for some reason I can change it.

 

GS

restart;
with(plots):
with(Optimization):
with(LinearAlgebra):
with(Statistics):
with(DEtools):
x11 := <0.208408965651696e-3, -0.157194487523421e-2, -0.294739401402979e-2, 0.788206708183853e-2, 0.499394753201753e-2, 0.191468321959759e-3, 0.504980449104750e-2, 0.222150494088535e-2, 0.132091821964287e-2, 0.161118434883258e-2, -0.281236534046873e-2, -0.398055875132037e-2, -0.111753680372819e-1, 0.588868146012489e-2, -0.354191562612469e-2, 0.984082837373291e-3, -0.116041186868374e-1, 0.603027845850267e-3, -0.448778128168742e-2, -0.127561485214862e-1, -0.412027655195339e-2, 0.379387381798949e-2, -0.602550446997765e-2, -0.605986284736216e-2, -0.751396992404410e-2, 0.633613424008655e-2, -0.677581832613623e-2>;
y11 := <-21321.9719565717, 231.709204951251, 1527.92905167191, -32.8508507060675, 54.9408176234139, -99.4222178124229, -675.771433486265, 42.0838668074923, -12559.3183308951, 5.21412214166344*10^5, 1110.50031772203, 3.67149699000155, -108.543878970269, -8.48861069398811, -521.810552387313, 26.4792411876883, -8.32240296737599, -1085.40982521906, -44.1390030597906, -203.891397612798, -56.3746416571417, -218.205643256096, -178.991498697065, -42.2468018350386, .328546922634921, -1883.18308996621, 111.747881085748>;
z11 := <1549.88755331800, -329.861725802688, 8.54200301129155, -283.381775745327, -54.5469129127573, 1875.94875597129, -16.2230517860850, 6084.82381954832, 1146.15489803104, -456.460512914647, 104.533252701641, 16.3998365630734, 11.5710907832054, -175.370276462696, 33.8045539958636, 2029.50029336951, 1387.92643570857, 9.54717543291120, -1999.09590358328, 29.7628085078953, 2.58210333216737*10^6, 57.7969622731082, -6.42551196941394, -8549.23677077892, -49.0081775323244, -72.5156360537114, 183.539911458475>;
ICS:=[x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1]];
N := Dimension(x11)-1:
sys1 := [Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t), Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t), Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t)];
SS := proc(k1,k2,k3,k5,k6,k7,k9,k10,k11)
local F, V;
if not type([k1,k2,k3,k5,k6,k7,k9,k10,k11],[numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric,numeric]) then return 'SS'(k1,k2,k3,k5,k6,k7,k9,k10,k11);
elif k1<0 or k2<0 or k3<0 or k5<0 or k6<0 or k7<0 or k9<0 or k10<0 or k11<0 then return 1e100;
end if;
F := dsolve(eval({Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t), Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t), Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t),x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1]},{:-k1=k1,:-k2=k2,:-k3=k3,:-k5=k5,:-k6=k6,:-k7=k7,:-k9=k9,:-k10=k10,:-k11=k11}), [x1(t),y1(t),z1(t)], numeric, output=Array([seq(k,k=0..N)]));
V := convert(Column(F[2,1],2),Vector);
Norm(V-x11,2);
Norm(V-y11,2);
Norm(V-z11,2);
end proc:
params := NLPSolve(SS(k1,k2,k3,k5,k6,k7,k9,k10,k11), method=nonlinearsimplex, initialpoint=[k1=.1, k2=.1, k3=.1, k5=.1, k6=.1, k7=.1, k9=.1, k10=.1, k11=.1],evaluationlimit=200):

Warning, limiting number of function evaluations reached

reference from 

http://www.maplesoft.com/applications/view.aspx?SID=1667

when debug

k1=.1; k2=.1; k3=.1; k5=.1; k6=.1; k7=.1; k9=.1; k10=.1; k11=.1;
F := dsolve({Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t), Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t), Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t),x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1]}, [x1(t),y1(t),z1(t)], numeric, output=Array([seq(k,k=0..N)]));

 

Warning, The use of global variables in numerical ODE problems is deprecated, and will be removed in a future release. Use the 'parameters' argument instead (see ?dsolve,numeric,parameters)
Error, (in dsolve/numeric) Array/array solutions cannot be obtained for ODE containing unassigned global variables {k1, k10, k11, k2, k3, k5, k6, k7, k9}

x11 := Vector([0.208408965651696e-3, -0.157194487523421e-2, -0.294739401402979e-2, 0.788206708183853e-2, 0.499394753201753e-2, 0.191468321959759e-3, 0.504980449104750e-2, 0.222150494088535e-2, 0.132091821964287e-2, 0.161118434883258e-2, -0.281236534046873e-2, -0.398055875132037e-2, -0.111753680372819e-1, 0.588868146012489e-2, -0.354191562612469e-2, 0.984082837373291e-3, -0.116041186868374e-1, 0.603027845850267e-3, -0.448778128168742e-2, -0.127561485214862e-1, -0.412027655195339e-2, 0.379387381798949e-2, -0.602550446997765e-2, -0.605986284736216e-2, -0.751396992404410e-2, 0.633613424008655e-2, -0.677581832613623e-2]):
y11 := Vector([ -21321.9719565717, 231.709204951251, 1527.92905167191, -32.8508507060675, 54.9408176234139, -99.4222178124229, -675.771433486265, 42.0838668074923, -12559.3183308951, 5.21412214166344*10^5, 1110.50031772203, 3.67149699000155, -108.543878970269, -8.48861069398811, -521.810552387313, 26.4792411876883, -8.32240296737599, -1085.40982521906, -44.1390030597906, -203.891397612798, -56.3746416571417, -218.205643256096, -178.991498697065, -42.2468018350386, .328546922634921, -1883.18308996621, 111.747881085748]):
z11 := Vector([ 1549.88755331800, -329.861725802688, 8.54200301129155, -283.381775745327, -54.5469129127573, 1875.94875597129, -16.2230517860850, 6084.82381954832, 1146.15489803104, -456.460512914647, 104.533252701641, 16.3998365630734, 11.5710907832054, -175.370276462696, 33.8045539958636, 2029.50029336951, 1387.92643570857, 9.54717543291120, -1999.09590358328, 29.7628085078953, 2.58210333216737*10^6, 57.7969622731082, -6.42551196941394, -8549.23677077892, -49.0081775323244, -72.5156360537114, 183.539911458475]):

 

a1 := Diff(x1(t),t) = k1*x1(t)+ k2*y1(t)+ k3*z1(t) + k4*u(t);
b1 := Diff(y1(t),t) = k5*x1(t)+ k6*y1(t)+ k7*z1(t) + k8*u(t);
c1 := Diff(z1(t),t) = k9*x1(t)+ k10*y1(t)+ k11*z1(t) + k12*u(t);
d1 := Diff(u(t), t) = 0;
ICS:=x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1];
solL:=dsolve({a1,b1,c1,d1,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);
ans:=proc(p1,p2,p3) solL(parameters=[a1=p1,b1=p2,c1=p3]); end proc:
FitParams:=Statistics:-NonlinearFit(ans, x11, y11, z11, x1, y1, z1);

 

Error, (in Statistics:-NonlinearFit) unexpected parameters: Vector(27, {(1) = 1549.88755331800, (2) = -329.861725802688, (3) = 8.54200301129155, (4) = -283.381775745327, (5) = -54.5469129127573, (6) = 1875.94875597129, (7) = -16.2230517860850, (8) = 6084.82381954832, (9) = 1146.15489803104, (10) = -456.460512914647, (11) = 104.533252701641, (12) = 16.3998365630734, (13) = 11.5710907832054, (14) = -175.370276462696, (15) = 33.8045539958636, (16) = 2029.50029336951, (17) = 1387.92643570857, (18) = 9.54717543291120, (19) = -1999.09590358328, (20) = 29.7628085078953, (21) = 2582103.332, (22) = 57.7969622731082, (23) = -6.42551196941394, (24) = -...

So I am working on doing some trajectory simulations in Maple using standard Newton's Laws, some force expressions, and initial conditions.

Anyway, the numerical solution works fine if I let the initial conditions I specified (for z=-1) be actually for z=-0.9. To illustrate, when I give an initial condition like this:

x(-1) = x_0, D(x)(-1) = xd_0, Vz(-1) = v_0

the results don't make any sense. However, when using the same x_0, xd_0, and v_0 and I give initial conditions like this:

x(-.9) = x_0, D(x)(-.9) = xd_0, Vz(-0.9) = v_0,

the solutions at least make a bit of sense.

What's weird is that, when I let z -> 0.93 or so, the solution changes discontinuously. And this shouldn't happen. The initial conditions were calculated for and should work for z = -1. I don't understand why they aren't.

Here is my Maple document. ics1 are the problem.

dsolve_field_traject.mw

Do you guys have any idea what could be going on?

Hello, everyone!


Last week I’ve encountered problems with integration of Maple 17 in Microsoft Office Excel 2013. The Maplesoft note on the point (http://www.maplesoft.com/support/faqs/detail.aspx?sid=32651) offers some ways of fixing it up, though I’ve run all of them the problem is the same:

While the connection is established, after entering the formula “=Maple(“x+x”)”, the Excel returns “Critical Error in Formula”

Before contacting the Maplesoft Technical Support, I want to ask here whether someone had the same case and managed to solve it.

Many thanks in advance.

the question is as follow:

1)receive two integers p and q

2)declare two local p1 and q1 and give them intial values and q

3)check if p o q are equal or less to zero print works only with positive integers

4)while p1 not equal to q1 then p1-a1 otherwise q1-p1

5)whenever p1=q1 we have the GCD

note:must use procedure and call it for different values of p and q after the procedure is written

-by following the instruction above this is what i got

GCD:=proc(p,q)

local p1,q1;

p1:=p;

q1:=q;

if p<=0 OR Q<=0 then 'works only with positive integers'
else while p1<>q1 do if q1<p1 then p1-q1 else q1-p1

end if;

end do;

end if;

end proc;

but when I call two integers eg:p=2, q=6 -> GCD(2,6) maple just freeze...evaluating....forever. is it because i got the procedure wrong etc? it would be helpful if anyone can help me with this. thanks

 

 

Does N variables caylay table have N permutation group so that can generate N functions?

for exmaple 3 variables cayley table have 3 permutation group, for 1, it has a permutation group , for 2 has a permutation group etc.

then does it mean that it has 3 functions, do it need to composite 3 functions in order to get a function belong to this cayley table?

1 1 1

1 2 2

1 2 3

Hi, I am trying to plot these two curves:

I tried:


with(plots);  A := Array(1..2)  A[1] :=plot (0.199563349672261+0.0178636902277546 x^1.14406289706794-0.0182070811144750 x^(1.13867380551454),x=50..2050,  color=red);  A[2]  := plot(0.298910542599302+0.0117459591500434 x^1.00390277106937-0.0137065176395662 x^0.970667551759677, x = 50..2050, color = blue);  display (A);

and I got:

Error, (in plot) unexpected option: .298910542599302+0.117459591500434e-1*x^1.00390277106937-0.137065176395662e-1*x^.970667551759677

so I tried

so I am not sure how I would graph these two functions...

Ive been given a task to write a fuction that will print true/false to if a given line will intersect a triangle given the co-ordinates of the vertices. 
I have a general idea on what needs to be done mathmaticly, but i have poor maple skills and the syntax is killing me.
I would appreciate some help in this regard.

 

Thanks.

How to show the code in file with extension .lib and edit it?

Hello

Am trying to convert a vector projection to matrix type output.

Attached is a sample worksheet.

 

Transformation_matri.mw 

 

I was asked to transform (x+y)^2+(1)/x+y into ((x+y)^3+1)/x+y, I have tried nomer/denom, but i don't how to factorise the nomer bit into (x+y)^3+1 because maple factorise it differently by default. therefore, it would be grateful if anyone can help me with this...please?

I am trying to run the application "The Cosmic Travel Planner" by Christian Bar (CBaer), uploaded on August 21, 2013 on Maple cloud (Mobius@admin). I use the left panel of GUI where "MapleCloud" is opened. While opening the application GUI asks my permission for running some code automatically. After my 'YES' Maple gives me an error:

Startup Code Error
0, "permission denied: no read access (%1)", "C:\Users\Andriy\MapleLib"

I tried to give the permission to folder "C:\Users\Andriy\MapleLib" however unsuccessfuly.

OS: Win 8

Could you help me with this Error? Thank you.

I've just upgraded from Maple 15 to Maple 17, and discover that I cannot any longer write curly right braces in math mode. I use an international (Norwegian) keyboard, where curly right braces should be available by Ctrl+Alt+=, but nothing happens when I try to write this. I can work my way around it by using Copy and Paste, but this is inelegant, particularly when I want to demonstrate Maple for my class of 400 students.

Looking at older posts, I found this question, which concerns inline evaluation with international keyboard in Maple 16. Inline evaluation works fine for me, using Ctrl+Shift+=. So was this fixed at the expense of Ctrl+Alt+= ?

First 207 208 209 210 211 212 213 Last Page 209 of 2097