Unanswered Questions

This page lists MaplePrimes questions that have not yet received an answer

Hi there..

I have a question on how to do a pointplot.

 

before plotting, I need to know the value of lambda[j] and  all the values of lambda already have.

so now I need to plot a graph with the values of lambda with different range and different colour,

 

Let say I have


> for j from 17 to 32 do k[j] := j+1;

x[j] := add(P[j, 1], j = j-1 .. j+2);

X[j] := add(P[j, 1]^2, j = j-1 .. j+2);

y[j] := add(P[j, 2], j = j-1 .. j+2);

Y[j] := add(P[j, 2]^2, j = j-1 .. j+2);

xy[j] := add(P[j, 1]*P[j, 2], j = j-1 .. j+2);

cx[j] := evalf(x[j]/k[j]);

cy[j] := evalf(y[j]/k[j]);

c11[j] := evalf(X[j]/k[j]-cx[j]^2);

c22[j] := evalf(Y[j]/k[j]-cy[j]^2);

c12[j] := evalf(xy[j]/k[j]-cx[j]*cy[j]);

C[j] := evalf(Matrix(2, 2, [[c11[j], c12[j]], [c12[j], c22[j]]]));

E[j] := simplify(fnormal(LinearAlgebra[Eigenvalues](C[j])));

if E[j][1] > E[j][2] then lambda[j] := E[j][2]/(E[j][1]+E[j][2]) else lambda[j] := E[j][1]/(E[j][1]+E[j][2])  end if;

lambda[j];

 end do;

the range of lambda [j] are as follows:

 0.02< lambda [j]<0.06

 0.06< lambda [j]<0.12

 0.12< lambda [j]<0.18

 

for i from 17 to 32, do if   0.02< lambda [j]<0.06 then green[i]:=P[i,j]; j:=i+1 elif

 0.06< lambda [j]<0.12 then red[i]:=P[i,j];j:=i+1 ; elif 0.12< lambda [j]<0.18 then blue[i]:=P[i,j];j:=i+1 end if;end do

how to do a point plot with the above situation so that in my plotting all the information are on the same graph.

 

All help is greatly appreciated.

Thanks

 

 

 

Im trying to plot the different values of shanks as points in this ] loop.

pp:=0.0:sumn:=0:sumnm1:=0:sumnp1:=0:

for i from 1 to 60 do

if(n>2) then sumnm1:=sumn fi;

if (n>1) then sumn:=sumnp1 fi; p:=1/evalf(2*beta*BesselJ(2,zeros[i])+epsilon*zeros[i]*BesselJ(0,zeros[i])+zeros[i]*BesselJ(1,zeros[i])); pp:=pp+p;

sumnp1:=pp;

if (n>2) then shanks:=(sumnp1*sumnm1-sumn*sumn)/(sumnp1-2*sumn+sumnm1) fi;

shanks;

od;

sumnp1: -2*sumn+sumnm1:

I have tried plotting it but it only plots the last value. 

Many thanks James

I have 2nd order nonlinear ode I try to solve with Runge Kutta 4th order method in maple but all I get from the out is 1 and 0.This is the equation: theta_ode.mw . How do I do it Or how do I write the code to solve it with maple using  Runge Kutta 4th order method?

Hello

 

I am not that good at english, but i will try to tell you what my problem is. 

 

I have a worksheet in maple where i can't find out to make the results appear. 

 

Maybe it is easiere for you guys to help me if i can send you the document. 

 

Looking forward to hear form you


Regards

Niclas 

Hi,

I have a Matrix whose entries are polynomials in several formal parameters (the matrix is sparse and the polynomials are rather simple, though inverses of the parameters may also arise).
Then, when I compute the kernel with LinearAlgebra-NullSpace, maple naturally gives a basis of solutions over the same ring of polynomials.

Now for some reason there are some parameters that I don't want to see in the solutions (all but two of them, actually).

How can I compute the part of the kernel that lives in $\mathbb{Z}[a,a^{-1}, b,b^{-1}]$, i.e. that involves only the first two parameters?

Thank you,

NoThik

Edit : the coefficients of the polynomials are integers, and I expect the kernel elements to have integer coefficients as well.

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.  

4(x-7) =6

 

(2x+3)(2x2-5x-3)=0

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

according to this page  http://www.maplesoft.com/products/maple/new_features/codeeditor.aspx

it says "Maple 17 features a completely new editor for writing Maple code."  but for the last 15 minutes I've been looking in my Maple 17.02 for windows and not able to figure where this editor is or how to start it.

When I open Maple, I say File->New-> and nothing there for an editor.

I also looked in my Maple installation icons group, there is nothing there.

I also looked here http://www.maplesoft.com/support/help/Maple/view.aspx?path=updates/Maple17/CodeEditor

"Maple 17 features a completely new editor for writing Maple code.   The editor includes many features to make it easier to write, read, and debug Maple code, such as syntax highlighting, bracket matching, command completion, and automatic indenting. The new editor is available for managing startup code, inline code edit regions, and code attached to embedded components."

but again, does not say anything about how to START it ? Or is this editor a separate apps I need to buy?

 

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];
filename = 'C:\Users\Hello\Desktop\testnew51.gif';
k = 10;
for n=1:length(x11)
plot3(x11(1:n),y11(1:n), z11(1:n));
%axis equal;
%axis([0,max(x11),0,max(y11)+10]);
xlabel('x (ft)');
ylabel('y11 (ft)');
title('Projectile Trajectory');
M(n)=getframe;
im = frame2im(M(n));
[imind,cm] = rgb2ind(im,256);
if n == 1;
imwrite(imind,cm,filename,'gif', 'Loopcount',inf);
else
imwrite(imind,cm,filename,'gif','WriteMode','append');
end;
end;
numtimes=3;
fps=1;
movie(M,numtimes,fps);

 

when i magnify the diagram in matlab, it is not a triangle, the diagram is changed, 

would like to draw this and animate this in maple to see whether maple has this problem

 

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];
sol:=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) sol(parameters=[a1=p1,b1=p2,c1=p3]); end proc:
FitParams:=Statistics:-NonlinearFit(ans, x11, y11, z11, x1, y1, z1, initialvalues=<150e-9>, output=parametervalues);

Error, (in Statistics:-NonlinearFit) initial values Vector has incorrect dimension

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);
ICS:=x1(0)=x11[1],y1(0)=y11[1],z1(0)=z11[1];
sol:=dsolve({a1,b1,c1,ICS}, numeric, method=rkf45, parameters=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10,k11,k12]);

Error, (in DEtools/convertsys) the ODE system does not contain derivatives of the unknown function u

ans:=proc(p1,p2,p3) sol(parameters=[a1=p1,b1=p2,c1=p3]); end proc:
FitParams:=Statistics:-NonlinearFit(ans, x11, y11, z11, x1, y1, z1, initialvalues=<150e-9>, output=parametervalues);

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.

First 252 253 254 255 256 257 258 Last Page 254 of 334