MaplePrimes Questions

I am a new user to Maple, but have used PTC's Mathcad and Prime.

I have several matrices that I need to combine both vertically and horizontally.  The command augment will combine the matrices horizontally.  I was unable to find a command to combine the matrices vertically.  I tried the stack command (Prime command).  The Maple stack command appears to have a different functionality.  Could you suggest which command would do the job?  The matrices are large and I would like to limit the number of rows and columns shown in the document.

The next step will be sorting the data. I am researching this at this time.

Thank you for the support,

David Tietje

Alternating serie

 

sum((-1)^(n+1)/(2*n-1), n = 1 .. infinity)

(1/4)*Pi

(1)

 

sum((-1)^(n + 1)/(2*n - 1), n = 1 .. infinity):

sum((-1)^(n+1)/(2*n-1), n = 1 .. 4)

76/105

(2)

expand(sum((-1)^(n + 1)/(2*n - 1), n = 1 .. 4),symbolic);

76/105

(3)

?expand

series(sum((-1)^(n + 1)/(2*n - 1), n = 1 .. infinity),n=0,5);

series((1/4)*Pi,n)

(4)

 

Info series

   

How to get for n= 4  "for (∑)(((-1)^(n+1))/(2 n-1))  =   symbolic term 1+ symbolic term 2+... "

 

 

Download onderzoek_reeks_-hoe_krijg_ik_een_partieke_symbolische_som.mw

Input:

 a := x^2;
 whattype(x);
 b := x[1]^2;
 whattype(x[1]);
 CodeGeneration[C](a);
 CodeGeneration[C](b);

Output:

Do you know why cg0 =/= x[0]*x[0]?

Hello people in MaplePrimes,

I can't understand a code with PLOT3D using GRID in it.
I hope you will give me explanation about it.

restart;
k:=[[1,2,10],[1,1,8],[0,1,5],[0,0,6]];
PLOT3D(GRID(1..2,1..3,k),
       AXESLABELS(x,y,z));

I cannot understand the correspondence between points in the graph and lists in the code such as [1,2,10], [1,1,8].

 As two ranges in GRID augments in the code are 1..2 and 1..3, x takes value from 1 to 2, and
y from 1 to 3 in the picture.
And, as k is k:=[[1,2,10],[1,1,8],[0,1,5],[0,0,6]], which means this list of lists are 4 X 3, so in the picture
as for x the interval of 1 to 2 is divided to three sections with the points of value of 0, 1/3, 2/3 and 3/3, which total number is 4.
And, as for y the interval of 1 to 3 is devided to two sections with the points of value of 1, 2 and 3, which total number is 3.

And, I cannot understand why from the grid of [1,1,8] in the code, which I think is the coodinate of (1, 1) on x-y plane, does not mean that the value of z on that point on the graph is not 8, but 1.

graph.mw

restart:

sys:={-diff(v(x,t),t)+0.5*p*diff(u(x,t),x,x)+q*u(x,t)*(u(x,t)^2+v(x,t)^2)=0,diff(u(x,t),t)+0.5*p*diff(v(x,t),x,x)+q*v(x,t)*(u(x,t)^2+v(x,t)^2)=0};
        /                      /  2         \
        |/ d         \         | d          |
sys := < |--- u(x, t)| + 0.5 p |---- v(x, t)|
        |\ dt        /         |   2        |
        \                      \ dx         /

               /       2          2\       / d         \
   + q v(x, t) \u(x, t)  + v(x, t) / = 0, -|--- v(x, t)|
                                           \ dt        /

           /  2         \                                      \ 
           | d          |             /       2          2\    | 
   + 0.5 p |---- u(x, t)| + q u(x, t) \u(x, t)  + v(x, t) / = 0 >
           |   2        |                                      | 
           \ dx         /                                      / 
eq1 := diff(u(x,t),t) = u__t(x,t):
eq2 := diff(v(x,t),t) = v__t(x,t):

sys_tmp := subs(eq1, eq2, sys):

sys_new := sys_tmp union {eq1, eq2}:

Boundary conditions:
bc :=
    u(0,t) = 2,
    v(0,t) = 0;
                 bc := u(0, t) = 2, v(0, t) = 0
Initial conditions:
ic :=
    u(x,0) = tanh(2*Pi),
    v(x,0) = tanh(2*Pi),
    u__t(x,0) = 0,
    v__t(x,0) = 0;
 
ic := u(x, 0) = tanh(2 Pi), v(x, 0) = tanh(2 Pi), u__t(x, 0) = 0, 

  v__t(x, 0) = 0
Solve the system:
pdsol := pdsolve(subs(p=1, q=0.5, sys_new), {ic, bc}, numeric);

I want to change my variables. The coding below shows the influence of the Nb and Nt on the local Nusselt number (-theta') against the convection Bi.

But now I want it to be  the influence of the Bi on the local Nusselt number (-theta') against the Nb and Nt.

Can anyone help me?

NULL

with(plots)

DE1 := diff(f(eta), `$`(eta, 3))+f(eta)*(diff(f(eta), `$`(eta, 2)))-(diff(f(eta), eta))^2 = 0

diff(diff(diff(f(eta), eta), eta), eta)+f(eta)*(diff(diff(f(eta), eta), eta))-(diff(f(eta), eta))^2 = 0

(1)

DE2 := diff(theta(eta), `$`(eta, 2))+Pr*f(eta)*(diff(theta(eta), eta))+Pr*Nb*(diff(theta(eta), eta))*(diff(phi(eta), eta))+Pr*Nt*(diff(theta(eta), eta))^2 = 0

diff(diff(theta(eta), eta), eta)+Pr*f(eta)*(diff(theta(eta), eta))+Pr*Nb*(diff(theta(eta), eta))*(diff(phi(eta), eta))+Pr*Nt*(diff(theta(eta), eta))^2 = 0

(2)

DE3 := diff(phi(eta), `$`(eta, 2))+Le*(diff(phi(eta), eta))+Nt*(diff(theta(eta), `$`(eta, 2)))/Nb

diff(diff(phi(eta), eta), eta)+Le*(diff(phi(eta), eta))+Nt*(diff(diff(theta(eta), eta), eta))/Nb

(3)

BC1 := f(0) = 0, (D(f))(0) = 1, (D(f))(10) = 0

f(0) = 0, (D(f))(0) = 1, (D(f))(10) = 0

(4)

BC2 := theta(10) = 0, (D(theta))(0) = -Bi*(1-theta(0))

theta(10) = 0, (D(theta))(0) = -Bi*(1-theta(0))

(5)

BC3 := phi(0) = 1, phi(10) = 0

phi(0) = 1, phi(10) = 0

(6)

``

  getRes:= proc(a, x);
                local sol;
                if   type(x, numeric)
                then sol:= dsolve
                           ( eval
                             ( {BC1, BC2, BC3, DE1, DE2, DE3},
                               [Nt = a, Nb = a, Pr = 2, Le = 5, Bi = x]
                             ),
                             numeric,
                             output = listprocedure,
                             abserr = 0.0001,
                             maxmesh = 1024,
                             initmesh = 512
                           );
                else return 'procname(a,x)';
                fi;
                return -eval(diff(theta(eta), eta), sol)(0)
           end proc:

  cl:=[red, green, blue, yellow, black]:
  L:=[0.2, 0.4, 0.6,0.8,1.0]:
  display
  ( [ seq
      ( plot
        ( getRes( L[k], x),
          x=0..5,color = colorList[k], legend = ["Nb=Nt" = L[k]], legendstyle = [location = top],
          color=cl[k]
        ),
        k=1..5
      )
    ]
  )
               

 

 

 

Download odeProb2.mw

Contour integration notation

" (&int;)[+infinity]^(+infinity)((-x)^(z))/((e)^(x)-1). (&DifferentialD;x)/(x)"

 

The limits of integration are intented to indicate a path of integration which begins at + ∞, moves to th e left down the positive real axis, circles the orign once in positive ( counterclockwise) direction, and returns up to the positive real axis to  +∞

-How does this contour look like  in a  graph ?
- the "(&DifferentialD;x)/(x)" notation  ?
- calculating this complexe contour integral?

Seems that the concept of the contour integration is similar wit a line integral in real calculus ?

Some more information needed about singularities ( first en second order ..more?)

Nieuwe pagina 1 (hhofstede.nl)

NULL

Download contourintegraal_vraag1.mw

I have just come across this curious but really boring problem.
In the code snippet below, expr1 and expr2 are identical.

restart:
data := [a=1, b=2]:
convert(
  piecewise(And(x(t) > a, x(t) < b), 1, 0),
  Heaviside
):
expr1 := eval(eval(%, data),  x(t)=z):
plot(expr1, z=0..3);


convert(
  piecewise(And(z > a, z< b), 1, 0),
  Heaviside
):
expr2 := eval(%, data),:
plot(expr2, z=0..3);


But if I change the parameterization of the problem, expr2 is still correct but expr1 is not

restart:
data := [d=1.5, a=0.5]:
convert(
  piecewise(And(x(t) > d-a, x(t) < d+a), 1, 0),
  Heaviside
):
expr1 := eval(eval(%, data),  x(t)=z):
plot(expr1, z=0..3);


convert(
  piecewise(And(z > d-a, z< d+a), 1, 0),
  Heaviside
):
expr2 := eval(%, data),:
plot(expr2, z=0..3);

Where does this come from?

PS: I'm sorry not to be able loading the mw file

Hello, 

I would like to write to a file the output of the command CodeGeneration[Matlab]. I couldn't find a way to write the output. 

What I am trying to do is to generate complex symbolic equations and expressions and write them as either a function or variables in matlab. 

As an example: 

exp := [sin(theta(1)), cos(theta(1))]; 

func := unapply(exp,[theta]); 

CodeGeneration:-Matlab(func)

If i can write the output of the above command in a matlab file, it will generate a matlab function file. 

I was using the command 'writeto' but this one basically outputs every line a command written to a file instead of the terminal, which is not what I want (it will output even the warnings, I know I can silent them!). 

can you please help.. thanks. 

Hello guys,

I want to plot two functions such as x(t) and y(t) in a unique diagram as a function of each other. In a routine way, one needs to solve one of these functions as t and then input its results in others. for example, solving x(t) to find t and then input this t(x) into y(t) to have y(x). but here problem is that I cannot solve x(t) to find t and so this routine solution is not accelssible.

x(t):=1 + (3*n*(v - 1)^2*A*(t^v)^2*(1 + alpha*(v - 1)^2*A^2*(t^v)^2*ln(m^2*t^2/((v - 1)^2*A^2*(t^v)^2))/(3*n^2*m^2*t^2) + A^2*beta*(v - 1)^2*(t^v)^2/(3*n^2*m^2*t^2))*((4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) - 3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2))*(1 + ((4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) - 3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2))/(3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2))))/(2*v^2*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)) - (3*n^2*(v - 1)^2*A^2*(t^v)^2*(1 + alpha*(v - 1)^2*A^2*(t^v)^2*ln(m^2*t^2/((v - 1)^2*A^2*(t^v)^2))/(3*n^2*m^2*t^2) + A^2*beta*(v - 1)^2*(t^v)^2/(3*n^2*m^2*t^2))*(((4*A^2*alpha*t^v*v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2))/t + 4*A^2*alpha*t^v*(v - 1)^2*(2 - 2*v)/t + 6*t^(-v + 2)*(-v + 2)*m^2*n^2/t + 4*t^v*v*(beta - alpha/2)*A^2*(v - 1)^2/t)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) + (4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*n^2*(v - 1)^2*A^2*t^(2*v)/(sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2)*v*t) - 3*n*A*(2*A^2*alpha*t^(2*v)*v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2))/t + A^2*alpha*t^(2*v)*(v - 1)^2*(2 - 2*v)/t + 2*A^2*beta*(v - 1)^2*t^(2*v)*v/t + 6*n^2*m^2*t))/(3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)) - (((4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) - 3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2))*(2*A^2*alpha*t^(2*v)*v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2))/t + A^2*alpha*t^(2*v)*(v - 1)^2*(2 - 2*v)/t + 2*A^2*beta*(v - 1)^2*t^(2*v)*v/t + 6*n^2*m^2*t))/(3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)^2)))/(2*v^2):

y(t):=1 + ((4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) - 3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2))/(3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)) - (((4*A^2*alpha*t^v*v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2))/t + 4*A^2*alpha*t^v*(v - 1)^2*(2 - 2*v)/t + 6*t^(-v + 2)*(-v + 2)*m^2*n^2/t + 4*t^v*v*(beta - alpha/2)*A^2*(v - 1)^2/t)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) + (4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*n^2*(v - 1)^2*A^2*t^(2*v)/(sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2)*v*t) - 3*n*A*(2*A^2*alpha*t^(2*v)*v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2))/t + A^2*alpha*t^(2*v)*(v - 1)^2*(2 - 2*v)/t + 2*A^2*beta*(v - 1)^2*t^(2*v)*v/t + 6*n^2*m^2*t))/(3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)) - (((4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) - 3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2))*(2*A^2*alpha*t^(2*v)*v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2))/t + A^2*alpha*t^(2*v)*(v - 1)^2*(2 - 2*v)/t + 2*A^2*beta*(v - 1)^2*t^(2*v)*v/t + 6*n^2*m^2*t))/(3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)^2))*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)/((4*A^2*alpha*t^v*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + 6*t^(-v + 2)*m^2*n^2 + 4*t^v*(beta - alpha/2)*A^2*(v - 1)^2)*sqrt(n^2*(v - 1)^2*A^2*t^(2*v)/v^2) - 3*n*A*(A^2*alpha*t^(2*v)*(v - 1)^2*ln(m^2*t^(2 - 2*v)/((v - 1)^2*A^2)) + A^2*beta*(v - 1)^2*t^(2*v) + 3*n^2*m^2*t^2)):

there are x(t) and y(t). I want to plot y as x, not t. so please help me.

with best

Hello people in Mapleprimes,
I haven't written in this site for a long time.

I have a question in the below program, which is to write ribbons.
For the implementation of this program, 
I wrote this.
ribbonplot5([cos, sin, cos + sin], -Pi .. Pi,numpoints=20);

In the part of pattern matching, as -Pi .. Pi above is a range, so it is OK.
But, when I changed this part to x=-Pi..Pi, an error message appears.

ribbonplot5([cos, sin, cos + sin],x=-Pi .. Pi,numpoints=20);

brings error messages:
"Warning, unable to evaluate the function to numeric values in the region; see the plotting command's help page to ensure the calling sequence is correct"

In the code of ribbonplot5,  x=-Pi..Pi which is the type of name=range shoud satisfy the pattern matching, as I wrote in the first part of the program as 
ribbonplot5 := proc(Flist, r1::{range,name=range})

I cannot know why the part of the program:
 
" else
       newFlist := map(unapply, Flist, lhs(r1));
     opts := ['labels'=[lhs(r1), " "," "],
                 args[3 .. nargs]];
    ribbonplot5(newFlist,rhs(r1),op(opts)):
"

wouldn't work well.

I wish I could get an answer to this. 

Thanks in advance.

This is a program in maple9 Advanced Programming Gude p. 253

graphic_ribbonplot.mw

restart;
extend := proc(f)
     local x, y;
     unapply(f(x), x, y);
end proc:
p:=x->cos(2*x):
q:=extend(p);


ribbonplot5 := proc(Flist, r1::{range,name=range})
     local i, m, p, n, opts,newFlist;
     opts := [args[3 .. nargs]];
     if type(r1, range) then
         if not hasoption(opts, 'numpoints', 'n', 'opts')
         then n := 25
         end if; 
         m := nops(Flist);
         p := seq(plot3d(extend(Flist[i]), r1, (i-1) .. i,
                                  grid=[n, 2], op(opts)),
                       i = 1 .. m):
         plots[display](p):
     else
       newFlist := map(unapply, Flist, lhs(r1));
     opts := ['labels'=[lhs(r1), " "," "],
                 args[3 .. nargs]];
    ribbonplot5(newFlist,rhs(r1),op(opts)):
   end if:
end proc:
ribbonplot5([cos, sin, cos + sin], -Pi .. Pi,numpoints=20);

I'd like to get the simplest possible expression when using simplify. The problem is that this is all done in a program, without having the benifit of looking at the expression on the screen and trying things. So I need a method that works for large set of input all the time.

I noticed in this example that simplify did not do what I think it should have.

Given the expression -2*(x^3 + 2)/(x*(x + 1)*(sqrt(3)*I + 2*x - 1)*(sqrt(3)*I - 2*x + 1)) it can be simplified to (x^3 + 2)/(2*x^4 + 2*x) but  I had to go into many tries in order to get this final result.

Is there a better way to do this? I end up now   doing simplify(expand(numer(expr))/expand(denom(expr))) in the hope to get better simplification.  Here is an example

interface(version);

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

restart;

w:=-2*(x^3+2)/x/(x+1)/(I*3^(1/2)+2*x-1)/(I*3^(1/2)-2*x+1);

-2*(x^3+2)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(evalc(w))

(1/2)*(x^3+2)/((x^2-x+1)*(x+1)*x)

simplify(w) assuming x::real

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w,size)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w,symbolic)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(w,sqrt)

(-2*x^3-4)/(x*(x+1)*(I*3^(1/2)+2*x-1)*(I*3^(1/2)-2*x+1))

simplify(expand(numer(w))/expand(denom(w)))

(x^3+2)/(2*x^4+2*x)


It would be nice if Maple simplify would just do it directly as follows in Mathematica. May be there is a an  option I am overlooking

 

Download simplify.mw

I drew a methane molecula and display three times because I wanted to get two-fold and three-fold symmetry axis. ,I would is that I would like to get a more exact output and doing it without clicking, it's say, using code. Can someone help me?tareaclase6.mw
 

University of Costa Rica 

Course: SP-1493

Student: Lic. Marcus Vinicio Mora Salas

Instructor: Dr. Erick Castellón Elizondo

 

Assigment5

Description

 

In this assigment exercises e2.113,  e2.114, e2.115 and e2.117 was solved.

NULL

***e2.113

   

 

 

 

NULL


 

Download tareaclase6.mw

 

Suppose I have a real function which is defined on these intervals [x0,x1],...[x1,xn], and on each interval it's defined differently, for example f(x):=sqrt(x) if x>=0; f(x):=1/x if x<0.

For the last example I tried my last resort to use the assuming operator the following way:

f := ((x -> sqrt(x)) assuming (0 <= x)) or ((x -> 1/x) assuming (x < 0)) plot(f, x)

But it doesn't seem to be working, how do you propose to define this function? perhaps proc?

I tried looking for an example in maple's help, but didn't find any.

Your help is appreciated.

I read that abs(v) should find the magnitude of complex number. But I find cases where it does not.

Should one then use sqrt( Re(v)^2 + Im(v)^2 ) instead or is there different command to use?  Here is an example

interface(version)

`Standard Worksheet Interface, Maple 2021.2, Windows 10, November 23 2021 Build ID 1576349`

restart;

v:=1/16*(I*5^(1/2)+I-4*sin(1/5*Pi))*2^(3/10)*(5-5^(1/2))^(1/2)-1/8*2^(4/5)*((I*5^(1/2)+I)*sin(1/5*Pi)+1/2*5^(1/2)+3/2)

(1/16)*(I*5^(1/2)+I-4*sin((1/5)*Pi))*2^(3/10)*(5-5^(1/2))^(1/2)-(1/8)*2^(4/5)*((I*5^(1/2)+I)*sin((1/5)*Pi)+(1/2)*5^(1/2)+3/2)

abs(v)

-(1/16)*(I*5^(1/2)+I-4*sin((1/5)*Pi))*2^(3/10)*(5-5^(1/2))^(1/2)+(1/8)*2^(4/5)*((I*5^(1/2)+I)*sin((1/5)*Pi)+(1/2)*5^(1/2)+3/2)

sqrt( Re(v)^2 + Im(v)^2 );

((-(1/4)*2^(3/10)*(5-5^(1/2))^(1/2)*sin((1/5)*Pi)-(1/8)*2^(4/5)*((1/2)*5^(1/2)+3/2))^2+((1/16)*2^(3/10)*(5-5^(1/2))^(1/2)*(5^(1/2)+1)-(1/8)*2^(4/5)*(5^(1/2)+1)*sin((1/5)*Pi))^2)^(1/2)

 

Download complex.mw

Here is the same thing in Mathematica:

I searched help for modulus but could not find one.

Maple 2021.2

First 226 227 228 229 230 231 232 Last Page 228 of 2308