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]);

 

plots:-display(
    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);

 


 

Download mw.mw

 

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.

restart;

with(Physics[Vectors]):

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(% . %);

(1/14)*(_i+2*_j+3*_k)*14^(1/2)

Pick an arbitrary vector:

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

_i-3*_j+2*_k

Pick a rotation angle:

alpha := Pi/6;

(1/6)*Pi

Find the rotated vector:

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

((13/28)*3^(1/2)+(13/28)*14^(1/2)+1/14)*_i+(-(11/7)*3^(1/2)+(1/28)*14^(1/2)+1/7)*_j+((25/28)*3^(1/2)-(5/28)*14^(1/2)+3/14)*_k

 

Example 2

 

Composite rotation

A unit vector:

k__1_ := k_;

(1/14)*(_i+2*_j+3*_k)*14^(1/2)

Another unit vector

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

(1/14)*(_i-2*_j+3*_k)*14^(1/2)

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);

((1/392)*(3*3^(1/2)-4*7^(1/2)+57)*2^(1/2)+(1/392)*(82*7^(1/2)+176)*3^(1/2)+(81/196)*7^(1/2)+3/98)*_i+((1/196)*(-66*3^(1/2)+4*7^(1/2)+174)*2^(1/2)+(1/196)*(7*7^(1/2)-176)*3^(1/2)+(3/196)*7^(1/2)-3/49)*_j+((1/392)*(-89*3^(1/2)-12*7^(1/2)+213)*2^(1/2)+(1/392)*(-18*7^(1/2)+528)*3^(1/2)-(25/196)*7^(1/2)+9/98)*_k

 

 

Download mw.mw

 

 

 

restart;

kernelopts(version);

`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))

 

Download mw.mw

 

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.

 

restart;

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));

(1/8)*(-exp(4*d)*beta^2+4*alpha*exp(4*d)+beta^2-4*alpha)/exp(2*d)

and here is the simplified form obtained by Maple:

convert(simplify(c), trigh);

(-(1/4)*beta^2+alpha)*sinh(2*d)

      That agrees with your hand calculation.

 

 

 

restart;

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

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

g(3+1/3);

0

g(0+1/3);

1

 

Download mm.mw

 

 

restart;

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

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