## XMLTools / generate XMLElement with strings...

Is it possible to generate a XMLElement by using part of the code to be generated with a string, or are the only methods a strict use of AddAttribute and AddChild?

Hope the code below explains what I mean. The first line is a strict copy of a declaration in the help file.

The question is if I could use some part of the definition which is saved in the str variable and combine it into the first declaration?

 (1)

 (2)

## Show all multipermutations....

Is there a command that can show me all multipermutations?

If I have a set (1,2,3) I want an output of all the multipermutations of length n.

For example for n=2:
[1,1],[1,2],[1,3],[2,1],[2,2],[2,3],[3,1],[3,2],[3,3].

I suspect I have to use the Iteration command MultiPartition, but I don't understand the examples given on maplesoft:
https://www.maplesoft.com/support/help/Maple/view.aspx?path=Iterator%2FMultiPartition

## How to verify if two vectors (with parameters) are...

Dear all,

In some step of my program, Maple cannot understand that the two following vectors are equal:

V1 := Vector[column](8, [1, 2, 2, 1, 3, A, B, 1/(A + B)^2]);

V2 := Vector[column](8, [1, 2, 2, 1, 3, A, B, 1/(A^2 + 2*A*B + B^2)]);

I tried to use the following two commands:

LinearAlgebra:-Equal(V1[6 .. 8], V2[6 .. 8]);

verify(V1, V2, 'Vector(expand)');

but Maple still returns 'false' instead of 'true'

Could somebody help me please ?
Best regards,

## question on setting type of parameter of proc...

I'd like to define a proc, which takes first argument to be either an ode (i.e. type =) or set of ode's, or list of ode's.

However, I do not know how to tell Maple that the list or set, if that is the type, to be a list of = and no other type.

Here is what I tried to make it more clear

If I do this

restart;

interface(warnlevel=4);
kernelopts('assertlevel'=2):

foo:=proc(ode::{=, set,list},func::function,$) print("ode=",ode); print("func=",func); end proc:  Then Maple will check that the first argument is ANY one of =, set or list. But does not check if the list or set contains only equations of type =. So I am able to call the above like this ode1:=diff(y(x),x)=1: ode2:=diff(y(x),x)=x: foo(ode1,y(x)); #this is OK foo([ode1,a],y(x)) #this is wrong  Which is wrong, since a is not of type =. Next I tried this (I also wanted to check that if first argument is list or set, that it is not empty, so added extra check) restart; interface(warnlevel=4); kernelopts('assertlevel'=2): foo:=proc(ode::{=, And(set,satisfies(x-> (numelems(x)<>0 and type(x,=)) )), And(list,satisfies(x-> (numelems(x)<>0 and type(x,=)) )) }, func::function,$
)

print("ode=",ode);
print("func=",func);
end proc;

But the above gives an error

ode1:=diff(y(x),x)=1:
ode2:=diff(y(x),x)=x:

foo([ode1,a],y(x))


I also tried

foo:=proc(ode::{=,
And(set,satisfies(x-> type(x,=)  )),
And(list,satisfies(x-> type(x,=) ))
},
func::function,$) print("ode=",ode); print("func=",func); end proc; Also gives erorr when called foo([ode1,ode2],y(x))  Ofcourse, I can just leave the check as in first case above, and in the proc itself, do the check myself manually by going over each entry in the list or set to make sure each entry is of type =. But I wanted Maple to do this work for me, if possible. What is the correct syntax for doing so? Maple 2020.2 ## Why does RootOf rename its bound variable, yet sim... Asked by: [Perhaps this should be a Post rather than a Question.] As far as I can tell, RootOf is the only Maple command that takes a bound variable on input and returns an unevaluated form with the bound variable renamed (to _Z). Why is that? Either all should do it (definite integrals, limit, sum, etc.) or none should. Pros: Making a substitution for a variable that occurs both free and bound in the same expression is a major source of programming error. Renaming bound variables helps to ameliorate that. Cons: The unexpected appearance of _Z in their results seems to be a great source of confusion to new users. However, if more commands did this, perhaps it would be more expected. Feel free to start a brainstorming discussion on this, as if it were a Post, even if you don't have a direct Answer for the Question. If that's the way that the thread heads, I'll change it to a Post. ## Document block issue... Asked by: Hi, I'm experiencing something quite annoying. When copying Maple input code from an executable block into a document block, just after a line of text was written. So for example <CTRL+T><write some text><CLICK ENTER FOR \newline><CTRL+M><PASTE MAPLE INPUT 1D CODE><CLICK ENTER> The block doesn't get executed. I don't see the blue Maple output. Why is that? Is this a bug or I'm I doing something wrong. Normally logic would dictate after pressing enter it would execute the 1D code and simply show the blue output just below the 1D one-liner? ## Another question: scientific notation... Asked by: Another question: I want to write the values of function g(x,t) as scientific notation. I mean I want to write 1.95*10^(-3) instead of 0.001953125 etc. Yes, by clicking right-click and clicking the numeric formatting, I can transform all columns of Array A, but I want to transform just the last column g(x,t) in Array A. restart: f:=(x,t)->x*t; g:=(x,t)->x^2*t;interface(rtablesize=20): A:=Array( [ [x,t,f(x,t), g(x,t)], seq ( seq ( [i, j, f(i,j), g(i,j)], j=0.125..0.875, 0.25 ), i=0.125..0.875, 0.25 ) ] );  ## How do I plot3d of ODE solutions ... Asked by: lambda:=0.1:N:=5:M:=sqrt(N(N+1)):omegap:=10:phi:=0: var:={n(t),u(t)}: dsys:={diff(n(t),t)=-2*(n(t)-N)+(u(t)-abs(M)*exp(I*phi))*exp(-2*I*omegap*t/lambda)+conjugate((u(t)-abs(M)*exp(I*phi))*exp(-2*I*omegap*t/lambda)),diff(u(t),t)=-2*(1-I*delta)*u(t)+2*(n(t)-N)*exp(-2*I*omegap*t/lambda)+2*abs(M)*exp(I*phi)}: res1:=dsolve(dsys union {n(0)=0,u(0)=0},numeric,output=listprocedure): # (this command need to be changed) P1:=plots[odeplot3](res1,[[t,(n(t))]],0..10,axes=boxed,tickmarks = [3, 2], color = black, thickness = 4, linestyle = solid, titlefont = [Helvetica, roman, 18], labeldirections = [horizontal, vertical], labelfont = [Helvetica, roman, 24]); ## table membership... Asked by: The member command allows testing, if a value is in a table. But is it possible to check if the index is used, not the value?  (1)  (2)  (3) Download list.mw ## How do I solve in Maple... Asked by: ## Solve a System of Equations With an Unknowns of f(... Asked by: I am trying to plot generator reactive output (Q) over a range of generator power output (P) with field current (Ifldc) and terminal voltage (Et) constant using “solve”. The system of equations includes an interpolating fiction Ifld(el). I’m looking for some help as to how to configure a solution. Attached are a few of my failed attempts. The upload of my file deleats the "solve" fo my first try it is: - Synchronous reactance of d-axis, Unsatuarted - Synchronous reactance of q-axis, Unsatuarted - leakage reactance d or q-axis Open Ckt Sat Curve DS807-1a First col=Ifld amps Second col= el voltage behind leakage reactance Plot OC saturation with field current in pu iterpolate values of field current vs el from OC sat curve Ifield as a function of el -> Solve for Q with TRY1 Eq4:= Eq7:= TRY 2  (1) TRY3 Download Qcalc1.mw ## How to find the real solution where two curves in... Asked by: I have two functions, and . Based the plot, I can see that they intersect around x equals 0, 1, around 4.5 and 10. So I tried to find the numerical solution by solving for x assuming x is real. I'm stuck here because the aswer involves RootOf and _Z and I don't know what to do next. This is what I've tried so far:  (1)  (2)  (3)  (4) Download intersect_curve.mw I know there's an answer to this because I can get the expected answer from Wolfram Alpha (see here). How can I accomplish this in Maple? ## Typesetting in plots ... Asked by: Hello everyone, I would like to know if it is possible to directly enter LateX expressions into the plot command. My goal is to be able to create a plot where the font style (in for example the title) can switch between LateX math and LateX regular. See the following example. The LateX input used for the tilte was <Verl{\"a}ufe von$e(t)$und$\dot{\varepsilon}_\mathrm{p}(t)\$>

In Matlab one can use the command <"interpreter","Latex"> which allows direct LateX input. I am basically looking for an equvialent Maple command.

If no such command exists, I would be grateful for any idea on how to create a title like the one above with other methods.

## Creating good tables in Maple...

What is your choice for creating a good table?

For example;

f:=(x,t)->x*t;
g:=(x,t)->x^2*t;


How to create a table as follows? (Appearance similar to the following is not required. I am open to all options)

## How do I plot a combination of variables using pha...

Hi, I am doing a project about three body problem. I am solving a DE system with 12 DEs and plotting it with phase portrait. It is all good if I am only using vars in scene. like this:

pp1 := phaseportrait([eq1(t), eq2(t), eq3(t), eq4(t), eq5(t), eq6(t), eq7(t), eq8(t), eq9(t), eq10(t), eq11(t), eq12(t)], [x1(t), y1(t), vx1(t), vy1(t), x2(t), y2(t), vx2(t), vy2(t), x3(t), y3(t), vx3(t), vy3(t)], t = 0 .. 8.75*10^7, [[x1(0) = X1, y1(0) = Y1, vx1(0) = VX1, vy1(0) = VY1, x2(0) = X2, y2(0) = Y2, vx2(0) = VX2, vy2(0) = VY2, x3(0) = X3, y3(0) = Y3, vx3(0) = VX3, vy3(0) = VY3]], scene = [x1(t), y1(t)], stepsize = 1000, x1 = 0 .. 10^6, y1 = 0 .. 6*10^6, color = [red], scaling = constrained):

But I cannot plot any combinations of my variables. I have orthogonalized all the velocity, and I can plot [t,vx(t)] or [t, vy(t)]. But I cannot plot [t, (vx(t)^2+vy(t)^2)^1/2]:

vel1 := phaseportrait([eq1(t), eq2(t), eq3(t), eq4(t), eq5(t), eq6(t), eq7(t), eq8(t), eq9(t), eq10(t), eq11(t), eq12(t)], [x1(t), y1(t), vx1(t), vy1(t), x2(t), y2(t), vx2(t), vy2(t), x3(t), y3(t), vx3(t), vy3(t)], t = 0 .. 3.5*10^7, [[x1(0) = X1, y1(0) = Y1, vx1(0) = VX1, vy1(0) = VY1, x2(0) = X2, y2(0) = Y2, vx2(0) = VX2, vy2(0) = VY2, x3(0) = X3, y3(0) = Y3, vx3(0) = VX3, vy3(0) = VY3]], scene = [t, (vx3(t)^2 + vy3(t)^2)^(1/2)], stepsize = 1000, linecolor = [purple], scaling = constrained);
Error, (in DEtools/phaseportrait) Invalid scene; must be list of vars: scene = [t, (vx3(t)^2+vy3(t)^2)^(1/2)]

Is there a way to let me plot the v(t) ?

 First 21 22 23 24 25 26 27 Last Page 23 of 1777
﻿