Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hello Everyone,

Me Again... So I have been working do create a procedure, but I started the coding without encasing it in the proc() / end proc; brackets, thinking I could add it later.
What the script does is take parameters and create a matrix and determines the determinant of that matrix.
When I let the script run on its own, it is working perfectly, but when I activate the proc() / end proc; brackets it suddenly gives me a number of errors, telling me the matrix is not square or that the if-loop misses its 2nd argument.

I am kind of suspecting this happens because I take the variable "NumberPlies" from a Table that exists outside the proc(), but on the same work sheet, but I am not 100% sure.
I have uploaded the code, so one of you experts could perhaps have a look and tell me where I am wrong. Why is the script behaving differently on its own compared to when I call it as a procedure?

Any help would be fantastic!

Best Regards,
Lennart
 

Download Test_GetDet_MaplePrimes.mw
 

Maple*des*zur*Berechnung*Beulverhaltens*Composite*Programm*symmetrischer-LEVY*Platten*nach
Anzahl Lagen des Laminates (Ohne Mittellage, eine Seite der Symmetrie):


Lastfall-Definition:

Maple*des*zur*Berechnung*Beulverhaltens*Composite*Programm*symmetrischer-LEVY*Platten*nach

(1)

 

restart; interface(warnlevel = 0); with(DocumentTools); with(LinearAlgebra); with(DocumentTools); with(LinearAlgebra); E1 := 125000; E2 := 10000; v12 := .3; G12 := 5000; t := .25; v21 := E2*v12/E1; Q11 := E1/(-v12*v21+1); Q22 := E2/(-v12*v21+1); Q12 := v21*E1/(-v12*v21+1); Q66 := G12; NumberPlies := GetProperty('ComboBox1', 'selectedindex'); A11 := 0; A12 := 0; A16 := 0; A21 := 0; A22 := 0; A26 := 0; A61 := 0; A62 := 0; A66 := 0; B11 := 0; B12 := 0; B16 := 0; B21 := 0; B22 := 0; B26 := 0; B61 := 0; B62 := 0; B66 := 0; D11 := 0; D12 := 0; D16 := 0; D21 := 0; D22 := 0; D26 := 0; D61 := 0; D62 := 0; D66 := 0; for i to NumberPlies do CurrentAngle := PlyTable1[i, 1]; CurrentHeight := t*i; CurrentHeight := CurrentHeight-.5*t*NumberPlies; CurrentAngleRad := (1/180)*Pi*CurrentAngle; CurrentQMatrix := Matrix(3, 3, {(1, 1) = Q11, (1, 2) = Q12, (1, 3) = 0, (2, 1) = Q12, (2, 2) = Q22, (2, 3) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = Q66}); TurnMatrix := Matrix(3, 3, {(1, 1) = cos(CurrentAngleRad)^2, (1, 2) = sin(CurrentAngleRad)^2, (1, 3) = -2*cos(CurrentAngleRad)*sin(CurrentAngleRad), (2, 1) = sin(CurrentAngleRad)^2, (2, 2) = cos(CurrentAngleRad)^2, (2, 3) = 2*cos(CurrentAngleRad)*sin(CurrentAngleRad), (3, 1) = -2*cos(CurrentAngleRad)*sin(CurrentAngleRad), (3, 2) = 2*cos(CurrentAngleRad)*sin(CurrentAngleRad), (3, 3) = cos(CurrentAngleRad)^2-sin(CurrentAngleRad)^2}); CurrentQMatrixTurned := Multiply(TurnMatrix, Multiply(CurrentQMatrix, Transpose(TurnMatrix))); Q_11 := CurrentQMatrixTurned[1, 1]; Q_12 := CurrentQMatrixTurned[1, 2]; Q_16 := CurrentQMatrixTurned[1, 3]; Q_21 := CurrentQMatrixTurned[2, 1]; Q_22 := CurrentQMatrixTurned[2, 2]; Q_26 := CurrentQMatrixTurned[2, 3]; Q_61 := CurrentQMatrixTurned[3, 1]; Q_62 := CurrentQMatrixTurned[3, 2]; Q_66 := CurrentQMatrixTurned[3, 3]; A11 := A11+Q_11*(CurrentHeight-CurrentHeight+t); A12 := A12+Q_12*(CurrentHeight-CurrentHeight+t); A16 := A16+Q_16*(CurrentHeight-CurrentHeight+t); A21 := A21+Q_21*(CurrentHeight-CurrentHeight+t); A22 := A22+Q_22*(CurrentHeight-CurrentHeight+t); A26 := A26+Q_26*(CurrentHeight-CurrentHeight+t); A61 := A61+Q_61*(CurrentHeight-CurrentHeight+t); A62 := A62+Q_62*(CurrentHeight-CurrentHeight+t); A66 := A66+Q_66*(CurrentHeight-CurrentHeight+t); B11 := B11+.5*Q_11*(CurrentHeight^2-(CurrentHeight-t)^2); B12 := B12+.5*Q_12*(CurrentHeight^2-(CurrentHeight-t)^2); B16 := B16+.5*Q_16*(CurrentHeight^2-(CurrentHeight-t)^2); B21 := B21+.5*Q_21*(CurrentHeight^2-(CurrentHeight-t)^2); B22 := B22+.5*Q_22*(CurrentHeight^2-(CurrentHeight-t)^2); B26 := B26+.5*Q_26*(CurrentHeight^2-(CurrentHeight-t)^2); B61 := B61+.5*Q_61*(CurrentHeight^2-(CurrentHeight-t)^2); B62 := B62+.5*Q_62*(CurrentHeight^2-(CurrentHeight-t)^2); B66 := B66+.5*Q_66*(CurrentHeight^2-(CurrentHeight-t)^2); D11 := D11+(1/3)*Q_11*(CurrentHeight^3-(CurrentHeight-t)^3); D12 := D12+(1/3)*Q_12*(CurrentHeight^3-(CurrentHeight-t)^3); D16 := D16+(1/3)*Q_16*(CurrentHeight^3-(CurrentHeight-t)^3); D21 := D21+(1/3)*Q_21*(CurrentHeight^3-(CurrentHeight-t)^3); D22 := D22+(1/3)*Q_22*(CurrentHeight^3-(CurrentHeight-t)^3); D26 := D26+(1/3)*Q_26*(CurrentHeight^3-(CurrentHeight-t)^3); D61 := D61+(1/3)*Q_61*(CurrentHeight^3-(CurrentHeight-t)^3); D62 := D62+(1/3)*Q_62*(CurrentHeight^3-(CurrentHeight-t)^3); D66 := D66+(1/3)*Q_66*(CurrentHeight^3-(CurrentHeight-t)^3) end do; A = (Matrix(3, 3, {(1, 1) = A11, (1, 2) = A12, (1, 3) = A16, (2, 1) = A21, (2, 2) = A22, (2, 3) = A26, (3, 1) = A61, (3, 2) = A62, (3, 3) = A66})); B = (Matrix(3, 3, {(1, 1) = B11, (1, 2) = B12, (1, 3) = B16, (2, 1) = B21, (2, 2) = B22, (2, 3) = B26, (3, 1) = B61, (3, 2) = B62, (3, 3) = B66})); D = (Matrix(3, 3, {(1, 1) = D11, (1, 2) = D12, (1, 3) = D16, (2, 1) = D21, (2, 2) = D22, (2, 3) = D26, (3, 1) = D61, (3, 2) = D62, (3, 3) = D66})); Nx := 200; Ny := 0; Nxy := 0; a := 500; b := 500; m := 1; chi := x/a; eta := y/b; alpha := a/b; alphaD := a*(D22/D11)^(1/4)/b; betaM := m*Pi/alphaD; betaD := (D12+2*D66)/sqrt(D11*D22); etaD := D12/sqrt(D11*D22); nyD := etaD/betaD; kx := Nx*b^2/(Pi^2*sqrt(D11*D22)); ky := Ny*b^2/(Pi^2*D22); kxy := Nxy*b^2/(Pi^2*(D11*D22^3)^(1/4)); Omega := betaD^2-1+kx*(alphaD/m)^2; if kx > (m/alphaD)^2 then lambda1 := m*Pi*sqrt(betaD+sqrt(Omega))/alphaD; lambda3 := m*Pi*sqrt(sqrt(Omega)-betaD)/alphaD; GenFunc := W1*cosh(lambda1*eta)+W2*sinh(lambda1*eta)+W3*cos(lambda3*eta)+W4*sin(lambda3*eta); Status := 1 elif kx < (m/alphaD)^2*(-betaD^2+1) then omegaklein := sqrt(.5*(sqrt(betaD^2-Omega)+betaD)); phi := sqrt(.5*(sqrt(betaD^2-Omega)-betaD)); GenFunc := W1*cosh(omegaklein*eta)*cos(phi*eta)+W2*sinh(omegaklein*eta)*cos(phi*eta)+W3*cosh(omegaklein*eta)*sin(phi*eta)+W4*sinh(omegaklein*eta)*sin(phi*eta); Status := 5 elif (m/alphaD)^2 > kx then if kx > (m/alphaD)^2*(-betaD^2+1) then lambda1 := m*Pi*sqrt(betaD+sqrt(Omega))/alphaD; lambda3 := m*Pi*sqrt(sqrt(Omega)-betaD)/alphaD; GenFunc := W1*cosh(lambda1*eta)+W2*sinh(lambda1*eta)+W3*cosh(lambda3*eta)+W4*sinh(lambda3*eta); Status := 3 end if end if; y := 0; EQ1 := GenFunc = 0; unassign('y'); GenFunc; EQHelp := diff(GenFunc, `$`(y, 1)); y := 0; EQ2 := EQHelp = 0; unassign('y')*GenFunc; y := b; EQ3 := GenFunc = 0; unassign('y'); GenFunc; EQHelp2 := diff(GenFunc, `$`(y, 1)); y := b; EQ4 := EQHelp2 = 0; unassign('y'); Test := GenerateMatrix({EQ1, EQ2, EQ3, EQ4}, {W1, W2, W3, W4}); Determinant(Test[1]); return Determinant(Test[1])

HFloat(-0.2442128895120277)

(2)

GetDet

GetDet

(3)

GetDet()

Error, (in LinearAlgebra:-Determinant) matrix must be square

 

``


 

Download Test_GetDet_MaplePrimes.mw

 

Test_GetDet_MaplePrimes.mw

P__eff := (4.881726014*10^(-13)*(x__1^2 + 0.3)*R/((1 - x__1)*(3*x__1^2 + 0.6)*(7.654218526*10^(-21)*R^2*(x__1^2 + 0.3)/((1 - x__1)*(3*x__1^2 + 0.6)) + 1)))*1000;
expr := eval(P__eff(R));
plot([seq(expr, x__1 = [0.3, 0.5, 0.7])], R = 10000000 .. 10000000000000, legend = [seq('x__1' = x__1, x__1 = [0.3, 0.5, 0.7])], color = ["blue", "red", "gold"], thickness = 3, axes = "boxed", gridlines = true, labels = [R, P__eff], axis[1] = [mode = log]);

Obviously, there is a problem with the logarithmic function curve in the interval of 10^7 to10^10. Can anyone tell me how to solve it?thank you very much!

DEAR SIR,

 I REQUEST YOU TO PROVIDE THE METHOD TO SOLVE THE FOLLOWING PROBLEM.

 

 

THANK YOU

 

  

 


 

 

I was trying to solve single variable nonlinear equation in maple. It gives reliable solution. For example,  equation of the type, solve(x cos(theta) -(2500-x (^3) sin(theta))^(1.3)-40, x).

 

But I wanted to solve for different values ( theta, k) simultaneously (shown below ):

 

 

Solve (x cos(theta) -(2500-x (^3) sin(theta))^(0.45)-k , x).

 

Where say , theta: 1,2,3,....,90

And , k: 3.1,3.2, 3.3,.............3.90

 

It would be great if you could provide link for some tutorials to do so. I am searching but still could not figure perfect tutorial to do so. 

 

I am interested to learn the procedure to solve this type of problem.

 

Thank you, stay safe and stay healthy. 

Hi, I am new to Maple.

I have a function f=2^x1*(7^x2+443^x3+547^x4+32^x5) containing five variables x1,x2,x3,x4,x5 and I have a set of values for each of them to input in f. Specifically x1 \in {1,2,3,4,5}, and the values of x2,x3,x4,x5 are the following sets (x2,x3,x4,x5) \in {(1,2,4,5),(4,7,8,0),(1,7,6,9),(0,1,3,5),(2,5,6,1)}. How do I write a program to evaluate all such values of f?

I have two simple implicitly defined curves: 0.5y^2-x-3 = 0 and x+y=1. I would like to plot these curves implicitly and shade the region enclosed by them. I've tried using the plots:-implicitplot( ) as shown, but I can't get just the enclosed region to be shaded. I know how to acheive this using the explicit equations. I am looking for an implicitplot solution, assuming there is one.
 

with(plots)``

implicitplot([.5*y^2-x-3 = 0, x-y = 1], x = -5 .. 8, y = -5 .. 5, filledregions = true, coloring = [red, white])

 

``


 

Download shade_implicitplot.mwshade_implicitplot.mw

Using the equation for an ellipse, how do I create a Monte Carlo simulation to find the area of the ellipse? I know you create an ellipse bordered by a rectangle and do say 1000 loops and then calculate the number of points inside the ellipse, find the ratio to the total number of points and multiply it by the area of the rectangle. I just am not sure how to code it to perform those operations. I struggle with creating loops in maple. 

The Fitting Procedure

The data are T,CP,H and S. I need to determine a polynomial with seven Coefficients.

The essential input to the fitting procedure is a table of specific heat, enthalpy, and entropy as a function of temperature. 

The constrained linear least-squares fitting procedure is a three-stage process. The first step is to determine simultaneously a1, through a5 for temperature ranges by fitting the specific heats to Eq. (1).

 The second step is to determine a6 for temperature ranges by fitting the H data. In this state, a1-a5 are held fixed, and as in the cp fitting, equality constraints on the fit and its first derivative are imposed at the common temperature. Finally, the a7 coefficients are determined by fitting the entropy (S) data.

R=1.987

DATA.txt

FITTING.mw



Maple Worksheet - Error

Failed to load the worksheet /maplenet/convert/FITTING.mw .
 

Download FITTING.mw

I'd like to plot phase plot of 2 first order ode's (along with 2 eigenvectors on same plot).

When using DEtools:-dfieldplot, the labels on the axis are not at the end, so hard to see them. Along with all the arrows, they become even harder to see.

Is it possible to have these labels (y,x) be at the ends of the axis so they are more easily seen? Here is an example below.

restart;
ode:=[diff(x(t),t) = 2*x(t)-y(t), diff(y(t),t) = 3*x(t)-2*y(t)]:
p1:=DEtools:-dfieldplot(ode,[x(t),y(t)],t=-2..2,x=-4..4, y=-4..4,arrows=SLIM,color=coral):
p2:=plot(3*x,x=-4..4,y=-4..4,color=magenta):
p3:=plot(x,x=-4..4,y=-4..4,color=blue):
plots:-display([p1,p2,p3]);

I looked at help, plot options, but do not see how to do it so far. I can change the font of the label and the font size, but I want to change the location to be at the end.

Maple 2020.1

 

Hi,

I try to build a trigonometric circle with particular values Pi/6,Pi/4,Pi/3, but I find that the coordplot command with its options do not react .

Ideas ? Thanks

CercletrigonométriqueMaple.mw

In the following code, I want the base of the logarithm in the label to appear at the conventional position not beside the logarithm. How can I achieve this? Thank you all in anticipation of your educative response and do stay safe.

restart;

B:=<<39,76,151,301,601>|<7.71E-8,5.43E-9,3.55E-10,2.11E-11,1.32E-12>|
	<26,51,101,201,401>|<6.46E-3,1.17E-4,1.88E-6,2.96E-8,4.46E-10>|
	<26,51,101,201,401>|<2.74E-4,6.34E-6,1.16E-7,1.85E-9,2.92E-11>|
	<26,51,101,201,401>|<6.48E-4,4.39E-5,2.99E-6,1.88E-7,1.18E-8>>:

for i from 1 to 5 do
   B[i, 2] := log[10](B[i, 2]):		  			
   B[i, 4] := log[10](B[i, 4]): 		
   B[i, 6] := log[10](B[i, 6]): 		
   B[i, 8] := log[10](B[i, 8]):	
       

   
end do:  # computing the log of the max-error
B: # This is the table of values we'll plot.

T:=plot([B[..,[1, 2]],B[1..1,[1, 2]], B[.., [3, 4]],B[1..1,[3, 4]], 
	 B[..,[5, 6]],B[1..1,[5, 6]],B[.., [7, 8]],B[1..1,[7, 8]]], 
	legend = ["","BFFM","", "BHT","", "BHTRKNM", "", "BNM"],
	#title="Efficiency Curve for Example 1",
	style = ["pointline","point","pointline","point","pointline","point","pointline","point"], 
	symbolsize = 15,axes = framed, 
	symbol = [box,box, circle,circle,diamond,diamond,solidcircle, solidcircle],
	color=[red, red, blue,blue, black, black, green, green], 
	axis = [gridlines = [colour = green, majorlines = 1,linestyle = dot]], 
	labels = ["NFE", "log[10](Max Err)"]);

 

Hello Everyone,

First off, thank you all for your help previously, it helped me a lot!
Today, I am struggling with another small question and I wonder if there is an easy way to do it:

I am working on a problem where I have to vary values of a 4x4 Matrix until its determinant becomes zero (and the answer to the linear equations system is no longer the trivial one...)
All values depend on a single value (kx) that I can iteratively change to get it where it needs to be.

Now I would start to write a while-loop where it would change the value according to the determinant, incl. sign changes etc.
Before I get into this, I was wondering if maybe Maple has some sort of Built-In Function that could do this for me. 
(I could not find anything via the Maple Help/Google, so I thought I could ask.)

Best Regards,
Lennart
 

Got here a  function g(y,z) and if the partial directive with respect to y is 0 , then  there is left over a function h(z)
Can this ber proven in Maple, can't figure it out by reasoning. 
Perhaps a geometrical explanation makes more sense ?  

I'm using Maple 2020 in Linux (Ubuntu 20.04). The screen resolution is 2560×1440, so I have system-wide setting of 200% scaling for all apps, but unfortunately Maple doesn't adopt the system setting and UI elements are tiny. To make it tolerable, in "Tools - Options - Interface", I've set Default Zoom to be 200% and checked the box "Large toolbar icons". However, menus (File, Edit, View etc.) and dialog boxes are still tiny.

Am I right that the Maple GUI is written in Java / Swing? I've heard that Java 9 has better support for high dpi scaling. Does the default Maple installation use Java 9?

I am porting some code I have  from Mathematica to Maple. 

In Mathematica, there is a command https://reference.wolfram.com/language/ref/CopyDirectory.html  which copies directory tree (i.e. the directory and everything below it) to a new location on the file system.

I looked at FileTools, and the Copy command there only works on files, not Directories.

"An exception is raised if source is a directory."

There must be a command in Maple to do this basic operation, but I am not able to find it. I googled.

Note: I do not want to rename the directory, but to copy it.

I could ofcourse work around this by writing code or calling system, but I would expect Maple to have a command for this somewhere.

 

 

First 370 371 372 373 374 375 376 Last Page 372 of 2097