MaplePrimes Questions

Hey everyone!

I am trying to merge two vectors into a matrix. Let us say that both of the vectors has only one line and 4 columns:
A:=[a1,a2,a3];B:=[b1,b2,b3,b4];
Therefore, the matrix that I am trying to get should have this form:
M=Matrix([[a1,b1,0,0,0,0,0,0],[0,0,a2,b2,0,0,0,0],[0,0,0,0,a3,b3,0,0],[0,0,0,0,0,0,a4,b4]]);
Thanks in advance!

Hello! 

Assuming that I typed this:

a := -1 .. .1*cos(x), x = 0 .. 2*Pi

How do I get the range of values of a ?

Not this -1 .. .1*cos(x), x = 0 .. 2*Pi in return, but actual values ?

Thank you! 

Good day everyone, please I'm soliciting help on how to solve PDE in Maple. I know how to solve ODE but I don't know how to go about PDE. The problem I want to solve is attached as an attachment. If epsilon is zero, then the problem reduces to ODE which can easily be solved, but epsilon is not supposed to be zero. please I need your help, thank you in anticipation.

PDE.pdf

Is there any way to convert a variable name to a string?

In that example, the content of the variable is converted to string, not the name of the variable.


 

a := 2

2

(1)

convert(a, string)

"2"

(2)

NULL


 

Download convertstring.mw

Good Afternoon,

I'm relatively new to using Maple and I have encountered a problem that I don't seem to be able to figure out myself.

I am trying to calculate the determining equations, and subsequently the infinitesimals of an underdetermined set of PDE's. However, I keep getting the error message

"Error, (in PDEtools:-ToJet) incorrect use of the dependent variable name(s) [R, p, u, v, w], as indexed function names in: {w[](R[z]*v[y]+v[z]), w[](R[z]*w[y]+w[z])}"

restart;
with(PDEtools);
with(DEtools);
declare(u(y, z));
               u(y, z) will now be displayed as u

declare(v(y, z));
               v(y, z) will now be displayed as v

declare(w(y, z));
               w(y, z) will now be displayed as w

declare(p(y, z));
               p(y, z) will now be displayed as p

declare(R(z));
                R(z) will now be displayed as R

Conti := diff(u(y, z), y) + u(y, z)/(y - R(z)) + diff(w(y, z), z) + diff(R(z), z)*diff(w(y, z), y) = 0;
NSU := v(y, z)^2/(y - R(z)) - diff(p(y, z), y) = 0;
NSV := ((u(y, z)*diff(v(y, z), y) + u(y, z)*v(y, z)/(y - R(z)) + w(y, z)(diff(v(y, z), z) + diff(R(z), z)*diff(v(y, z), y))) + (-diff(v(y, z), y)/(y - R(z)) - diff(v(y, z), y, y) + v(y, z)/(y - R(z))^2)) + diff(R(z), z)*diff(w(y, z), y) = 0;
NSW := u(y, z)*diff(w(y, z), z) + w(y, z)(diff(w(y, z), z) + diff(R(z), z)*diff(w(y, z), y)) + diff(p(y, z), z) + diff(R(z), z)*diff(p(y, z), y) - diff(w(y, z), y)/(y - R(z)) - diff(w(y, z), y, y) - diff(R(z), z)*diff(w(y, z), y) = 0;
sys := [Conti, NSU, NSV, NSW];
deteqs := Infinitesimals(sys);
Error, (in PDEtools:-ToJet) incorrect use of the dependent variable name(s) [R, p, u, v, w], as indexed function names in: {w[](R[z]*v[y]+v[z]), w[](R[z]*w[y]+w[z])}

The Maple Worksheet is also provided below. All help is greatly appreciated.

Regards,

Johannes

Hi Everyone,

I would like to convert a netlist to a ladder schematic by using Draw (Syrup). So far I have tried combinations of &+ and &// and have not achieved the correct result. Please help.

capnet:= "
V  1 0 1
L  1 2 1
C1 2 3 2uF 
C2 2 4 3uF
C3 4 3 1uF
C4 4 5 1.5uF
C5 3 5 2.5uF
C6 3 0 3.5uF
C7 5 0 0.5uF
.end":

ckt:= [ V(1), L(1), C1(2.8E-6),
         C2(3.E-6),  C3(1.E-6),
         C4(1.5E-6), C5(2.5E-6) &+ C6(3.5E-6)
        ]:
Draw(ckt);

Thanks.

SyrupQuestion.mw

Hi

I am trying to use Explore command to model the CSA  of a trough.

So I want to  be able to change the variables: length of the walls (l:, slider 0..20) and the width (w:slider 0..20) and the angle (theta: slider 0..Pi/2)

Want to be able to see the diagram change and also display the area using the formula [output (15)] on the graph

Here is my attempt.

trough.mw

In the attached, I had to find the required coefficient. Now this has a relatively straight forward set of equation (which apparently form a closed group), so it was easy enough tee see what to do. In a more complicated situation that may be very difficult to see. I was a wondering is there is a better approach to use here?
 

restart

Prove/show the coefficient of c[0] in c[1]^11 is 1/12*(1-1/5^10)NULL

eq1 := c[1]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

c[1]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

(1)

eq2 := c[1]*c[2] = (2/5)*c[1]+(2/5)*c[2]+(1/5)*c[3]

c[1]*c[2] = (2/5)*c[1]+(2/5)*c[2]+(1/5)*c[3]

(2)

eq3 := c[1]*c[3] = c[2]

c[1]*c[3] = c[2]

(3)

eq4 := c[2]*c[3] = c[1]

c[2]*c[3] = c[1]

(4)

eq5 := c[2]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

c[2]^2 = (1/5)*c[0]+(2/5)*c[1]+(2/5)*c[2]

(5)

eq6 := c[3]^2 = c[0]

c[3]^2 = c[0]

(6)

 

expand(eq1^5)

c[1]^10 = (1/3125)*c[0]^5+(32/3125)*c[1]^5+(32/3125)*c[2]^5+(16/625)*c[0]*c[1]^4+(16/625)*c[0]*c[2]^4+(2/625)*c[0]^4*c[1]+(2/625)*c[0]^4*c[2]+(8/625)*c[0]^3*c[1]^2+(8/625)*c[0]^3*c[2]^2+(16/625)*c[0]^2*c[1]^3+(16/625)*c[0]^2*c[2]^3+(32/625)*c[1]*c[2]^4+(32/625)*c[1]^4*c[2]+(64/625)*c[1]^3*c[2]^2+(64/625)*c[1]^2*c[2]^3+(64/625)*c[0]*c[1]^3*c[2]+(96/625)*c[0]*c[1]^2*c[2]^2+(64/625)*c[0]*c[1]*c[2]^3+(16/625)*c[0]^3*c[1]*c[2]+(48/625)*c[0]^2*c[1]^2*c[2]+(48/625)*c[0]^2*c[1]*c[2]^2

(7)

C111 := lhs(%)*c[1] = expand(rhs(%)*c[2]*c[3])

c[1]^11 = (1/3125)*c[2]*c[3]*c[0]^5+(32/3125)*c[2]*c[3]*c[1]^5+(32/3125)*c[2]^6*c[3]+(16/625)*c[2]*c[3]*c[0]*c[1]^4+(16/625)*c[2]^5*c[3]*c[0]+(2/625)*c[2]*c[3]*c[0]^4*c[1]+(2/625)*c[2]^2*c[3]*c[0]^4+(8/625)*c[2]*c[3]*c[0]^3*c[1]^2+(8/625)*c[2]^3*c[3]*c[0]^3+(16/625)*c[2]*c[3]*c[0]^2*c[1]^3+(16/625)*c[2]^4*c[3]*c[0]^2+(32/625)*c[2]^5*c[3]*c[1]+(32/625)*c[2]^2*c[3]*c[1]^4+(64/625)*c[2]^3*c[3]*c[1]^3+(64/625)*c[2]^4*c[3]*c[1]^2+(64/625)*c[2]^2*c[3]*c[0]*c[1]^3+(96/625)*c[2]^3*c[3]*c[0]*c[1]^2+(64/625)*c[2]^4*c[3]*c[0]*c[1]+(16/625)*c[2]^2*c[3]*c[0]^3*c[1]+(48/625)*c[2]^2*c[3]*c[0]^2*c[1]^2+(48/625)*c[2]^3*c[3]*c[0]^2*c[1]

(8)

c[1]^11 = simplify(rhs(C111), [eq2, eq3, eq4, eq5, eq6])

c[1]^11 = (1/9765625)*(4070573*c[3]+4067448)*c[2]+(813802/9765625)*c[0]+(813802/9765625)*c[3]

(9)

coeff(rhs(%), c[0], 1)

813802/9765625

(10)

eval(1/12*(1-1/5^10))

813802/9765625

(11)

NULL


 

Download Graphs_steps.mw

The help page says that an option for int is continuous=truefalse. The help page reads

"Specifies whether int looks for discontinuities. " I interpret that as continuous=true means look for discontinuities

and false means do not look. A simple example, however, suggests that it is the opposite.

int(3/(5-4*cos(x)),x=0..2*Pi,continuous=true)=0

int(3/(5-4*cos(x)),x=0..2*Pi,continuous=false)=2*Pi.

I interpret this as continuous=true means "I guarantee the result is continuous, so do not look"

This would be a logical opposite to discont=true in the plot command: discont=true -> continuous=false!

Consider F := Int( 1/(1+x^n), x=0..1 ).  Once upon a time in Maple ("when tigers smoked pipes") I got it to tell me that F = hypergeom( [1,1/n], [1+1/n], -1 ).  This is true, compact, and very helpful.   n is a positive integer.

I don't seem to be able to do this any more; the combinations of Int, Sum, int, sum, convert/hypergeom, etc are not working for me. I am probably forgetting just which trick I used---I don't think that Maple's capabilities have changed, except that now sometimes I get a finite sum for the integral going from k=0 to k=floor(n/2) which I don't remember seeing before.

Any ideas?

When I use styles to select the code font it only changes the code font within a worksheet, but not the font in the code editor. Is there any way to change font size/type in the code editor? Thanks!

I just spend 2 hrs trying to make this work in headless worksheet, but it does not work. I have A worksheet, which calls B worksheet. The call all go through OK and I set it all correctly. Set up the section in worksheet B and document property, etc.. as described in help.

So the call works OK and arguments are passed correctly from A to B.

The problem is that in worksheet B, I wanted to generate a plot in order to save it to postscript file.  This did not work. Nothing gets exported, even  though the plot is actually generated correctly in B.  How do I know this? Becaue B returns the plot back to A, and I can see the plot was correctly generated.  The file .ps never gets created. I look at the folder these worksheets are in, and there is no .ps file created.

But it was not saved to .ps file.  The same code works ok in standard worksheet and plot is saved correctly to .ps file using same code.

I also could not export the plot to JPEG file from worksheet B.  Only thing that worked is exporting some text to .TXT file from B.  

Any one knows of limitation to calling one worksheet from another?  It seems somethings work in headless worksheet and some things do not. Which does not make it useful.

You might ask, why Am I doing this? Because I wanted to call that B worksheet later on (if it worked) from a script to do the plot exporting, as the quality is better when in a "worksheet" vs. command line).

But since this does not even work when calling the worksheet from another worksheet, then there is no point of trying it from the command line.

Attached A and B. To try it, please save both worksheets in same folder and simply open A.mw and run it. It will call B.mw  

This is the first time I used documentTools package. I did not even know one can call one worksheet from another before.

I suspect it had to do with print(); call becoming inactive in headless worksheet, which causes nothing to be send to the postscript file. But I am not sure. Without print(); one can't export the plot.

I do not understand why is it so hard in Maple to export a plot to a PDF. Why is there not a simple export command to export a plot to PDF like with all the other software out there in the world?  This is the year 2021, not 1980. How many decades does Maplesoft needs to implement export to PDF?

This is on windows 10. Maple 2021.1

This is A.mw
 

restart;

currentdir("C:\\tmp\\TEST_MAPLE");
p:=DocumentTools[RunWorksheet]( "B.mw" , [the_function=sin(x),the_variable=x]  ):
print("Back from calling worksheet B. Here is the result");
p;

"C:\tmp\TEST_MAPLE"

"Back from calling worksheet B. Here is the result"

 


 

This is B.mw
 


 

Inputs

 

the_function:=0;

the_variable:=0;


p:=plot(the_function,the_variable=-2*Pi..2*Pi):
full_file_name:=cat("C:\\tmp\\TEST_MAPLE\\tmp.ps");
plotsetup(ps,plotoutput=full_file_name):
print(p);
plotsetup(default):

return p;


 

Download B.mw

Download A.mw

Hello, ive got another question. Im in the last chapter of this book, and i hope i can finish the book this month. So i can start with part 2 of the series of applied math for higher job education. The first book is basically the freshmans year worth of math, and im completing it within 2 months. So im happy with that. :) 

Okey here is the question: 
a.
Draw half a circle x^2+y^2=4, with y >= (bigger or equal to) 0. 

So how do i make half a circle instead of the whole circle? 

The rest of the text says:
b.
Which body is created if the area bordered by the x-axis and this half circle is revolved around the x-axis?
c.
Calculate the volume of this body. 

Greetings,

The Function

smartplot(x^2+y^2 = 4)

 

``

Download Question_for_maple_primes_7.mw

restart;

Do you know why this plot is not complete (cut from -infinity to minus 2)? In Mathematica I haven't got that problem so I wonder what is wrong here.


with(plots);
plot((x^3 - 4*x^2 - 9*x + 36)/(x^3 - 9*x), color = red, discont = true, view = [-3 .. 3, -5 .. 5]);

First 244 245 246 247 248 249 250 Last Page 246 of 2308