Rouben Rostamian

MaplePrimes Activity

These are answers submitted by Rouben Rostamian

I am not going to do the entire homework for you but here is something to get you started.

plot(8+8*sin(theta), theta=0..2*Pi, coords=polar, scaling=constrained);


plot3d(25 - x^2, x=0..5, y=1..8, view=[0..5,0..8,default]);


    plot3d([10*cos(t)*cos(s), 10*cos(t)*sin(s), 10*sin(t)], t=-arccos(6/10)..arccos(6/10), s=-Pi..Pi),
    plot3d([6*cos(t), 6*sin(t), s], t=-Pi..Pi, s=-8..8),
color=["Green","Red"], style=surface, scaling=constrained, lightmodel=light4);





I have not examined the source of the error in your worksheet, but I would suggest using the facilities provided in the Physics[Vectors] package for encoding the Rodrigues formula rather than homogeneous transformation matrices, because the math works more naturally this way.  This worksheet shows how.



Rodrigues'  formula:
Rotates the vectorNULL`#mover(mi("v"),mo("→"))` about the unit vecor `#mover(mi("k"),mo("→"))` by the angle alpha:

v__rot_ := v_*cos(alpha) + (k_ &x v_)*sin(alpha) + (k_ . v_)*(1 - cos(alpha))*k_;

v_*cos(alpha)+Physics:-Vectors:-`&x`(k_, v_)*sin(alpha)+Physics:-Vectors:-`.`(k_, v_)*(1-cos(alpha))*k_

Make that into a procedure: Usage:  v__rot = R(`#mover(mi("v"),mo("→"))`, `#mover(mi("k"),mo("→"))`, alpha)

R := unapply(v__rot_, v_, k_, alpha);

proc (v_, k_, alpha) options operator, arrow; v_*cos(alpha)+Physics:-Vectors:-`&x`(k_, v_)*sin(alpha)+Physics:-Vectors:-`.`(k_, v_)*(1-cos(alpha))*k_ end proc

Example 1


Pick a unit vector:

1*_i + 2*_j + 3*_k:
k_ := % / sqrt(% . %);


Pick an arbitrary vector:

v_ := _i - 3*_j + 2*_k;


Pick a rotation angle:

alpha := Pi/6;


Find the rotated vector:

R(v_, k_, alpha):
collect(%, [_i, _j, _k]);



Example 2


Composite rotation

A unit vector:

k__1_ := k_;


Another unit vector

k__2_ := subs(_j=-_j, k__1_);


Rotate `#mover(mi("v"),mo("→"))` about `#msub(mi("k"),mi("1_"))`by (1/6)*Pi and then rotate the result about `#mi("\`k__2\`")` by (1/4)*Pi:

R(R(v_, k__1_, Pi/6), k__2_, Pi/4):
collect(%, [_i, _j, _k], simplify);










`Maple 2022.2, X86 64 LINUX, Oct 23 2022, Build ID 1657361`

pd1 := diff(u(x,t),t) = diff(u(x,t),x,x) + (1-alpha)*u(x,t);

diff(u(x, t), t) = diff(diff(u(x, t), x), x)+(1-alpha)*u(x, t)

pd2 := diff(v(x,t),t) = mu*diff(v(x,t),x,x) + beta*v(x,t) + alpha*u(x,t);

diff(v(x, t), t) = mu*(diff(diff(v(x, t), x), x))+beta*v(x, t)+alpha*u(x, t)

ics := u(x,0) = Dirac(x), v(x,0) = 0;

u(x, 0) = Dirac(x), v(x, 0) = 0

Maple is unable solve the system sympolically on its own:

pdsolve({pd1, pd2, ics}) assuming t > 0, mu > 0;

but it can, with a little help.


The first PDE has only the unknown u, so we solve it for u:

sol1 := pdsolve({pd1,ics[1]}) assuming t > 0;

u(x, t) = (1/2)*exp((1/4)*((-4*alpha+4)*t^2-x^2)/t)/(t^(1/2)*Pi^(1/2))

Then, substitute the result in the second PDE, and solve that for v:

subs(sol1, pd2);
sol2 := pdsolve({%, ics[2]}) assuming t > 0, mu > 0;

diff(v(x, t), t) = mu*(diff(diff(v(x, t), x), x))+beta*v(x, t)+(1/2)*alpha*exp((1/4)*((-4*alpha+4)*t^2-x^2)/t)/(t^(1/2)*Pi^(1/2))

v(x, t) = alpha*((erf((1/2)*(-2*((-alpha-beta+1)/(mu-1))^(1/2)*t+x)/t^(1/2))-erf((1/2)*(-2*t*mu*((-alpha-beta+1)/(mu-1))^(1/2)+x)/(mu^(1/2)*t^(1/2))))*exp((-x*(mu-1)*((-alpha-beta+1)/(mu-1))^(1/2)-((-1+alpha)*mu+beta)*t)/(mu-1))-exp((x*(mu-1)*((-alpha-beta+1)/(mu-1))^(1/2)-((-1+alpha)*mu+beta)*t)/(mu-1))*(erf((1/2)*(2*((-alpha-beta+1)/(mu-1))^(1/2)*t+x)/t^(1/2))-erf((1/2)*(2*t*mu*((-alpha-beta+1)/(mu-1))^(1/2)+x)/(mu^(1/2)*t^(1/2)))))/(((-alpha-beta+1)/(mu-1))^(1/2)*(4*mu-4))




In several places you have used square brackets [...] and curly braces {...} for grouping your mathematical terms.  In Maple, the only delimiters that you can use for that purpose are the parentheses (...).

Adjust your code as necessary and write back if it still does not work.

delvin, you should know that your equations are not comprehensible to people who are unfamiliar with numerals written in the Farsi/Persian script.  If you desire to reach the widest available help, make an effort to write your mathematics in symbols which most of the readers of this forum can understand.

Anyway, here is the answer to your question.



You wish to perform your hand calculation in Maple.  Here is the original expression:

c := (-exp(4*d)*beta^2 + 4*alpha*exp(4*d) + beta^2 - 4*alpha)/(8*exp(2*d));


and here is the simplified form obtained by Maple:

convert(simplify(c), trigh);


      That agrees with your hand calculation.





g := x -> piecewise(x - 1/3 = 0, 1, 0);

g := proc (x) options operator, arrow; piecewise(x-1/3 = 0, 1, 0) end proc










Take m = 1 and renane "(∂phi)/(∂ xi)" to y:

1/2*y^2 + (1-cos(phi)) = h+2:
solve(%, y):