MaplePrimes Questions

How to convert a ploting values in a graph to excel?

restart;
with(PDETools): with(DETools): with(plots):with(plottools):
eq1 := ((D@@2)(f))(eta)*f(eta)*sin(alpha)+((D@@2)(f))(eta)*eta*cos(alpha)+2*((D@@3)(f))(eta) = 0;
ics := f(0) = 0, (D(f))(0) = 0, (D(f))(10) = 1; bcs := (D(f))(10) = 0, theta(10) = 0, phi(10) = 0;
Parameters1 := alpha = (1/3)*Pi;
sol1 := dsolve(eval({eq1, ics}, {Parameters1}), numeric);
p1 := odeplot(sol1, [[eta, ((D@@2)(f))(eta)]], eta = 0 .. 10, color = [red], axes = boxed);
display({p1});

To simplify, I will use some of my test code, but I need to use a vector index within a sum. 
m=Vector[column](3, [1, 1, 1]);
sum(L[k], k = 1 .. 3) ;

returns "Error, bad index into Vector" 
is there a way around this problem?

I am particularly interested in a full coordplot3d display for ellipsoidal coords. 

Dear all,

the BlockCopy command is a miracle for me that I don't understand. Is there an easier command or an easy to understand documentation?

Thanks

Dear all, I'm new with maple. How can I extend an existing matrix?

XX := Matrix(2, 4, [[1, 1, 1, 1], [2, 2, 2, 2]])

extend(XX,1,0,0) # doesn't work

Thanks for help

I am trying to solve several problems of  solving  around 200 undetermined variables out of a set of aroud 300 2nd-order equations (such as a*b=c).

I just use "solve" command.

1. Maple continuingly evaluates and does not return result, how to make it work? 

2. In some problems, i have results, but there are great of freedom, which i want to restrict them in some way.

As the following worksheet shows, 
 

restart

kernelopts('version');

Physics:-Version();

`Maple 2024.0, X86 64 WINDOWS, Mar 01 2024, Build ID 1794891`

`The "Physics Updates" version in the MapleCloud is 1732 and is the same as the version installed in this computer, created 2024, April 12, 17:58 hours Pacific Time.`

with(RealDomain):

eval(MTM:-det(<
   a, b/2, d/2 |
   b/2, c, e/2 |
   d/2, e/2, f
  >), PDETools:-Solve(MTM:-det(<
     x**2 + y**2, x1**2 + y1**2, x2**2 + y2**2, x3**2 + y3**2 |
     x, x1, x2, x3 |
     y, y1, y2, y3 |
     1, 1, 1, 1
    >) = inner([a, b, c, d, e, f], [x**2, x*y, y**2, x, y, 1]),
   {f, e, d, c, b, a}, 'independentof' = {y, x}))/MTM:-det(<
  x1, x2, x3 |
  y1, y2, y3 |
  1, 1, 1
 >): simplify(`%`);

-(1/4)*(x1^2-2*x1*x2+x2^2+(y1-y2)^2)*(x2^2-2*x2*x3+x3^2+(y2-y3)^2)*(x1^2-2*x1*x3+x3^2+(y1-y3)^2)

eval(MTM:-det(<
   a, b/2, d/2 |
   b/2, c, e/2 |
   d/2, e/2, f
  >), PDETools:-Solve(MTM:-det(<
     x**2 - y**2, x1**2 - y1**2, x2**2 - y2**2, x3**2 - y3**2, x4**2 - y4**2 |
     x*y, x1*y1, x2*y2, x3*y3, x4*y4 |
     x, x1, x2, x3, x4 |
     y, y1, y2, y3, y4 |
     1, 1, 1, 1, 1
    >) = inner([a, b, c, d, e, f], [x**2, x*y, y**2, x, y, 1]),
   {f, e, d, c, b, a}, 'independentof' = {y, x}))/(MTM:-det(<
   x2, x3, x4 | 
   y2, y3, y4 | 
   1, 1, 1
  >)*MTM:-det(<
   x3, x4, x1 | 
   y3, y4, y1 | 
   1, 1, 1
  >)*MTM:-det(<
   x4, x1, x2 | 
   y4, y1, y2 | 
   1, 1, 1
  >)*MTM:-det(<
   x1, x2, x3 | 
   y1, y2, y3 | 
   1, 1, 1
  >)): simplify(`%`);

(1/4)*((x2-x3)*x1-x2*x4+x3*x4+(y2-y3)*(y1-y4))*((x3-x4)*x1+(x4-x3)*x2+(y3-y4)*(y1-y2))*((x2-x4)*x1-x2*x3+x3*x4+(y2-y4)*(y1-y3))


 

Download Why_not_consider_subexpressions?.mw

the underlined part is evidently not the simplest. (For instance, shouldn't RealDomain:-simplify(x2^2 - 2*x2*x3 + x3^2 + (y2 - y3)^2, 'size') and RealDomain:-simplify((x2-x3)*x1-x2*x4+x3*x4+(y2-y3)*(y1-y4), 'size') be converted into RealDomain:-simplify((x2 - x3)^2 + (y2 - y3)^2, 'size') and RealDomain:-simplify((x2 - x3)*(x1 - x4) + (y2 - y3)*(y1 - y4), 'size')?) 
If I understand correctly, , by default, should try combining every part of an expression with every other to apply a vast range of potential transformations to look at many different forms of it and make progress in picking out the simplest possible one. So, why is simplify unable to touch certain sub-expressions when they are encountered at intermediate stages in a computation? 

My file is working but I want to draw a 2D contour plot into a 3D view. How can I adjust the 3D view as per the 2D plot?

Help_3D_view.mw

I have a double for loop which has a numeric integration located inside of the innermost loop. When I try to run my worksheet I recieve an error in which the numeric integration is not computed for a certain set of values in my loops. If I take these two values and input them into my function and then integrate outside of the loop it appears to work just fine. Not sure what to make of this. Any thoughts would be appreciated. 

Secondly, to avoid any confusion about what I am trying to do and if someone has general comments on my worksheet I added some text in the worksheet to describe what I am interested in doing, even though I am sure most people here would be able to figure that out from the commands alone. 

Thanks. 

LoopError.mw

Could someone be able to spot why I get different solution when solving for the constant of integration from this Maple dsolve solution manually than when asking Maple to do it directly?

This is the ode 

ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1);
ic:=y(1) = 1;

If I ask Maple to solve it with the IC all at once, it gives solution which odetest verifies OK.

If I ask Maple to solve it with no IC, then solve the constant myself and plug the constant back into the solution I get solution which does not verify any more.

I am not able to find why. Could someone spot the error in this? Please see worksheet below. I suspect the problem is when plugging back the constant of integration into the general solution, but have no idea now what it is. Clearly Maple did something much smarter than what I did by just plugging the constant back into the solution. May be need to specify what branch to use when plugging the constant back? but how do I know which one?
 

interface(version);

`Standard Worksheet Interface, Maple 2024.0, Windows 10, March 01 2024 Build ID 1794891`

Physics:-Version()

`The "Physics Updates" version in the MapleCloud is 1730 and is the same as the version installed in this computer, created 2024, April 17, 19:33 hours Pacific Time.`

ode:=x*y(x)*diff(y(x), x) = (x + 1)*(y(x) + 1);
ic:=y(1) = 1;
sol_no_IC:=dsolve(ode);
 

x*y(x)*(diff(y(x), x)) = (x+1)*(y(x)+1)

y(1) = 1

y(x) = -LambertW(-exp(-x-1)/(x*c__1))-1

sol_with_IC_direct:=dsolve([ode,ic]);
odetest(sol_with_IC_direct,[ode,ic]);

y(x) = -LambertW(-1, -2*exp(-x-1)/x)-1

[0, 0]

#this verifies Maple found correct constant also:

solve(rhs(sol_with_IC_direct)=rhs(sol_no_IC),c__1)

1/2

#now solve for constant of integration manually. This gives invalid solution. Why?

eq:= 1=limit(rhs(sol_no_IC),x=1);

1 = -LambertW(-exp(-2)/c__1)-1

PDEtools:-Solve(eq,c__1);

c__1 = 1/2

sol_with_ic:=eval(sol_no_IC,%)

y(x) = -LambertW(-2*exp(-x-1)/x)-1

odetest(sol_with_ic,[ode,ic]);

[0, 2+LambertW(-2*exp(-2))]

 

 

Download why_wrong_solution.mw

How to show that any Pythagorean triplet can be obtained from <3,4,5> ? Thank you.
Can we simplify this program?

#Génération Géométrique et Algébrique des triplets Pythagoriciens
restart;
with(geometry);
with(LinearAlgebra);
_EnvHorizomtalName = 'x';
_EnvVerticalName = 'y';

with(plottools);
P := point([0, 0], color = black, symbol = cross, symbolsize = 25);
Oo := point([1/2, 1/2], color = black, symbol = cross, symbolsize = 25);
A := point([1, 1/2], color = black, symbol = cross, symbolsize = 25);
with(plots);
c1 := circle([1/2, 1/2], 1/2, color = blue);
NULL;
PA := line([0, 0], [1, 1/2], color = red);
eqC := (x - 1/2)^2 + (y - 1/2)^2 = 1/4;
eqPA := y = 1/2*x;
sol := solve({eqC, eqPA}, {x, y});

t1 := textplot([0, 0, 'typeset'("P"), font = [Times, Bold, 14]], 'align' = 'above');
t2 := textplot([1, 1/2, 'typeset'("A"), font = [Times, Bold, 14]], 'align' = 'right');
t3 := textplot([1/5, 1/10, 'typeset'("A'"), font = [Times, Bold, 14]], 'align' = 'above');
A1 := point([1 - 1/5, 1/10], color = black, symbol = cross, symbolsize = 25);
diff(A, x) := point([1/5, 1/10], color = black, symbol = cross, symbolsize = 25);
t4 := textplot([1 - 1/5, 1/10, 'typeset'("A1"), font = [Times, Bold, 14]], 'align' = 'right');
A2 := point([1 - 1/5, 1 - 1/10], color = black, symbol = cross, symbolsize = 25);
t5 := textplot([1 - 1/5, 1 - 1/10, 'typeset'("A2"), font = [Times, Bold, 14]], 'align' = 'right');
A3 := point([1/5, 1 - 1/10], color = black, symbol = cross, symbolsize = 25);
t6 := textplot([1/5, 1 - 1/10, 'typeset'("A3"), font = [Times, Bold, 14]], 'align' = 'right');

poly := Matrix([[1/5, 1/10], [1 - 1/5, 1/10], [1 - 1/5, 1 - 1/10], [1/5, 1 - 1/10]], datatype = float);
pol := polygonplot(poly, color = blue, transparency = 0.95);

display(c1, P, Oo, A, PA, seq(A || i, i = 1 .. 3), seq(t || i, i = 1 .. 6), pol, scaling = constrained, axes = none, size = [600, 600]);

R1 := Transpose(<<1, -2, 2> | <2, -1, 2> | <2, -2, 3>>);
R2 := Transpose(<<1, 2, 2> | <2, 1, 2> | <2, 2, 3>>);
R3 := Transpose(<<-1, 2, 2> | <-2, 1, 2> | <-2, 2, 3>>);
V := <3, 4, 5>;
MatrixVectorMultiply(R1, V);
MatrixVectorMultiply(R2, V);
MatrixVectorMultiply(R3, V);
t1 := <2225, 3648, 4273>;
t2 := MatrixVectorMultiply(1/R1, t1);
t3 := MatrixVectorMultiply(1/R3, t2);
t4 := MatrixVectorMultiply(1/R2, t3);
t5 := MatrixVectorMultiply(1/R1, t4);
t6 := MatrixVectorMultiply(1/R3, t5);
MatrixVectorMultiply(MatrixMatrixMultiply(MatrixMatrixMultiply(MatrixMatrixMultiply(MatrixMatrixMultiply(R1, R3), R2), R1), R3), V);
% - t1;
NULL;
 

The question is not at all from me, but, probably, one might say, from the authors of this publication.  interesting_system.pdf

Just for fun.
Find all real solutions to this 2x2 system of nonlinear equations in any given domain. 

f1:=x1-x1*sin(x1+5x2)-x2*cos(5x1-x2);
f2:=x2-x2*sin(5x1-3x2)+x1*cos(3x1+5x2);


 


 

 

In my view, <x || (1 .. 2); y || (1 .. 2); 1 $ 2> should return a Matrix without any error messages; however, 

<x || (1 .. 2); y || (1 .. 2); 1 $ 2>; # Arguments are shielded??? 
Error, (in Matrix) this entry is too wide or too narrow: 1

If I understand right, each argument of a function is evaluated in turn (unless the modifier is used). 
So why is it not equivalent to <x1, x2; y1, y2; 1, 1>

 

As I learned here Maple is also a multi-paradigm programming language.

I was wondering how Maple compares in this chart.

Even though I am not a computer scientist, I would say that Maple is on a par with the number one (not sure about pipelines).

Would this claim be correct?

Hello everyone,

I'm using Maple 18. I have a problem that I can't solve. It concerns the programmatic - from the Maple code level - export of animations (even single images) with good quality graphics, i.e. either high resolution or "large" size - which translates into the same. This is because Maple 18 does not have a size option in plot3d.

Even manually enlarged graphics - a bit too much, makes manual export impossible; Maple reports "..the file could not be created...". Most often, this ends with the creation of a gif file with a capacity of 0 bytes.

I am asking for help if anyone knows how to deal with this [normal export of "normal" graphics manually or with software can of course be done in Maple 18].

Regards.

First 12 13 14 15 16 17 18 Last Page 14 of 2329