Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

Hey, 

I run into the same issue quite often. Let's say I have some polynomial over variable like this

H = (s-z0)/((s-p0)*(s-p1))

I do a substitution on s and get something quite messy as a result. Example:

H = ((z-1)/(T*z)-z0)/(((z-1)/(T*z)-p0)*((z-1)/(T*z)-p1))



Now I would like to get the polynomial in the same pole / zero form. I'm sure maple is capable of doing this but I have no clue where to click. Is there an easy way to bring a polynomial over some variable in a standarized form?

Cheers!


 

``

restart

``

f := proc (x, z) options operator, arrow; ln(x^z) end proc;

proc (x, z) options operator, arrow; ln(x^z) end proc

(1)

``

``

``

simplify(f(x, 2), ln);

ln(x^2)

(2)

simplify(f(x, 1/2+I*y), ln);

ln(x^(-((1/2)*I)*(I-2*y)))

(3)

``


 

Download simplln.mw

 

with(CodeGeneration)

ua=[ 1 2 3 4];

Matlab(ua);

 

%How can i write the Output of "Matlab(ua)"  on file so I can use the Matlab "load" command
later on to get the result in Matlab?  

 

 

For my own use, I am attempting to port Joe Riel’s glyph package for geometric algebra into a module more compatible with recent versions of Maple. To this end, I have been testing individual procedures extracted from the package into Maple 2016, both to understand the algorithms and to check for glitches caused by the code running in more current Maple 2016. The procedure for carrying out the exterior multiplication of blades does not seem to work reliably, and I haven’t the necessary knowledge of Maple language to determine whether this is due to an error on my part or a feature of Maple V that no longer works.  I have attached a worksheet,tablemultiplyexample.mw,  that includes the procedures necessary for the multiplication routine to work, but I can’t get any consistency in the results.  Can anyone advise me what is the problem?  

As I understand the routine, setup defines a anti-symmetric root blade table with an indexing function that precludes assignment to the table. Clifford blades are then represented as indexed variables using the root table. The process is as follows see worksheet for actual code):

initialize := proc ()
 global _e, tableroot;
tableroot := table(antisymmetric, blade);
tableroot[] := 1;
_e := tableroot;
end proc:
#The index function `blade` is as follows:

`index/blade` := proc (Indices, tableau)
 if nargs = 2 then if Indices = [] then 1
          else tableau[op(checkindices(Indices))] end if
elif Indices = [] then tableau[Indices[]] := 1
 else ERROR("cannot assign to a blade", Indices) end if
end proc;

#Exterior multiplication is performed by the following routine.
b_exteriorp := proc (u, v)
option remember;
 if  u = 1 or v = 1 then u*v
else _e[op(u), op(v)] end if
end proc:

As near as I understand, the procedure joins the lists representing the two input blade into a single list that is processed by the antisymmetric indexing function and outputs the indexes as the product blade. I don’t understand how the case of duplicate indexes (which should return 0) is supposed to be handled by the procedure.  What the procedure usually returns is simply the appended list of the two blades without modification by the indexing function.

Can anyone give me a hint about how to fix this procedure?

tablemultiplyexample.mw

I am trying to input data via a data table. Have several problems here.

I used an array because I want the row and column numbers to start at 0.

1st When the table appers after that the document runs hediously slow as in a second or two to enter a digit or letters appear after typing.  Like something is absorbing the computer resources. But I have a fast machine.

2nd Any data I  enter to the table vanishes but does get stored.

3rd I tried to turn it all into a procedure but cant get that to work.
 

restart

with(DocumentTools:-Components)

[Button, CheckBox, CodeEditRegion, ComboBox, DataTable, Dial, Label, ListBox, MathContainer, Meter, Microphone, Plot, RadioButton, RotaryGauge, Shortcut, Slider, Speaker, State, TextArea, ToggleButton, VideoPlayer, VolumeGauge]

(1)

with(DocumentTools:-Layout)

[Cell, Column, DocumentBlock, Equation, Font, Group, Image, InlinePlot, Input, Output, Row, Section, Table, Textfield, Title, Worksheet]

(2)

with(DocumentTools)

[AddIcon, AddPalette, AddPaletteEntry, Components, ContentToString, CreateTask, Do, GetDocumentProperty, GetProperty, InsertContent, InsertTask, Layout, RemovePalette, RemovePaletteEntry, RemoveTask, Retrieve, RunWorksheet, SetDocumentProperty, SetProperty, Tabulate]

(3)

ary := Array(0 .. 3, 0 .. 3)

Array(%id = 18446746457454449478)

(4)

``

 

 

``

DT := DataTable(identity = "DataTable0", variable = 'ary', rowheader, columnheader, columnnames = [beta^0, beta, beta^2, beta^3], rownames = [alpha^0, alpha, alpha^2, alpha^3])

xml := Worksheet(Group(Input(Textfield(DT))))

DocumentTools:-InsertContent(xml)

PN1 := copy(ary, 0 .. (), 0 .. ())

Array(%id = 18446746457454471998)

(5)

Matrix(PN1)

Matrix(%id = 18446746457454477550)

(6)

PN1[0, 0]

6

(7)

BiPolyNum := proc (a := 4, b := 4) local ary, DT; description "Creates Bi Polynumbers"; ary := Array(0 .. a, 0 .. b); DT := DataTable(identity = "DataTable0", variable = 'ary', rowheader, columnheader, columnnames = [1, beta, beta^2, beta^3], rownames = [1, alpha, alpha^2, alpha^3]); DocumentTools:-InsertContent(xml); return copy(ary) end proc

proc (a := 4, b := 4) local ary, DT; description "Creates Bi Polynumbers"; ary := Array(0 .. a, 0 .. b); DT := DocumentTools:-Components:-DataTable(identity = "DataTable0", variable = 'ary', rowheader, columnheader, columnnames = [1, beta, beta^2, beta^3], rownames = [1, alpha, alpha^2, alpha^3]); DocumentTools:-InsertContent(xml); return copy(ary) end proc

(8)

``

``

f := BiPolyNum()

Array(%id = 18446746457454464046)

(9)

f

Array(%id = 18446746457454464046)

(10)

Matrix(f)

Matrix(%id = 18446746457454466582)

(11)

``


 

Download DataTable_Experiment.mw

Hi all,

 

I have a bunch of polynomials in q that involve unknown roots of unity and I want to bound them above by another polynomial.

For example: f(q):=q3-a*q2+b*q2-5.

Here a and b are powers of some roots of unity. These roots/powers depend on some variables which are unimportant.

My incorrect method up until now was to let all root of unity equal 1 so they vanish, and then run a short script that finds all coefficients of the poly f and makes them positive. 

But in this case it returns an answer of q^3+5 as the quadratic terms vanish - I don;t want this to happen! I really want the bound q3+2*q2+5.

If I run the script that changes the coefficients first, then maple can't  recognise if -a is positive or negative and so this doesn't work. If it helps this is it:

f:=g[i,j]; 
coffs:=[];
for m from 0 to degree(f) do
   coffs:=[op(coffs), abs(coeff(f,q,m))] end do;
fabs:=0;
for m from 1 to degree(f,q)+1 do
   fabs:=fabs+coffs[m]*q^(m-1) end do;
      g[i,j]:=fabs end do;
                     end do;
Any ideas would be great. Thanks!

 

EDIT: to perhaps make it clearer. The kind of roots of unity i'm dealing with are things like z2*j*k+q*k+(1/2)*l where z is a (q-1)th root of unity, and j,k,l are unknown integer variables. 

Hi everybody,

I use dsolve(..., numeric, events =[...], parameters = [...], range=0..TMAX) to solve a parameterized system of 2 ODEs (unknowns x(t) and v(t)).

The solution over the whole range [0, TMAX] is constructed by assembling partial solutions over adjacent subranges of [0, TMAX].

(please look the attached file and feel free to contact me if you need more details than those given below

There exist two types of solution :

  • Type 1 : trivial solution : for all t in some range [a>=0, b<= TMAX], the solution is x(t)=0 and v(t)=0
  • Type 2 : for all t in some range [b>=0, c<= TMAX] {x(t), v(t)} is the solution of the differential system


The end of the simulation corresponds :

  • either to t=TMAX
  • either to x(t) = CMAX where CMAX is some predefined value for x(t)
     

I use events to manage the two following situations 

  • x(t) = CMAX
  • x(t) = 0 and v(t) < 0 : this is the situation which describes the transition between Type 2 solutution and Type 1 solution


The global solution is constructed by assembling partial solutions over subranges [0, b[1]], [b[1], b[2]], [b[2], b[3]] ... where type 1 solutions "live" in [b[n], b[n+1]] if n is odd and type 2 solutions in  [b[n], b[n+1]] if  n is even.
 
The assembly of the partial solutions doesn't work correctly : I identified the reason but I'm not capable to fix it.
If you look to the red instructions on yellow background you will see they do not return the same answer than the pink instructions (look to the blue outputs over the plot) . 

This is probably due to a very big mistake on my part  but I can't fix it !

Once again, if my explanations are not sufficient or if I'm not enough clear, feel free to ask me any questions you need.

Thanks in advance

 

ParametricDsolve.mw

 



 

Why is maple showing 1D math when evaluating?

Dear sir,

 

I request to provide the procedure to evaluate the following double integral in steps. Please find the enclosed attachment

 

 

I wanted to calculate the bessel function's limit, but there is no results.


 

NULLNULLwith(MTM):

constants := s

s

(1)

eq1 := `assuming`([limit(MTM:-bessely(1, -I*r*sqrt(s)), infinity)], [s > 0])

BesselY(1, -(infinity*I)*s^(1/2))

(2)

eq2 := eval(eq1)

BesselY(1, -(infinity*I)*s^(1/2))

(3)

eq3 := `assuming`([limit(MTM:-bessely(1, -I*r), infinity)], [s > 0])

BesselY(1, -infinity*I)

(4)

eq4 := eval(eq3)

BesselY(1, -infinity*I)

(5)

eq5 := `assuming`([limit(beselj(1, -I*r*sqrt(s)), infinity)], [s > 0])

beselj(1, -(infinity*I)*s^(1/2))

(6)

eq6 := eval(eq5)

beselj(1, -(infinity*I)*s^(1/2))

(7)

eq7 := `assuming`([limit(MTM:-besselj(1, -I*r), infinity)], [s > 0])

-I*BesselI(1, infinity)

(8)

``

``


 

Download test.mw

Below is my attempt to distinguish between add vs sum commands.  In principle, the sum command is symbolic.  I attempt the comparison in general, but get an error for the add command.  This error appears to occur if I do not assign numeric values to the general variables in the function.  I would like to execute the comparison symbolically.  Can this be done or does add only execute numerical evaluations?

Download sum_vs_add.mw

sum_vs_add.mw

How can I find the next number in the following set of numbers?

3,10,2,7,7,?

 

Thank you for your help!

How do I extract harmonics and plot a spectrum from a piecewise function?
 

The function is "Ia" shown below near the bottom in the "Plot Line Current" section.


 

NULLNULL

NULL

Parm_List := [Erms = 70.7, L = 0.4e-2, alpha = .524, omega = 2*Pi*60, R = 5, Idc = 22.3, mu = .5490]

[Erms = 70.7, L = 0.4e-2, alpha = .524, omega = 120*Pi, R = 5, Idc = 22.3, mu = .5490]

(1)

NULL

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

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

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 

with(plots)

PlotVpn := plot(subs(Vrms = 100, [Va, Vb, Vc]), theta = -(1/2)*Pi .. 3*Pi)

PlotVpp := plot(subs(Vrms = 100, [Vab, Vbc, Vca]), theta = -(1/2)*Pi .. 3*Pi, linestyle = dot, thickness = 1)``

display({PlotVpn, PlotVpp})

 

 

 

 

NULL

NULL

 

plot(subs(Vrms = 100, [Va, Vb, Vc, Vab, Vbc, Vca]), theta = -(1/2)*Pi .. 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

(2)

 

   

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

(3)

    

 

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

 

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)

(4)

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

(5)

"(=)"

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

(6)

"(=)"

`&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

(7)

"(=)"

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

(8)

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

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

(9)

"(=)"

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

(10)

NULL

DC output voltage

NULL

V__D = Vdc-`&Delta;E__Avg`

V__D = Vdc-`&Delta;E__Avg`

(11)

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

(12)

"(->)"

 

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

(13)

 

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

(14)

"(=)"

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

(15)

"(=)"

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

(16)

``

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

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

(17)

"(->)"

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

(18)

"(->)"

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

(19)

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)*2^(1/2)*Erms*3^(1/2)*(cos(alpha)+cos(alpha+mu))/Pi)

V__D = (3/2)*2^(1/2)*Erms*3^(1/2)*(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

(20)

"->"

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

(21)

NULL

NULL

``

 

 

 

 

``

NULL

 

``

``

``

``

``

``

``

``

Line Currents

  

``

NULL NULL

 

 

Commutation Intervals

   

``

Plot Line Currents

 

NULL

Ia := piecewise((-Pi)*(1/6)+alpha < theta and theta <= (-Pi)*(1/6)+alpha+mu, Ia__Int1, (-Pi)*(1/6)+alpha+mu <= theta and theta <= (1/6)*Pi+alpha, Ia__Int2, (1/6)*Pi+alpha < theta and theta <= (1/6)*Pi+alpha+mu, Ia__Int3, (1/6)*Pi+alpha+mu < theta and theta <= (1/2)*Pi+alpha, Ia__Int4, (1/2)*Pi+alpha < theta and theta <= (1/2)*Pi+alpha+mu, Ia__Int5, (1/2)*Pi+alpha+mu < theta and theta <= 5*Pi*(1/6)+alpha, Ia__Int6, 5*Pi*(1/6)+alpha < theta and theta <= 5*Pi*(1/6)+alpha+mu, Ia__Int7, 5*Pi*(1/6)+alpha+mu < theta and theta <= 7*Pi*(1/6)+alpha, Ia__Int8, 7*Pi*(1/6)+alpha < theta and theta <= 7*Pi*(1/6)+alpha+mu, Ia__Int9, 7*Pi*(1/6)+alpha+mu < theta and theta <= 3*Pi*(1/2)+alpha, Ia__Int10, 3*Pi*(1/2)+alpha < theta and theta <= 3*Pi*(1/2)+alpha+mu, Ia__Int11, 3*Pi*(1/2)+alpha+mu < theta and theta <= 11*Pi*(1/6)+alpha, Ia__Int12, 11*Pi*(1/6)+alpha < theta and theta <= 11*Pi*(1/6)+alpha+mu, Ia__Int13)                Ib := piecewise((-Pi)*(1/6)+alpha < theta and theta <= (-Pi)*(1/6)+alpha+mu, Ib__Int1, (-Pi)*(1/6)+alpha+mu <= theta and theta <= (1/6)*Pi+alpha, Ib__Int2, (1/6)*Pi+alpha < theta and theta <= (1/6)*Pi+alpha+mu, Ib__Int3, (1/6)*Pi+alpha+mu < theta and theta <= (1/2)*Pi+alpha, Ib__Int4, (1/2)*Pi+alpha < theta and theta <= (1/2)*Pi+alpha+mu, Ib__Int5, (1/2)*Pi+alpha+mu < theta and theta <= 5*Pi*(1/6)+alpha, Ib__Int6, 5*Pi*(1/6)+alpha < theta and theta <= 5*Pi*(1/6)+alpha+mu, Ib__Int7, 5*Pi*(1/6)+alpha+mu < theta and theta <= 7*Pi*(1/6)+alpha, Ib__Int8, 7*Pi*(1/6)+alpha < theta and theta <= 7*Pi*(1/6)+alpha+mu, Ib__Int9, 7*Pi*(1/6)+alpha+mu < theta and theta <= 3*Pi*(1/2)+alpha, Ib__Int10, 3*Pi*(1/2)+alpha < theta and theta <= 3*Pi*(1/2)+alpha+mu, Ib__Int11, 3*Pi*(1/2)+alpha+mu < theta and theta <= 11*Pi*(1/6)+alpha, Ib__Int12, 11*Pi*(1/6)+alpha < theta and theta <= 11*Pi*(1/6)+alpha+mu, Ib__Int13)

 

NULL

NULL

IaPlot := plot(subs([Erms = 70.7, L = 0.4e-2, alpha = .524, omega = 2*Pi*60, R = 5, Idc = 22.3, mu = .5490], Ia), theta = -(1/6)*Pi .. 3*Pi)

 

IbPlot := plot(subs([Erms = 70.7, L = 0.4e-2, alpha = .524, omega = 2*Pi*60, R = 5, Idc = 22.3, mu = .5490], Ib), theta = -(1/6)*Pi .. 3*Pi)

NULLNULL

NULL

NULL

NULL

NULL

``

``

``

Line Rms Current

   

``

with(OrthogonalSeries)

``

NULL

``

NULL

``

NULL

``

NULL

``

NULL

``

NULL

``

NULL

``


 

Download Graetz_Bridg7b.mw

Hello all, 

How to animate a set of vectors?

for example, 

q:=Matrix(3,10,(i,j)->i^2+j+2*i); # some matrix which holds the 3x1 vectors. 

with(plots):

animate(arrow,[q(..,i)],i = 1..10);

I get an error 

Error, unsupported type of index, i

In real use, the input to 'arrow' function will be a vector valued function so the 'animate' command will show the resulting vectors. 

 

thanks.

 

EngM.


 

Hello All, 

I am trying to solve a nonlinear equation as a part of inverse kinematic for a robot tip. 

The robot is mostly redundant, and thus, the optimization package is the best to use. 

I looked the NLPSolve function in matrix form. 

the equation(s) am trying to solve is of the following format

Tip - Desired = 0 

Tip is a 6x1 vector and is a function (or expression) of q1 ..., qn number of joints. 

Desired is 6x1 numerical values representing the desired Tip position and orientation. 

for example, for a planar robot with only x,y coordinates

<cos(q[1])*cos(q[3])-sin(q[1])*sin(q[3])+sin(q[1])*q[2]+cos(q[1]), sin(q[1])*cos(q[3])+cos(q[1])*sin(q[3])-cos(q[1])*q[2]+sin(q[1])> - <1,1> = 0

I am a bit confused on how to use the NPLSolve command in matrix form. 

I understand that I need to formulate a procedure p(v) where v is a vector (here it will be v := <q[1], .., q[n]> ) , however, I am not solving one objective function rather 6 of them for 6-degrees of freedom. 

I tried something like

p:=proc(q)
    <cos(q[1])*cos(q[3])-sin(q[1])*sin(q[3])+sin(q[1])*q[2]+cos(q[1]) - 1,sin(q[1])*cos(q[3])+cos(q[1])*sin(q[3])-cos(q[1])*q[2]+sin(q[1]) -1>;
    end proc;
    Optimization[NLPSolve](3,p,initialpoint = evalf(q_start),maximize = false)
where q_start is 3x1 vector giving the initial point. 

but I always get 

Error, (in Optimization:-NLPSolve) non-numeric result encountered

 

How can I solve for set of equations?

thanks.

EngM

First 847 848 849 850 851 852 853 Last Page 849 of 2216