MaplePrimes Questions

Any reason why the display of a fairly large plot in Maple 2024 (only show a print screen here)


be worst then the display of the same plot in Maple 2020

In 2024, it seams to be rasterized, while in 2020 it is still in vector form. Also the plot does not resize as well in 2024 compare to 2020. Any hint would help!

Maybe large plot are displayed in raster image, there is probably a setting somewhere in the documentation. When I export both are in vector format...

Thanks!

I am experimenting using the this format of  Vector( [Vector] ) to make projective vectors a different data type to Vectors. I don't want to use 1 x 3 or 3 x 1 matrices. The format holds some promise.
I would like to be able to copy the Maple format of Vector or Vector[column]    and Vector[row] for my varaition. 

ProjVectoC and ProjVectorR    so ProjVector or ProjVector[column]   and ProjVector[row]
A secondary question  is on type checking (see previous question How to setup special type check in a procedure? - MaplePrimes  ). Would it be possible to have the type check return ProjVector[column] or ProjVector[row]?
The attached worksheet contains a procedure for factor reducing the vectors to to a minimal format of <x,y,z>. Also   Cross product and Dot product procedures to suit.

I am open to any efficiency improvements.

restart

interface(rtablesize=50)

[10, 10]

(1)

with(LinearAlgebra):

 

FactReduce:=overload([
     proc(v::{list,Vector})
          option overload;
          description " removes linear factor from",
                      " a list, vector, matrix or expression";
          uses LinearAlgebra;
          local i, num,tgdc,dnm, V1;
          num:=`ifelse`(type(v,Vector),numelems(v),nops(v));
          dnm:=frontend(lcm, [seq(denom(v[i]),i=1..num)]);
          V1:=radnormal(v*~dnm);
          tgdc:=V1[1];

          for i from 2 to num do
               tgdc:=frontend(gcd, [tgdc, V1[i]]);
          end do;

          return  simplify(V1/~tgdc);
     end proc,

     proc(M::{Matrix})
          option overload;
          uses LinearAlgebra;
          local i, num,r,c, tgdc,dnm, V1, Ml;
          r,c:=Dimension(M);
          num:=r*c;
          V1:=convert(M,list);
          dnm:=frontend(lcm, [seq(denom(V1[i]),i=1..num)]);
          Ml:=radnormal(dnm*~M);
          V1:=convert(Ml,list);#print((dnm,V1));
          tgdc:=V1[1];#print("xx")

          for i from 2 to num do
               tgdc:=frontend(gcd, [tgdc, V1[i]])
          end do;

          return  simplify(Ml/~tgdc);   
     end proc,

     proc(l::{`+`,`*`,`=`, `symbol`,procedure},  {vars::list:=[:-x,:-y]})
          option overload;
          uses LinearAlgebra;
          local i, num,f1,f1a,lv,lr, tgdc,dnm, V1,Vs;
          f1 := `if`(l::procedure, l(vars[]), l);
               f1a:=`if`(f1::`=`,lhs(f1)-rhs(f1),f1)  ; # Remequal(f1);
          lr:=primpart(f1a,vars);
          return lr
end proc

]):

ProjVectorC := proc(a, b, c)
local cfs, vectr;
description " A Projective Column (Line) Vector in Reduced format";
cfs := FactReduce([a, b, c]);
vectr := <[<cfs>]>;
end proc:

 

ProjVectorR := proc(a, b, c)
local cfs, vectr;
description " A Projective Row (Point) Vector";
cfs := sign(c)*FactReduce([a, b, c]);
vectr := <[<cfs>^%T]>^%T;
end proc:

 

`&otimes;` := proc(A, B)
local cp;
description "Cross Product of Projective Vectors in Reduced format";
cp :=sign(c)* FactReduce(LinearAlgebra:-`&x`(A[1], B[1]))^%T;
cp := ifelse(cp[3] <> 0, <[sign(cp[3]) *~ cp]>, cp); #makes sure format is [x,y,z] and not [x,y-z]
end proc:

 

`&odot;` := proc(A, B)
description "Dot Product of Projective Vectors";
(A[1]) . (B[1]);
end proc:

 

V := ProjVectorR(2, 4, -6); W := ProjVectorR(11, 7, 5); S := ProjVectorC(6, -18, 24)

Vector[column](%id = 36893490982610361748)

(2)

whattype(V); `~`[whattype](V)

Vector[row](%id = 36893490982610825812)

(3)

whattype(S); `~`[whattype](S)

Vector[column](%id = 36893490982626471436)

(4)

`~`[whattype](V[1])

Vector[row](%id = 36893490982558545668)

(5)

V[1] . V[1]

14

(6)

`&odot;`(V, V)

14

(7)

R := `&otimes;`(W, V)

Vector[column](%id = 36893490982630825980)

(8)

R := `&otimes;`(V, W)

Vector[column](%id = 36893490982630903548)

(9)

whattype(R)

Vector[column]

(10)

`~`[whattype](R)

Vector[column](%id = 36893490982598861396)

(11)

`~`[whattype](R[1])

Vector[column](%id = 36893490982598866092)

(12)

`&otimes;`(R, S)

Vector[column](%id = 36893490982624872076)

(13)

`&odot;`(R, S)

-85

(14)

`&odot;`(W, R)

0

(15)

`&odot;`(R, `<,>`([`<,>`(x, y, 1)]))

15-31*x+38*y

(16)
 

 

Download 2024-11-21_Q_Projective_Vector_Format.mw

The following is not a profound problem, and there is an obvious solution,

but it came up, and I would like to learn more about it.

 

Even though I recommend the add procedure when summing up individual entities,

my students keep showing me how smart the sum procedure is. Which makes

our worksheets more readable and reproducible for Maple users who are less frequent.

 

For example:

 

restart; Xlist := [1, 2, 3]; N := numelems(Xlist)

3

Using palette icon:

sum(Xlist[n], n = 1 .. N)

6

Cool!  Which means

sum(Xlist[n], n = 1 .. N)

6

But if we use the same palette icon for a vector

Xvector := convert(Xlist, Vector); sum(Xvector[n], n = 1 .. N)

Error, bad index into Vector

Because I believe this fails

sum(Xvector[n], n = 1 .. N)

Error, bad index into Vector

 

Would someone please teach me how I can see why the sum of a list

works, but does the sum of a vector fail?

Download MaplePrimes_sum_list_vector.mw

On the website "Learning Physics using Maple" of professor Gould, in the example "Vectors: Calculation & Visualization". If you click on the PDF file under that title, you see an example of vectors in 2d.

But when you look at the solution, you see him use the vector v with an arrow to create a fucntional depending of two variables. Since he doesn't load any package, I cannot reproduce this notation to work. I am talking about this:

Is there a trick that I am not aware of in Maple?  The only way I know to have the arrow is to load the Physics package and the Vector package. And then you use the notation r_ to show r with an arrow.

I asked the question in the YouTube channel but did not receive any answer.  Too bad.

Thank you in advance for any help on that matter.

Hello everyone.
Please tell me how to take this integral.

int(1/((a^2 + x)^(3/2)*x), x = 0 .. infinity)

Assuming that a is greater than zero and real. Thanks in advance

Maple defaults to expressing output in terms of Cosines.

Is it possible to instruct maple to rather calculate the output  with Sine as the default ?

 hello
 how to get curve fitting parameters right?  is that any stragey to get a good estimate.

restart;

with(Statistics):with(plots):with(Optimization):with(LinearAlgebra):


# given data from strain rate curve
E_0[theta] := 7.883352314*10^9;
alpha[theta]:= 0.982

7883352314.

 

.982

(1)


# experimental creep data under 44 at 100 degree celcius
c_strain := Vector ([<<0>,<0.0284698>,<0.0533808>,<0.0782918>,<0.0996441>,<0.124555>,<0.142349>,<0.156584>,<0.16726>,<0.177936>,<0.181495>,<0.188612>,<0.192171>,<0.19573>,<0.19573>,<0.202847>,<0.206406>,<0.206406>,<0.209964>,<0.209964>,<0.209964>,<0.206406>,<0.209964>>]):

c_time := Vector ([<<0>,<0>,<0.048>,<0.192>,<0.352>,<0.544>,<0.704>,<0.896>,<1.088>,<1.312>,<1.52>,<1.76>,<1.984>,<2.208>,<2.464>,<2.736>,<3.088>,<3.392>,<3.664>,<4.016>,<4.352>,<4.592>,<4.832>>]):
sigma[0] := 44*10^6;
epsilon[0] := sigma[0]/E_0[theta];

44000000

 

0.5581381911e-2

(2)


# change vector to list
c_strain := convert(c_strain,list):
c_time := convert(c_time,list):

# extract zero from list
c_strain := c_strain [2..-1];
c_time := c_time [2..-1];

[0.284698e-1, 0.533808e-1, 0.782918e-1, 0.996441e-1, .124555, .142349, .156584, .16726, .177936, .181495, .188612, .192171, .19573, .19573, .202847, .206406, .206406, .209964, .209964, .209964, .206406, .209964]

 

[0, 0.48e-1, .192, .352, .544, .704, .896, 1.088, 1.312, 1.52, 1.76, 1.984, 2.208, 2.464, 2.736, 3.088, 3.392, 3.664, 4.016, 4.352, 4.592, 4.832]

(3)


# for further calculation need to know how many elements are in the list
M := nops(c_strain);
N := nops(c_time);

22

 

22

(4)


# constitutive equation
creep_strain := proc(t)
local i;
options operator, arrow;
epsilon[0]*(1 + alpha[theta]*add(-(B[i]*(-beta[i]*t + exp(-beta[i] *t) -1))/beta[i],i=1..3))
end proc;

proc (t) local i; options operator, arrow; epsilon[0]*(1+alpha[theta]*add(-B[i]*(-beta[i]*t+exp(-beta[i]*t)-1)/beta[i], i = 1 .. 3)) end proc

(5)


#define objective function

Digits := 9:
obj := add(
         (
           creep_strain(c_time[j])
           -
           c_strain[j]
         )^2
         , j=1..N
       ):


# curve fitting
opt := NLPSolve(obj,
{
  beta[1] >= 0,
    beta[2] >= 0,
    beta[3] >= 0,
    B[1] >= 0, B[1]<= 0.2,
    B[2] >= 0, B[2] <= 0.3,
    B[3] >= 0, B[3] <= 0.4
}
);

[.467521159408790410, [B[1] = HFloat(0.19999999999999996), B[2] = HFloat(0.30000000000000004), B[3] = HFloat(0.4), beta[1] = HFloat(1.2600715880722035e-9), beta[2] = HFloat(5.152129055134073e-9), beta[3] = HFloat(5.057870561183067e-9)]]

(6)

# plot the result
display(
   ScatterPlot(c_time, c_strain, symbol=circle, color=blue),
 
  plot(eval(creep_strain(t), opt[2]), t=0.00..max(c_time), color=black)
)

Download at_44_Mpa_at_100C.mw

Why do maple not contract over inert differentials ?
The last command just return the defining equation and refuses to contract.

See example below

restart;
with(Physics);
g_[[5, 29, 1]];
eq1 := g_[~mu, ~nu]*Diff(w(r, theta), mu)*Diff(w(r, theta), nu);
SumOverRepeatedIndices(eq1);

-----------------------------------------------------------------------------------
However Check return empty coordinates, which is completely contradictory.

Check(eq1, all);
      The repeated indices per term are: ((...),(...),...)

        , the free indices are: (...)

                    [{}], {~mu, ~nu}

I was not expecting odesteps to show steps for this ode, but crash the server each and everytime?

Anyone could find why? I am using Maple 2024.2 on windows 10 with latest Physics. This might indicate serious problem somewhere. Software should not really crash this easily.

interface(version);

`Standard Worksheet Interface, Maple 2024.2, Windows 10, October 29 2024 Build ID 1872373`

Physics:-Version();

`The "Physics Updates" version in the MapleCloud is 1827 and is the same as the version installed in this computer, created 2024, November 13, 9:16 hours Pacific Time.`

libname;

"C:\Users\Owner\maple\toolbox\2024\Physics Updates\lib", "C:\Program Files\Maple 2024\lib"

restart;

ode:=5*(1+t^2)*diff(y(t),t)=4*t*y(t)*(y(t)^3-1);

5*(t^2+1)*(diff(y(t), t)) = 4*t*y(t)*(y(t)^3-1)

dsolve(ode);

y(t) = 1/((t^2+1)^(6/5)*c__1+1)^(1/3), y(t) = -(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3)-((1/2)*I)*3^(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3), y(t) = -(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3)+((1/2)*I)*3^(1/2)/((t^2+1)^(6/5)*c__1+1)^(1/3)

Student:-ODEs:-ODESteps(ode);


 

Download crash_server_nov_18_2024.mw

here is small movie

 

 

For a system of 8 equations, it takes too long for me to solve it by using solve, but I can only give one solution by using fsolve. If I want solutions in other ranges, I need to provide a general range, but I don't know the range, how can I quickly find all the solutions?question1118.mw

eqs := [a = b, c = d, e = f]:

map(`+`, eqs, 2);
map(`-`, eqs, 2);
map(`/`, eqs, 2);
         [a + 2 = b + 2, c + 2 = d + 2, e + 2 = f + 2]

         [a - 2 = b - 2, c - 2 = d - 2, e - 2 = f - 2]

               [1     1    1     1    1     1  ]
               [- a = - b, - c = - d, - e = - f]
               [2     2    2     2    2     2  ]

These work differently

map(`*`, eqs, 2);
map(`^`, eqs, 2);
               [2 (a = b), 2 (c = d), 2 (e = f)]

Error, non-algebraic base in a power: a = b

(The first one can be dealt with by applying eval to the output)

Why do not all work the same way?

Edit:
Generic work arounds where arithop is one of: + - / * ^

map(eval@`arithop`, eqs, 2);
map(map@`arithop`, eqs, 2);# Update: Maple 2021 and higher
[seq(i arithop 2, i in eqs)];

Hi, the below code is the equation of a standard ellipse intersects the line at two points, (x1,y1) and (x2,y2).

I wanna "y1+y2" and "y1*y2" generate by specific code auto, no need to input "k*x1_plus_x2 + 2*b" and "b*k*x1_plus_x2 + k^2*x1_by_x2 + b^2" manually. But I don't know how to edit it? maybe sequence?

Any answer and reply is welcome.

restart

The below code is the equation of a standard ellipse intersects the line at two points, (x1,y1) and (x2,y2).

I wanna "y1+y2" and "y1*y2" generate by specific code auto, no need to input "k*x1_plus_x2 + 2*b" and "b*k*x1_plus_x2 + k^2*x1_by_x2 + b^2" manually. But I don't know how to edit it? maybe sequence?

Error, missing operator or `;`

 

C := x^2/A^2+y^2/B^2-1

x^2/A^2+y^2/B^2-1

(1)

l := y = k*x+b

y = k*x+b

(2)

subs(l, C)

x^2/A^2+(k*x+b)^2/B^2-1

(3)

eq := collect(%, {x, x^2})

(1/A^2+k^2/B^2)*x^2+2*b*k*x/B^2+b^2/B^2-1

(4)

x1_plus_x2 := simplify(-coeff(eq, x)/coeff(eq, x^2))

-2*b*k*A^2/(A^2*k^2+B^2)

(5)

x1_by_x2 := simplify(coeff(eq, x, 0)/coeff(eq, x^2))

(-B^2+b^2)*A^2/(A^2*k^2+B^2)

(6)

x1 := solve(eq = 0, x)[1]; x2 := solve(eq = 0, x)[2]

-(b*k*A-(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))*A/(A^2*k^2+B^2)

 

-(b*k*A+(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))*A/(A^2*k^2+B^2)

(7)

subs(x1, l); subs(x2, l)
I don't know how to make it like y1=k*x1+b and y2=k*x2+b auto in this procedure.

Error, invalid input: subs received -(b*k*A-(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))/(A^2*k^2+B^2)*A, which is not valid for its 1st argument

 

Error, invalid input: subs received -(b*k*A+(A^2*B^2*k^2+B^4-B^2*b^2)^(1/2))/(A^2*k^2+B^2)*A, which is not valid for its 1st argument

 

Error, missing operator or `;`

 

y1_plus_y2 := simplify(k*x1_plus_x2+2*b)

2*b*B^2/(A^2*k^2+B^2)

(8)

y1_by_y2 := simplify(b*k*x1_plus_x2+k^2*x1_by_x2+b^2)

B^2*(-A^2*k^2+b^2)/(A^2*k^2+B^2)

(9)
 

 

Download ask_ellispe_and_straight_line.mw

I needed to plot a function, using  plot in Maple.

plot(sin(x)*sqrt(1 - (sin(x)/x)^2), x = 0 .. Pi/4)

The graph shown by Maple seems to be identically 0 from x=0 up to some x*. At this point it jumps and for x>x* it looks fine. Of course the function has a singularity at x=0, but even changing the left end of plotting range to something small but positive does not alleviate the problem. Another strange thing is that x* seems to depend on the (end point of) the plotting range.

hello,
I've been playing around a bit with mapel in the 14 day trial version and now I have a few questions
how can I set mapel so that results are always shown to me in SI format and the engineering representation and the results are automatically approximated, e.g. pi is calculated with 3.14...?
The configuration appears in the margin for individual solutions, but how do I set this globally so that I don't have to set it individually each time?

I also have to manually set the format of an input to input so that I can access the result when solving.

is there a reset button that is hidden so that I can go back to the basic settings? I must have changed something.

I hope you can help me

thanks for the help and sorry for my nob question, im reele new in Cas or other software like this

If it is the wrong tags or generally wrong here, please delete or move Thanks
Arthur

restart:

 

inte_eq := int(-(sum(B[i]*beta[i]* exp(-beta[i] * (t-tau)),i=1..n)),tau=0..t);

int(-(sum(B[i]*beta[i]*exp(-beta[i]*(t-tau)), i = 1 .. n)), tau = 0 .. t)

(1)

how to solve this ?

Download creep_integral_sol.mw

First 53 54 55 56 57 58 59 Last Page 55 of 2425