## seq vs int in maple...

restart;

ii := 50;

seq(ii, ii = 0 .. 5);

evalf(int(ii, ii = 0 .. 5))

For sequence the syntax is correct i.e the output is 0,1,2,3,4,5. is ii inside sequence command takes the value 5 assigned it then changes when ii ranges from 0 to 5?

restart;

ii:=50:
seq(ii)

output: 50

restart;

ii:=50:

seq(seq(ii),ii=1..5)

obtained: 1,2,3,4,5

please explain how seq command works

## How to solve the following deq? Why the extra (t) ...

Trebuchet, Phase I, 2020-05-27 Ki restart; with(RealDomain); with(SolveTools); assume(h < r1); additionally(h < r2); [Im, Re, ^, arccos, arccosh, arccot, arccoth, arccsc, arccsch, arcsec, arcsech, arcsin, arcsinh, arctan, arctanh, cos, cosh, cot, coth, csc, csch, eval, exp, expand, limit, ln, log, sec, sech, signum, simplify, sin, sinh, solve, sqrt, surd, tan, tanh ] [AbstractRootOfSolution, Basis, CancelInverses, Combine, Complexity, Engine, GreaterComplexity, Identity, Inequality, Linear, Parametric, Polynomial, PolynomialSystem, RationalCoefficients, SemiAlgebraic, SortByComplexity] hz1 := g*(r3*m3*cos(phi1(t))-r1*m2*sin(phi2(t))/sin(phi2(t)-phi1(t)))/theta3; whattype(phi1(t)); whattype(phi2(t)); / r1 m2 sin(phi2(t)) \ g |r3 m3 cos(phi1(t)) + -----------------------| \ sin(-phi2(t) + phi1(t))/ hz1 := ------------------------------------------------ theta3 function function hz2 := phi1(t)+arcsin((h+r1*sin(phi1(t)))/r2); /h + r1 sin(phi1(t))\ hz2 := phi1(t) + arcsin|-------------------| \ r2 / subs(phi2 = hz2, hz1); / / | | 1 | | ------ |g |r3 m3 cos(phi1(t)) theta3 | | | | \ \ // /h + r1 sin(phi1(t))\\ \ \\ r1 m2 sin||phi1(t) + arcsin|-------------------||(t)| || \\ \ r2 // / || + ----------------------------------------------------------|| / / /h + r1 sin(phi1(t))\\ \|| sin|-|phi1(t) + arcsin|-------------------||(t) + phi1(t)||| \ \ \ r2 // /// deq := diff(phi1(t), t, t)-% = 0; / / / 2 \ | | | d | 1 | | deq := |---- phi1(t)| - ------ |g |r3 m3 cos(phi1(t)) | 2 | theta3 | | \ dt / | | \ \ / /h + r1 sin(phi1(t))\ \ \ r1 m2 sin|phi1(t)(t) + arcsin|-------------------|(t)| | \ \ r2 / / | + -----------------------------------------------------------| / /h + r1 sin(phi1(t))\ \| sin|-phi1(t)(t) - arcsin|-------------------|(t) + phi1(t)|| \ \ r2 / // \ | | | = 0 | | / ics := phi1(0) = -arcsin(h/r1), (D(phi1))(0) = 0; /h \ ics := phi1(0) = -arcsin|--|, D(phi1)(0) = 0 \r1/ dsolve({deq, ics}, phi1(t)); dsolve(deq); deq_numeric := subs(r1 = 8, r2 = 8, r3 = 1, h = 5, m2 = 1, m3 = 20, theta3 = 20, deq); / | / d / d \\ 1 | |--- |--- phi1(t)|| - -- g |20 cos(phi1(t)) \ dt \ dt // 20 | | \ / /5 \ \ \ 8 sin|phi1(t)(t) + arcsin|- + sin(phi1(t))|(t)| | \ \8 / / | + --------------------------------------------------------| = 0 / /5 \ \| sin|-phi1(t)(t) - arcsin|- + sin(phi1(t))|(t) + phi1(t)|| \ \8 / // ics_numeric := phi1(0) = 0, (D(phi1))(0) = -.63; ics_numeric := phi1(0) = 0, D(phi1)(0) = -0.63 hz1 := dsolve({ics, deq_numeric}, phi1(t), numeric); Error, (in dsolve/numeric/process_input) unknown arcsin(5/8+sin(phi1(t))) present in ODE system is not a specified dependent variable or evaluatable procedure sin(-phi1(t)-arcsin((h+r1*sin(phi1(t)))/r2)); / /h + r1 sin(phi1(t))\\ -sin|phi1(t) + arcsin|-------------------|| \ \ r2 //

## Integrating the exponential integral....

Hello everyone,

first, I'd like to mention that I am relatively new to Maple and am therefore thankful for any advice you might have!

I am trying to integrate the term (k_1^2 * r) from a to infinity, see the picture below as well as the attached file. Maple seems to have some issues with that. However, if I break the integral down into more manageable parts it suddenly works! Why is that? How can I get Maple to solve this immeadiately?  I suspect the culprit lies in the term that contains (-Ei(-B*r)*r^(-1)) where Ei is the exponential integral as defined in Maple. The resulting  hypergeometric function seems suspicious.

The problem is that I have to evaluate 21 integrals of this type (k_x*k_y*r) and breaking them down manually becomes pretty cumbersome, especially as the number of terms in the expanded expressions increases. Is there a way to automate this procedure? I guess I would need to extract individual terms and automatically plug them into the integral expression. That should the last resort, however.

The specific problem (everything included for context, weird stuff happens after equation 15):

Maple_Problem.mw

As for the variables: E, t, and R are real positive numbers. a and B are already assumed as real and positive. A_0, C_0, A_2, and C_2 are real numbers (could be negative, I do not know yet since they must be determined later on). a_0 is definitely real, but it may be negative. r is the polar coordinate, so it is also real and positive, but adding this assumption did not yield a better result.

## How to find an eqution of a line in complex...

conj := conjugate; d := a*x+b*y-c = 0; z := x+I*y; evalc(z+conj(z)); evalc(z-conj(z)); d := expand((1/2)*a*(z+conj(z))+b*(z-conj(z))/(2*I))-c; is(d = z(a-I*b)+conj(z)*(a+I*b)-2*c); varpi = a+I*b; is(d = z*conj(varpi)+conj(z)*varpi-2*c); How to perform calculations correctly ? Thank you.

## Solve equation with sin,cos ,ln and tan...

How to get the inflection points for this function.?

fprime_expr:=x^sin(x)*(cos(x)*ln(x)+sin(x)/x);

i tried symbolic and numeric , but no answer

for X:= solve( fprime_expr =0, x);

## Why does this piecewise function regularly return ...

Hello,

While working for an assignment I had to use a piecewise function which gives a result based on a randomly generated value. The following is a much simpler version of what I've been working on, but it gives the same error.

A random value is uniformly distributed between 0 and 100. The piecewise returns a 1 if the value is between 0 and 50 and it returns 2 if the value is between 50 and 100. As far as I understand this function should only ever give 1 or 2, never something else. However when I loop this a few times Maple regularly returns a 0, which doesn't make sense to me. I've printed the values that return a 0 but none of these should break the piecewise. Can someone please explain to me what's going wrong here and how to fix it?

My code:

restart; randir := piecewise(0 <= r1() and r1() < 50, 1, 50 <= r1() and r1() < 100, 2);
for i to 1000 do r1 := rand(0. .. 100.0); if randir = 0 then print(fail[i], r1()) end if end do;

I've included a failure check to see when and at what values it returns a 0, and as you can see it happens very often.

## How to plot with string values?...

I'm trying to create a graph using a matrix that has numbers and text values, how can I specify that some values of the matrix are strings and others are numbers? I'd like to create something like this

## Error message at Data Set Search...

Hello

I use Maple 20018.2.

When I use "Data Set Search" and press Search I get following Error Message. I check that the network access to the internet is on enable. Does anybody has an Idea?

thank you

## miscalculation with complex...

z1 := a1+I*b1; z2 := a2+I*b2; abs(z1) = 1; abs(z2) = 1; argument(z1) = alpha; argument(z2) = beta; On considère dans ℂ les complexes z1 et z2 de module 1 et d'argument α et β Show that (z1+z2)^2/(z1+z2) est un réel positf ou nul. Dans quel cas est-il nul ? is((z1^2+2*z1*z2+z2^2)/(z1+z2) = z1/z2+z2/z1+2);#wrong answer z1/z2 = exp(I*(alpha-beta)); z2/z1 = exp(I*(beta-alpha)); is(z1/z2+z2/z1+2 = 2*(1+cos(alpha-beta)));#wong answer Miscalculations. Thank you for your help.

## How to numericaly solve a system of differential e...

I'm trying to obtain the dynamical response of a simply-supported beam with a cantilever extension, coupled to a spring-mass system. In mathematical terms, this system is ruled by three PDEs (relative to each bare part of the main structure) and one ODE (relative to the spring-mass system). I think my mathemical model is finely formulated, but Maple keeps telling me this:

`Error, (in pdsolve/numeric/process_IBCs) improper op or subscript selector`

I believe it is because my PDEs depend on "x" and "t", while the ODE depends solely on "t". I have tried to transform my ODE into a "PDE", making it also dependent of "x", but without imposing any boundary conditions relative to "x". However, after this Maple points a new error message:

`Error, (in pdsolve/numeric) initial/boundary conditions must be defined at one or two points for each independent variable`

Could someone help me finding a solution? My algorythm in shown in the attached file below.

Worksheet.mw

## Why does the exception indexing function prevent m...

Here's a very simple example, working as intended:

Now, if I try to use the exception indexing function:

We can notice that b[1] isn't using exception anymore (as if the fourth input overwrote the second one) and that b[1][2] isn't linked to the value "two". However, if I define the tables first, I get the expected result:

Why does the exception indexing function prevent me from getting an existing table entry in the second case?

## decomposition of a square in sum of 2 squares...

Let E all triplets as X=(p,q,r) such as p^2+q^2=r^2. We define the application f of E dans C complex as X in E f(X)=(p+Iq)/r=Z. Calculate abs(Z). Show that in E the law noted * defined by
X1*X2=(p1*p2-q1*q2,p2*q1+p1*q2,r1*r2) is an internal law. Calculate f(X1*X2). Then if X0=(3,4,5), find
X0*X0, X0*(X0*X0).Thank you for the help.

## help me for solve the error ...

help me for solve the error of plot

p1.mw

## Output during loop processing...

I'm using Maple to solve academic problems.
At a certain stage, I need a loop to perform numerical calculations, from where I extract a graph. However, each step takes a long time and therefore, I would like to evaluate the performance of the result at each step of time.
To simulate my calculation, I created a test code:

restart:                                                                  # Restart
a := 2*((ceil(rand()/10^10)-50)*(1/10)):                # Random Value
b := 2*(ceil(rand()/10^10)-50):                             # Random Value
c := 2*ceil(rand()/10^10)-100:                             # Random Value
f := proc (x) options operator, arrow; a*x^2+b*x+c end proc;                  # Generic function that i'm ploting.
np := 10:                                                              # Number of Points i'm ploting
vmax := 10:                                                         # Maximum funcxtion value
VAR1 := Matrix(np+1, 2, proc (m, n) options operator, arrow; if n = 1 then (m-1)*vmax/np else 0 end if end proc):       # Declaring VAR1 as a "null" matrix

for i to np+1 do                                                  # Loop Start
VAR1[i, 2] := f((i-1)*vmax/np):                           # VAR1 value update
print(plot([VAR1], x = 0 .. vmax,  gridlines)):                           # Ploting VAR1
Sleep(.25):                                                         # Simulating longer processing time
od;

However, all graphs are displayed simultaneously after the last step of the for loop.
I would like to print the result (output) after each time step, plotting a new graph for each time an iteration ends.
Would anyone know how to do this?