## How do I plot a histogram with a labelled legend i...

I upgraded to Maple 2022 and some of my old sheets from Maple 2021 don't work anymore. When I plot a histogram with a legend I get an error saying: Error, invalid input: Statistics:-Histogram expects value for keyword parameter legend to be of type list, but received data set 1.

OK so maybe Histogram changed in 2022 although I didn't think it did. I ran it in Maple 2021 and I received no such error message. I chose to comply with the error message and the plot is output without an error message, however the legend labels carry extra characters I don't want to be there.  My attempt at a solution was to first use square brackets to make the object a list, then use the typeset command to typeset the label.  Strangely, the typeset command was not recognized.

What am I doing wrong? All I want is to plot a histogram with a legend labelled by a string which I have done many times in the past. I have attached below, a maplesheet which explicitly shows the problematic behaviour.

Thanks,
N

Define Random Variable

 (1)

Sample that variable and plot a histogram.

Maple 2022 as opposed to Maple 2021 does not consider this a valid way to define the legend. It want's it defined in a list as requested in the pink error message.

Maple 2022 as opposed to Maple 2021 does not consider this a valid way to define the legend. It works fine in Maple 2021. Maple 2022, want's it defined in a list. This works but, the square brackets and quotation marks appear when I don't want them to. The legend shouldn't have these extra quotations and brackets, just the desired name.

I tried the typeset command. It doesn't seem to be recognized anymore.

What am I doing wrong? All I want is to plot a histogram with a legend labelled by a string.

## dsolve for system of 3 real eqs returns solution w...

I want to solve a system of 3 simple real linear odinary differential equations.

The solution using dsolve has some extra imaginary terms with very small (10^-10) coefficients.   How to I get just the real part of the solution.

Here is an example code:

v1 := 1;
v2 := 0.5;
k := 0.12;
p1 := 0.328;
p2 := 0.74;
l1 := 0.31;
l2 := 1.16;
sysode := diff(Cp(t), t) = -(p1 + p2 + k)*Cp(t) + l1*C1(t) + l2*C2(t), diff(C1(t), t) = (p1*Cp(t) - l1*C1(t))/v1, diff(C2(t), t) = (p2*Cp(t) - l2*C2(t))/v2;
ics := Cp(0) = 0.347, C1(0) = 0., C2(0) = 0.;
sol := convert(dsolve([sysode, ics]), float);

## The method of simple iterations...

Hello everybody!! Can you please help me figure it out. I wrote the code, but for some reason I have an infinite loop going on, it counts normally to the cycle, as the cycle reaches, then everything is infinite

```restart;
with(plots):
f:=unapply(2*x-4*cos(x)-0.6,x); #the equation itself
f1:=unapply(diff(f(x),x),x); #its derivative
a:=-0.5; b:=1.5; eps:=0.001: #interval and accuracy

phi:=unapply((4*cos(x)-0.6)/2,x); #solving the equation with respect to x
x[0]:=1; #I take any point from the interval
x[1]:=evalf(phi(x[0]));
L:=evalf(abs(phi(b)-phi(a))/abs(b-a));
L1:=evalf(abs(phi(x[1])-phi(x[0]))/abs(x[1]-x[0]));
psi:=unapply(abs(diff(phi(x),x)),x);
plot([psi(x),1],x=a..b,color=[red,green]);

n:=1:
while abs(evalf(x[n]-x[n-1])) > eps do
n:=n+1:
x[n]:=evalf(phi(x[n-1]));
od;
fsolve(f(x)=0,x=a..b);```

## Help with assumptions and complex numbers...

I'm trying to solve a coupled inductor problem.  All I'm trying to do is solve for the currents (which I could do), then solve for resonance by setting the imaginary part of I1 to 0 and solving for omega.  I then want to plug this resonant frequency back into I1 and evaluate it for some component values and coupling coefficient.

The problem is that even though I define the various variables as real,  Maple doesn't seem to recognize them as such.  I suspect I've failed to define one of them, and that is why it is responding like it is, but I can't find it.

I'm also getting some weird behavior.....for example if I type :  wres0, I get the value I assigned to it --that's fine.  But then, when I type : wres0/(2*pi), I get an error, "Error, unable to parse 'mverbatim"   --- what does this mean?

This should be a pretty straight forward calculation on Maple, but at this point, I think I may be better off doing it by hand!  I appreciate any help you can provide.  Thank you.

## Counting how many polynomials are in specific Galo...

Hello :)

So what I was trying to find Galois group for quartic polynomials in a form f=x^+a_3*x^3+a_2*x^2+a_1*x+a_0, where 0<=a_i<=2 and a_0 <>0. I get polynomials and galois groups - that's not an issue. Lets say I specifically need polynomials with group D_4 so I run script

restart;
A := {seq(0 .. 2)};
A0 := A minus {0};
m := numelems(A)^3*(numelems(A) - 1);
a := Iterator:-CartesianProduct(A0, A \$ 3);
s := seq(x^4 + add(v[i]*x^(i - 1), i = 1 .. 4), v = a);
for k to m do
if irreduc(s[k]) = 'true' then print(f[k] = s[k], galois(s[k])); end if end do;

This one gives all list of polynomalias and their galois group.

for k to m do
if irreduc(s[k]) = 'true' then if galois(s[k]) = ("4T3", {"D(4)"}, "-", 8, {"(1 3)", "(1 2 3 4)"}) then print(f[k] = s[k], galois(s[k])); end if; end if;
end do;

This one gives me a list of D_4 specifically.
When 0<=a_i<=2 - there are not many polynomials so I cant count it by hand, but if I make a sequence larger there are too many polynomials to count them manually. So the question is how to count how many polynomials there are with a group D_4? Or lets say how do I count how many polynomials are in each group?
Thank you

## voltage-current-voltage circuit ...

v2i2v_circuit.msim

I try to design a circuit to make a voltage-current-voltage translation. In my assumption, probe1.v is equal to probe2.v and it will generate a current(probe2.v / R4) through NMOS. The NMOS acts as a closed switch. Probe3.v is equal to CV3 and i can get "Probe4.v = CV1 + CV3". However, when the circuit operates, probe3.v isn't equal to CV3 and probe1.v isn't equal to probe2.v. I have tried to rise the differential input resistance and differential amplifier to make the Uin+ close to Uin- in op amp, but it doesn"t work effectively.
In addition, the closed resisitance of NMOS is also taken into consideration and i try to make it pretty below Kohm.

Could you help me fix the problem?

Please help me solve the following problem about complex numbers with Maple: w= (3+zi)/(2+z) whose geometric representation in the "oxy" plane is a straight line. Calculate module of z. Thank you so much.

## How to produce a graph of a numbers sequence...

Hi,

I have a code (see below) for the following number sequence and want to produce a graph as well as the numerical data, please advise how to do it.

Sequence definition: Lexicographicaly least sequence of nonnegative integers commencing 1,3,5,7 such that any four  consecutive terms are mutually coprime.

The code I have so far is:

ina := proc (n) false end :

a := proc (n) option remember; local k;

if n < 5 then k := 2*n-1

else for k from 2 while ina(k) or igcd(k, a(n-1)) <> 1 or igcd(k, a(n-2)) <> 1 or igcd(k, a(n-3)) <> 1

do  od

fi; ina(k) := true; k

end proc;

seq(a(n), n = 1 .. 100);
1, 3, 5, 7, 2, 9, 11, 13, 4, 15, 17, 19, 8, 21, 23, 25, 16, 27,

29, 31, 10, 33, 37, 41, 14, 39, 43, 47, 20, 49, 51, 53, 22, 35,

57, 59, 26, 55, 61, 63, 32, 65, 67, 69, 28, 71, 73, 45, 34, 77,

79, 75, 38, 83, 89, 81, 40, 91, 97, 87, 44, 85, 101, 93, 46,

95, 103, 99, 52, 107, 109, 105, 58, 113, 121, 111, 50, 119,

127, 117, 62, 115, 131, 123, 56, 125, 137, 129, 64, 133, 139,

135, 68, 143, 149, 141, 70, 151, 157, 153

I have tried listplot but for some reason cant get the correct format

Hope you can help

Best regards

David.

## non linear system of equation...

eqs.mw

 (1)

 (2)

 (3)

 (4)

 (5)

 (6)

 (7)

 (8)

 (9)

 (10)

 (11)

 (12)

 >
 (13)
 >
 >
 (14)

 >
 (15)
 >

#im tryin to solve 9 equation having 9 varibales but the fsolve doesnt solve for C1 to R4, what i am doing wrong??

## How to generate a sequence with double variables?...

I am working on a sequence: seq([seq([a[i,j],b[?]],i=1..3)], j=1..3)], it has in total 9 output of a such as a[1,1],a[2,1],a[3,1],a[1,2],a[2,2],a[3,2],a[1,3],a[2,3],a[3,3], yet I need to the output of b like b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9]. I have tried to put something like seq([seq([a[i,j],b[f]],i=1..3,f=1..9)] j=1..3)] but it does not work...

Could someone help me?

Greatly appreciated!

## Cauchy criteria Power series...

Dear all

I have a power series, the genral term contains sign(sin(n)),
everything is well defined, but when I apply summation to the general term, i can not see sign(sin(n)), its dropped.. why

and how deduce the the limit to get the radius of convergence

Cauchy_criteria.mw

thank you for any help

## dsolve return nothing...

Hello,

I'm trying to solve a differential equation with boundary conditions using dsolve. However dsolve return nothing. Any help to understand what's happening?

Thank you!

Here's my code:

eq1:=diff(psi(s),s,s)=t*sin(psi(s))-r*cos(psi(s));
eq2:=diff(x(s),s)=cos(psi(s));
eq3:=diff(y(s),s)=sin(psi(s));

cond1:=x(0)=0;
cond2:=x(1)=d+1;
cond3:=y(0)=0;
cond4:=psi(0)=0;
cond5:=D(psi)(0)=0;
cond6:= y(1)=0;

dsolve({eq1,eq2,eq3,cond1,cond2,cond3,cond4,cond5,cond6});

## Radius of convergence power series ...

Dear all

I  compute the radius of convergence of power series using maple,

but the code does not give any result

thank you for any help

## Two questions regarding a sliding ladder...

This worksheet animates part of the motion of the classic ladder sliding down a wall.

Respondents will need to establish their own link to the DirectSearch package