MaplePrimes Questions

I want to plot contour for piecewise  function , here is my code

with(plots):
d1:=0.1:eta:=0.01:k:=2:L:=1:
mu:=0.01:delta1:=0.1:delta2:=0.2:
d1:=0.2:d2:=0.2:L1:=0.2: L2:=0.2:
h:=z->piecewise( z<=d1,    1,
                 z<=d1+L1,   1-(delta1/(2))*(1 + cos(2*(Pi/L1)*(z - d1 - L1/2))), 
                        z<=d1+L1+d2,  1 ,          
                    z<=d1+L1+d2+L2,  1-(delta2/(2))*(1 + cos(2*(Pi/L2)*(z - d1 - d2-L1-L2/2))),
                 z<=L,    1):
A1:=((k+2)*(k+3)*(1-mu)^(k+1)-2*(1-mu)^(k+2)*(k+2+mu))^(1/k):
A2:=(A1*r/h(z)^(1+3/k)):
contourplot(A2,z=0..1,r=-h(z)..h(z),colour=black,axes=boxed);

Hi,

I have a function f(x) = x/2 on Cartesian coordinates. I want to rotate the y-axis clockwise and x-axis anticlockwise by the

same (arbitrary, acute) angle (something like the 2nd figure of http://www.ams.org/publicoutreach/feature-column/fcarc-svd),

yet I also want to retain the Cartesian grid and the function f(x) at the background. 

Could someone tell me how to do so? Thanks!

Hi,

I am writing a simple program on Maple with the command :

som:=0;

for a from 3000 to 5000 by 100 do

for b from 100 to 1000 by 100 do

for c from 3000 to 3000 by 100 do

for d from 1000 to 1000 by 100 do

for e from 1000 to 10000 by 1000 do

for f from 200 to 2000 by 100 do

for p from 1 to 10 by 1 do

tot:=0;

 

C2:=c*d-N^2*(f^2-b*d);

C3:=a*d-e*f;

C4:=c*e-N^2*(a*f-e*b);

 

if (C2>0 and C3>0 and C4>0)

then

print(a,b,c,d,e,f,p);

som:=som+1;

fi;

od;od;od;od;od;od;od;

som;

 

That gives me the error messsage: Error, numeric exception: division by zero

Is there a simple way to say to the program to continue to execute even it falls at some point to « bad » parameter constellations with division by zero ?

Thank you for your help !

Best regards,

Basak

Hello people in mapleprimes,

I am reading Introduction to Maple. There, the following input and output appear.

> convert((-8)^(1/3), RootOf);
1+RootOf(_Z^2 + 3, index = 1)

I think, which implies

beta^3+8=0

and

with the solution alpha of alpha^2+3=0, beta above is expressed as 1+alpha.

But, probably from my understanding being wrong, I can't understand why this becomes so.

So, though this is about mathematics, not about maple, if possible, can I ask you to teach me why

convert((-8)^(1/3), RootOf) brings 1+RootOf(_Z^2 + 3, index = 1)?

Thanks in advance.

 

I have upgraded my monitor  to a 4K monitor. I know how to enlarge the fonts in work-sheets and thow to increase the icons size. Is it possible to  alsoincrease the font size in the side and horizontal bars? They are ridicously small. The zoom factor facility in Tools-> Options does noit work, May this is has to be done  by some guid setting. I w\ould appreciate any help.

Thank you

Fernando

eq := r(t) = 2*t^2*_i+16*_j+(10*t-12)*_k

 

I want the speed of the above position equation but I keep getting the error message "Error, invalid input: rhs received 2*t^2*_i+16*_j+(10*t-12)*_k, which is not valid for its 1st argument, expr"

 

I'm using Norm(rhs(eq));#Calculate Norm

 

I can't figure out what I'm doing wrong...

 

I am attempting to write a series representation of a general integral of a function from a to b as follows:

int(f(x), x = a..b)= h*sum((c_k)*f(a+kh))+O(h^p),k=1..N;

where h:=(b-a)/(N+1), p(N) is greater than or equal to N + 1 and c_k are coefficients.  I then need to write procedures with Maple to evalue c_k from 1,..,N and also to evaluate P(N) for any N.  If I take the case for N = 3 and N = 6 I have to use those procedures to prove that:

int(f(x), x = a..b)=(4h/3)*(2*f_1 - f_2 +2*f_3) + O(h^5) = (7*h/1440)*(611*(f_1 + f_6) - 453*(f_2 + f_5) + 562*(f_3 + f_4)) + O(h^7) 

where f_k = f(a + kh).  I am really at a loss as to how to write this procedure, although I may have used something similar before:

P:=proc(p) add((1/k^(1/10))*(sin(1/k)-1/k), k=1..10^p) end proc;
seq( evalhf(P(p)), p = 1 .. 5 );
 

 

My equation is r(t) = 3 cos(5 t)i + sin(5 t)j +3 sin(5 t)k

I think Maple is assuming that i, j, and k are variables... how do I get it to recognize them correctly?  Then, how do I plot this without changing the format of my equation?

hi . i want to get d^2 z[1] and d^2z[2] but this method give only dz[1] and dz[2] ....

 

restart;
q1 := 9045*(diff(z[1](t), t$2))+863728.*z[1](t) = -1963*sin(20*t);
q2 := 3454*(diff(z[2](t), t$2))+2^6*z[2](t) = -286*sin(20*t);
icy := seq([z[i](0) = 0, (D(z[i]))(0) = 0], i = 1 .. 2, 1);
so := dsolve({q1, q2, seq(icy[i][], i = 1 .. 2)}, numeric, method = classical[abmoulton], corrections = 2);
so(1);
[t = 1., z[1](t) = 0.114730517257337e-2, diff(z[1](t), t) = 0.192255592847066e-1, z[2](t) = -0.186463122818374e-3, diff(z[2](t), t) = 0.320601041204689e-2]

If w := proc (x, y) options operator, arrow; piecewise(y <= .5, -2*tanh*(y-.25), .5 < y, 2*tanh*(.75-y)) end proc

how can print w(x,y) as matrix x=0..10,y=0..10?

I have a 2 dimensional array with variable length. I want to extract the number of elements of each row. For example What is the number of element in x(1,i)?

How do I format the output from a Fit?

X := [seq(0.1e-1*i, i = 0 .. 12)]; Y := [0, .36, .56, .67, .73, .76, .78, .79, .79, .80, .80, .80, .80]; with(Statistics); f := Fit(a-b*exp(c*x+d), X, Y, x, initialvalues = [a = .8, b = 1, c = -50, d = -.3]); plot({f(x), [seq([X[i], Y[i]], i = 1 .. 13)]}, x = 0 .. .15, color = blue, gridlines = true, style = [line, point], size = [600, 400]);
[0., 0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10,
  0.11, 0.12]
[0, 0.36, 0.56, 0.67, 0.73, 0.76, 0.78, 0.79, 0.79, 0.80, 0.80,
  0.80, 0.80]
  HFloat(0.8011387332253399) - HFloat(1.0911958098409642) exp(
  -HFloat(60.057427500589974) x - HFloat(0.30834993559916535))

 

There are way too many decimals in the output 

The questions are in the initial documentation of Maple code below.  Again any help gratefully received.

 

 

restart:

# # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Question 1: on use of op.  In the program there are two similar lists
# LC_L and LC_L2, one using square brackets; the second round.   Can I use the op operator using round brackets?
#
# Question 2: The proc maximum is not producing any output.  What is nargs referring to?

# Why?  This proc I found in the Maple 7 documentation so why
# does it not give output?
#
# Functional operators.  Use of ->

# to find coords of rotated points.  No questions here – I
# intend using this on the letter A program in a recent post of # mine
#

# # # # # # # # # # # # # # # # # # # # # # # # # # # # #

with(plots):

with(plottools):

h:=6*sqrt(3):b:=6:w:=3:

#List of coord for letter L.  Two ways of writing:

# with square or round bracket

LC_L:=[[0,0],[0,h],[w,h],[w,w],[b,w],[b,0]]:

LC_L2:=[(0,0),(0,h),(w,h),(w,w),(b,w),(b,0)]:

endfor:=nops(LC_L):

for i from 1 to endfor do

printf("LC_L   Coord %d is (%5.3f , %5.3f) \n",i, LC_L[i][1], LC_L[i][2]);

printf("LC_L2  Coord %d is (%5.3f , %5.3f)\n\n",i,op(LC_L2[i][1]), op(LC_L2[i][2]));

#op(1,op(2,w))

end do;

 

l:=[6,9,4,1]:  #this list was added in by me

maximum := proc (l)  # ()  the l was added by me

 local r, i;

          r := args[1];

          for i from 2 to nargs do

              if args[i] > r then r := args[i] end if

          end do;

          #printf("  %d\n",r);

          r

end proc:

#eval();

maximum(l);
 

Hello,

can someone help me with the following problem?

Ich want to delete rows and columns at the same time in a matrix. So this I wrote a little proc:

B:=proc(a,b)
DeleteColumn(A,a)
DeleteRow(A,b)
end proc;

The problem is, that only the last order is working. -> 

DeleteRow

Thanks
Martin


 

``Can anyone explain why 'subs' will sbstitute 'a' and 'c' but not 'b' (equations 2.3 and 2.4) in the attached document. 

 

``I have tried everything I can think of but nothing works.

 

If I cut and paste 2.3 and 2.4 to a clean document it works.  I tried coying the whole document t a clean sheet but that does not fix the problem. 

NULLNULL

NULL

Va := sqrt(2)*Vrms*sin(theta)Vmax =  RmsMS phase to neutral voltage

Vb := sqrt(2)*Vrms*sin(theta-2*Pi*(1/3))

Vc := sqrt(2)*Vrms*sin(theta+2*Pi*(1/3))

Vab := Va-Vb

Vbc := Vb-Vc

Vca := Vc-Va

NULL

com1 := rhs(simplify(solve({Vc = Va, 0 < theta and theta < Pi}, theta, allsolutions))[1]) = (1/6)*PiNULL

com2 := rhs(simplify(solve({Vb = Vc, 0 < theta and theta < Pi}, theta, allsolutions))[1]) = (1/2)*PiNULL

com3 := rhs(simplify(solve({Va = Vb, 0 < theta and theta < Pi}, theta, allsolutions))[1]) = (5/6)*PiNULL

com4 := rhs(simplify(solve({Va = Vc, Pi < theta and theta < 2*Pi}, theta, allsolutions))[1]) = (7/6)*Pi 

com5 := rhs(simplify(solve({Vb = Vc, Pi < theta and theta < 2*Pi}, theta, allsolutions))[1]) = (3/2)*Pi 

com6 := rhs(simplify(solve({Va = Vb, Pi < theta and theta < 2*Pi}, theta, allsolutions))[1]) = (11/6)*PiNULL

NULL  NULL 

NULL

NULL

NULL``

NULL

NULL

NULL

 

plot(subs(Vrms = 100, [Va, Vb, Vc, Vab, Vbc, Vca]), theta = 0 .. 3*Pi)

 

 

 

 

The  #1 diode is forward biased and switches on when Va>Vc (Va=Vc). The voltage VD will be equal to Va-Vb until diode #2 turns on when Vc< Vb. Then VD will equal Vc-Vc.

The switching angle for the diodes is given above. If phase control is used all commutation is delayed by the angle α.

NULL``

Without phase delay the average (DC) voltage applied to the laod is the average value of the 6 commutation periods over one cycle:

 

NULL

NULL

Van := sqrt(2)*Erms*sin(theta)Emax =  RmsMS phase to neutral voltage

Vbn := sqrt(2)*Erms*sin(theta-2*Pi*(1/3))

Vcn := sqrt(2)*Erms*sin(theta+2*Pi*(1/3))

NULL

   
Eq1 := Vdo = 6*(int(Van-Vbn, theta = com1 .. com2))/(2*Pi)

Vdo = 3*3^(1/2)*2^(1/2)*Erms/Pi

(1)

 

   

NULL

Eq2 := Vdc = 6*(int(Van-Vbn, theta = com1+alpha .. com2+alpha))/(2*Pi)

Vdc = 3*2^(1/2)*Erms*3^(1/2)*cos(alpha)/Pi

(2)

    

 

Commutation

The switching between diodes can not occur instantaneously because the supply circuit is inductive. Current can not change instantaneously in and inductive circuit.
The transfer of load current from the out-going phase to the incomming phase is accomplshed by a period of symultaneous conduction of the two adjacent diodes the creation of a circulating current between these two phases that resembles short circuit between the two phases.

The circulating current produces equal voltage drop with opposid polarities in each phase. In the out-going phase the drop adds to the soruce voltage and in the incomming phase the drop subtracts from the source voltage. Only the drop in the incomming phase effects the DC output voltage.

NULL

 

 

 

During commutation intervil com1 to com2 phases a and c are shorted while Id is transfered from phase c to phase a. During this time voltage Va-Vb minus the voltage drop in a phase caused by the commutation. This voltage drop is 1/2 the Vac voltage.   

`&Delta;e` := 1/2*(Van-Vcn)

(1/2)*2^(1/2)*Erms*sin(theta)-(1/2)*2^(1/2)*Erms*cos(theta+(1/6)*Pi)

(3)

and      Va=Vc at π/6

`&Delta;E__Avg` = 6*(int(`&Delta;e`, theta = (1/6)*Pi+alpha .. (1/6)*Pi+alpha+mu))/(2*Pi)

`&Delta;E__Avg` = 3*((1/2)*2^(1/2)*Erms*cos((1/6)*Pi+alpha)+(1/2)*2^(1/2)*Erms*sin((1/3)*Pi+alpha)-(1/2)*2^(1/2)*Erms*sin((1/3)*Pi+alpha+mu)-(1/2)*2^(1/2)*Erms*cos((1/6)*Pi+alpha+mu))/Pi

(4)

"(=)"

`&Delta;E__Avg` = (3/2)*Erms*2^(1/2)*(cos((1/6)*Pi+alpha)+sin((1/3)*Pi+alpha)-sin((1/3)*Pi+alpha+mu)-cos((1/6)*Pi+alpha+mu))/Pi

(5)

"(=)"

`&Delta;E__Avg` = (3/2)*2^(1/2)*Erms*3^(1/2)*cos(alpha)/Pi-(3/2)*Erms*2^(1/2)*3^(1/2)*cos(alpha)*cos(mu)/Pi+(3/2)*Erms*2^(1/2)*3^(1/2)*sin(alpha)*sin(mu)/Pi

(6)

"(=)"

`&Delta;E__Avg` = (3/2)*Erms*2^(1/2)*3^(1/2)*((-cos(mu)+1)*cos(alpha)+sin(alpha)*sin(mu))/Pi

(7)

combine(`&Delta;E__Avg` = (3/2)*Erms*2^(1/2)*3^(1/2)*((-cos(mu)+1)*cos(alpha)+sin(alpha)*sin(mu))/Pi, trig)

`&Delta;E__Avg` = (1/2)*(-3*3^(1/2)*2^(1/2)*Erms*cos(alpha+mu)+3*2^(1/2)*Erms*3^(1/2)*cos(alpha))/Pi

(8)

"(=)"

`&Delta;E__Avg` = -(3/2)*3^(1/2)*2^(1/2)*Erms*(cos(alpha+mu)-cos(alpha))/Pi

(9)

NULL

DC output voltage

NULL

V__D = Vdc-`&Delta;E__Avg`

V__D = Vdc-`&Delta;E__Avg`

(10)

subs([Vdc = 3*2^(1/2)*Erms*3^(1/2)*cos(alpha)/Pi, `&Delta;E__Avg` = -(3/2)*3^(1/2)*2^(1/2)*Erms*(cos(alpha+mu)-cos(alpha))/Pi], V__D = Vdc-`&Delta;E__Avg`)

 

V__D = 3*2^(1/2)*Erms*3^(1/2)*cos(alpha)/Pi+(3/2)*3^(1/2)*2^(1/2)*Erms*(cos(alpha+mu)-cos(alpha))/Pi

(11)

"(->)"

 

V__D = (3/2)*3^(1/2)*2^(1/2)*Erms*(cos(alpha)+cos(alpha+mu))/Pi

(12)

 

NULL

Equating the intigral of the voltage drop between the phase A and C  to the intigral of the voltage rise across the two phase inductances (thes intigrals represent eqivalent flux).

 

int(Van-Vcn, theta = (1/6)*Pi+alpha .. (1/6)*Pi+alpha+mu) = int(2*L*omega, theta = 0 .. Id)

2^(1/2)*Erms*cos((1/6)*Pi+alpha)+2^(1/2)*Erms*sin((1/3)*Pi+alpha)-2^(1/2)*Erms*cos((1/6)*Pi+alpha+mu)-2^(1/2)*Erms*sin((1/3)*Pi+alpha+mu) = 2*L*omega*Id

(13)

"(=)"

2^(1/2)*Erms*3^(1/2)*cos(alpha)-Erms*2^(1/2)*3^(1/2)*cos(alpha)*cos(mu)+Erms*2^(1/2)*3^(1/2)*sin(alpha)*sin(mu) = 2*L*omega*Id

(14)

"(=)"

-Erms*3^(1/2)*2^(1/2)*((cos(mu)-1)*cos(alpha)-sin(alpha)*sin(mu)) = 2*L*omega*Id

(15)

``

combine(-Erms*3^(1/2)*2^(1/2)*((cos(mu)-1)*cos(alpha)-sin(alpha)*sin(mu)) = 2*L*omega*Id, trig)

-3^(1/2)*2^(1/2)*Erms*cos(alpha+mu)+2^(1/2)*Erms*3^(1/2)*cos(alpha) = 2*L*omega*Id

(16)

"(->)"

cos(alpha+mu) = -(1/6)*(2*L*omega*Id-2^(1/2)*Erms*3^(1/2)*cos(alpha))*3^(1/2)*2^(1/2)/Erms

(17)

"(->)"

cos(alpha+mu) = -(1/3)*3^(1/2)*2^(1/2)*L*omega*Id/Erms+cos(alpha)

(18)

NULL``

``

``

NULL

subs(cos(alpha+mu) = -(1/6)*(2*L*omega*Id-2^(1/2)*Erms*3^(1/2)*cos(alpha))*3^(1/2)*2^(1/2)/Erms, V__D = (3/2)*3^(1/2)*2^(1/2)*Erms*(cos(alpha)+cos(alpha+mu))/Pi)

V__D = (3/2)*3^(1/2)*2^(1/2)*Erms*(cos(alpha)-(1/6)*(2*L*omega*Id-2^(1/2)*Erms*3^(1/2)*cos(alpha))*3^(1/2)*2^(1/2)/Erms)/Pi

(19)

"->"

V__D = 3*2^(1/2)*Erms*3^(1/2)*cos(alpha)/Pi-3*L*omega*Id/Pi

(20)

NULL

NULL

``

 

 

 

 

``

NULL

 

``

``

``

``

``

``

``

``

Line Currents

  

``

NULL

NULL

 

A phase current intervals

   

NULL

NULL

RMS Current Line

 

Using*A*Phase*current

Using*A*Phase*current

(2.1)

NULL

I__RMS = sqrt(A/Pi)

I__RMS = (A/Pi)^(1/2)

(2.2)

``

A = rhs(A1 = -(3/16)*Erms^2*((-8*cos(mu)*sin(mu)-8*mu+16*sin(mu))*cos(alpha)^2-8*sin(alpha)*(cos(mu)-1)^2*cos(alpha)+4*cos(mu)*sin(mu)-4*mu)/(L^2*omega^2))+rhs(A2 = Idc^2*((2/3)*Pi-mu))+rhs(A3 = (1/4)*(6*(cos(mu)*sin(mu)-2*sin(mu)+mu)*cos(alpha)^2+6*sin(alpha)*(cos(mu)-1)^2*cos(alpha)-3*cos(mu)*sin(mu)+3*mu)*Erms^2/(L^2*omega^2)+Idc*((sin(mu)-mu)*cos(alpha)+sin(alpha)*(cos(mu)-1))*3^(1/2)*2^(1/2)*Erms/(L*omega)+Idc^2*mu)

A = -(3/16)*Erms^2*((-8*cos(mu)*sin(mu)-8*mu+16*sin(mu))*cos(alpha)^2-8*sin(alpha)*(cos(mu)-1)^2*cos(alpha)+4*cos(mu)*sin(mu)-4*mu)/(L^2*omega^2)+Idc^2*((2/3)*Pi-mu)+(1/4)*(6*(cos(mu)*sin(mu)-2*sin(mu)+mu)*cos(alpha)^2+6*sin(alpha)*(cos(mu)-1)^2*cos(alpha)-3*cos(mu)*sin(mu)+3*mu)*Erms^2/(L^2*omega^2)+Idc*((sin(mu)-mu)*cos(alpha)+sin(alpha)*(cos(mu)-1))*3^(1/2)*2^(1/2)*Erms/(L*omega)+Idc^2*mu

(2.3)

subs((-8*cos(mu)*sin(mu)-8*mu+16*sin(mu))*cos(alpha)^2-8*sin(alpha)*(cos(mu)-1)^2*cos(alpha)+4*cos(mu)*sin(mu)-4*mu = a, (6*(cos(mu)*sin(mu)-2*sin(mu)+mu))*cos(alpha)^2+6*sin(alpha)*(cos(mu)-1)^2*cos(alpha)-3*cos(mu)*sin(mu)+3*mu = b, (sin(mu)-mu)*cos(alpha)+sin(alpha)*(cos(mu)-1) = c, A = -(3/16)*Erms^2*((-8*cos(mu)*sin(mu)-8*mu+16*sin(mu))*cos(alpha)^2-8*sin(alpha)*(cos(mu)-1)^2*cos(alpha)+4*cos(mu)*sin(mu)-4*mu)/(L^2*omega^2)+Idc^2*((2/3)*Pi-mu)+(1/4)*(6*(cos(mu)*sin(mu)-2*sin(mu)+mu)*cos(alpha)^2+6*sin(alpha)*(cos(mu)-1)^2*cos(alpha)-3*cos(mu)*sin(mu)+3*mu)*Erms^2/(L^2*omega^2)+Idc*((sin(mu)-mu)*cos(alpha)+sin(alpha)*(cos(mu)-1))*3^(1/2)*2^(1/2)*Erms/(L*omega)+Idc^2*mu)

A = -(3/16)*Erms^2*a/(L^2*omega^2)+Idc^2*((2/3)*Pi-mu)+(1/4)*(6*(cos(mu)*sin(mu)-2*sin(mu)+mu)*cos(alpha)^2+6*sin(alpha)*(cos(mu)-1)^2*cos(alpha)-3*cos(mu)*sin(mu)+3*mu)*Erms^2/(L^2*omega^2)+Idc*c*3^(1/2)*2^(1/2)*Erms/(L*omega)+Idc^2*mu

(2.4)

``

``

``

``

``

``

``

``

``

``

``

``


 

Download subs_failed.mw

First 872 873 874 875 876 877 878 Last Page 874 of 2433