Oliveira

180 Reputation

3 Badges

9 years, 254 days

MaplePrimes Activity


These are questions asked by Oliveira

Is there any way to place a command to the right of an expression to perform a task? Because I only know the way that puts the command to the right.A simple example:

w1 := simplify(sin(x)2 + cos(x)2);

                       w1:=1

w2:=sin(x)2+cos(x)2:-simplify;
             Error, invalid module reference

I wonder if there is a way to put the commands, also to the right of the expressions, as above.

Thank you,

Oliveira
   

I would like to change the color and font type on the Maple-2019 inputs and outputs, so that these formatting would be applied every time I started a new document. I tried doing this through the Styles option on the Format menu, but I could not. Can anyone help? Thank you.


 

pde1 := k*(diff(u(x, t), x, x)) = diff(u(x, t), t)

k*(diff(diff(u(x, t), x), x)) = diff(u(x, t), t)

(1)

iv1 := u(0, t) = 0, u(L, t) = 0, u(x, 0) = 2;

u(0, t) = 0, u(L, t) = 0, u(x, 0) = 2

(2)

pdsolve([pde1, iv1], u(x, t))

u(x, t) = Sum(-4*(-1+(-1)^(_Z4*csgn(1/L)))*sin(Pi*_Z4*x/L)*exp(-Pi^2*_Z4^2*k*t/L^2)/(Pi*_Z4), _Z4 = 1 .. infinity)

(3)

subs(`~`[_Z4] = n, %)

u(x, t) = Sum(-4*(-1+(-1)^(_Z4*csgn(1/L)))*sin(Pi*_Z4*x/L)*exp(-Pi^2*_Z4^2*k*t/L^2)/(Pi*_Z4), _Z4 = 1 .. infinity)

(4)

``

 
"I would like to replace the symbol _Z4~ with the letter n. I tried with the subs command, but I could not. Can anyone help"?"" ""


 

Download evaluate_a_sum.mw

When the solution is obtained in symbolic form, and then numeric values are assigned to variables, the answer is different from the numerical solution.


vol := -R^2*Pi*H*(-3*R*C^2*sin(theta)-3*H^2*cos(theta)^2*sin(theta)*R+6*R*C*sin(theta)*cos(theta)*H-sin(theta)*R^3+sin(theta)*R^3*cos(theta)^2+C^3-3*C^2*cos(theta)*H-cos(theta)^3*H^3+3*H^2*C*cos(theta)^2+3*R^2*H*cos(theta)^3+3*R^2*C-3*R^2*H*cos(theta)-3*cos(theta)^2*R^2*C)/(3*(H^2*cos(theta)^2-R^2+cos(theta)^2*R^2)^(3/2)):


V := (1/3)*Pi*R^2*H:


vp := Pi*h*R^2*(3*H^2-3*H*h+h^2)/(3*H^2):


eq := V-vp = vol;


va := theta = (1/6)*Pi, R = 2, H = 20, h = 14;


Symbolic solution:
sc := solve(eq, [C]);
evalf(subs(va, sc));
   [[C = 18.36540754], [C = 18.29805834 + 0.03888407898 I],  [C = 18.29805834 - 0.03888407898 I]]

Numerical solution:
eq1 := subs(va, eq);
evalf(solve(eq1, [C]));
    [[C = 20.91425055 + 4.492493739 I], [C = 20.91425055 - 4.492493739 I], [C = 13.13302314]]

Why this happens?
I am grateful for your attention.
Sinval Oliveira Santos.

How to build a discrete probability distribution with the function with two variables below?

ff := (x,y)->piecewise(x = 0 and y = 0, 1/8, x = 0 and y = 1, 1/6, x = 1 and y = 0, 1/3, x = 1 and y = 1, 3/8);

Thank you for your help.

Oliveira.

5 6 7 8 Page 7 of 8