Muhammad Usman

235 Reputation

5 Badges

11 years, 257 days
Beijing, China

MaplePrimes Activity


These are questions asked by Muhammad Usman

Dear Users!

I hope you are doing well. In the attached file I want to convert the system of ODEs (attained the system against the value of M) into matrix form and need the matrices A, B and vector b. Remember the order of A, B and b vary as M vary. I am waiting for your kind response. Please take care and thanks

System_of_ODEs.mw

Dear Users!

I hope everyone is fine here. I want to solve the following system of PDEs associated with Robin-type boundary conditions. But got the error. Kindly help me to fix this issue. Thanks

restart; TT := 0.1e-2; l := 1/5; b[1] := .18; b[2] := 2*10^(-9); k[1] := 1.3*10^(-7); k[-1] := 24; k[2] := 7.2; p := .9997; d[1] := 0.412e-1; f := .2988*10^8; g := 2.02*10^7; s := 1.36*10^4; E[0] := 3.3*10^5; T1[0] := .5*10^9; C1[0] := 3.3*10^5; alpha[0] := 10^(-10); D1 := 10^(-6); D2 := 10^(-2); D3 := 10^(-6); d[4] := 1.155*10^(-2); t[0] := 1/D1; kappa := 10^4; k[3] := 300*(24*60); chi := 0; sigma := d[1]*t[0]; rho := f*t[0]*C1[0]/(E[0]*T1[0]); mu := k[1]*t[0]*T1[0]; eta := g/T1[0]; epsilon := t[0]*C1[0]*(p*k[2]+k[-1])/E[0]; omega := D3/D1; beta1 := b[1]*t[0]; beta2 := b[2]*T1[0]; phi := k[1]*t[0]*E[0]; lambda := t[0]*C1[0]*(k[-1]+k[2]*(1-p))/T1[0]; psi := t[0]*(k[-1]+k[2]); gamma1 := chi*alpha[0]/D1; delta := D2/D1; kappa := k[3]*t[0]*C1[0]/alpha[0]; xi := d[4]*t[0]; PDE1 := diff(u(y, t), t) = diff(u(y, t), y, y)-gamma1*(u(y, t)*(diff(theta(y, t), y, y))+(diff(u(y, t), y))*(diff(theta(y, t), y)))+sigma*piecewise(y <= l, 0, 1)+rho*C(y, t)/(eta+T(y, t))-sigma*u(y, t)-mu*u(y, t)*T(y, t)+epsilon*C(y, t); PDE2 := diff(theta(y, t), t) = delta*(diff(theta(y, t), y, y))+kappa*C(y, t)-xi*theta(y, t); PDE3 := diff(T(y, t), t) = omega*(diff(T(y, t), y, y))+beta1*(1-beta2*T(y, t))*T(y, t)-phi*u(y, t)*T(y, t)+lambda*C(y, t); PDE4 := diff(C(y, t), t) = mu*u(y, t)*T(y, t)-psi*C(y, t); ICs := u(y, 0) = piecewise(0 <= y and y <= l, 0, 1-exp(-1000*(x-l)^2)), T(y, 0) = piecewise(0 <= y and y <= l, 1-exp(-1000*(x-l)^2), 0), C(y, 0) = piecewise(l-epsilon <= y and y <= l+epsilon, exp(-1000*(x-l)^2), 1-exp(-1000*(x-l)^2)), theta(y, 0) = 0; BCs := {(D[1](C))(0, t) = 0, (D[1](C))(1, t) = 0, (D[1](T))(0, t) = 0, (D[1](T))(1, t) = 0, (D[1](theta))(0, t) = 0, (D[1](theta))(1, t) = 0, (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 0};

PDE:= {PDE1, PDE2, PDE3, PDE4}; pds := pdsolve(PDE, {ICs}, BCs, numeric, spacestep = 1/100, timestep = 1/100);

Error, (in pdsolve/numeric/process_PDEs) specified dependent variable(s) {(D[1](C))(0, t) = 0, (D[1](C))(1, t) = 0, (D[1](T))(0, t) = 0, (D[1](T))(1, t) = 0, (D[1](theta))(0, t) = 0, (D[1](theta))(1, t) = 0, (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 0} not present in input PDE
 

Hi!

I hope everyone is fine. I have a square matrix like the following form
A := Matrix([[10, -1, 2, 0], [-1, 11, -1, 3], [2, -1, 10, -1], [0, 3, -1, 8]]);
How to split A into three matrices D, L and U as:

D:= Matrix([[10, 0, 0, 0], [0, 11, 0, 0], [0, 0, 10, 0], [0, 0, 0, 8]]);
L := Matrix([[0, 0, 0, 0], [-1, 0, 0, 0], [2, -1, 0, 0], [0, 3, -1, 0]]);
U := Matrix([[0, -1, 2, 0], [0, 0, -1, 3], [0, 0, 0, -1], [0, 0, 0, 0]]);

I am waiting for your positive response. Please take care

Hi dear Users!

I hope everyone here is fine. I have a function like

f := exp(-t)*(x^2-5*x^3+10*x^5+x+3+.5*x^4)+(1/2)*x^2*(x-1)+2*sin(x);

I have to find the value of t at which the behavior of this function is constant for 6 decimal places against x from 0..1. This is my effort

restart;
N := 20; TOL := 10^(-6); Points := 100000;
f := exp(-t)*(x^2-5*x^3+10*x^5+x+3+.5*x^4)+(1/2)*x^2*(x-1)+2*sin(x);
for j from 0 while j <= 10 do print("\nWhen x = ", j/(10.));
for i from 0 while i <= Points do
g[i, j] := evalf(eval(f, [x = (1/10)*j, t = N*i/Points]));
if `and`(i >= 1, abs(g[i, j]-g[i-1, j]) < TOL) then print("Value of t = ", evalf(N*i/Points)); print("Value of f = ", g[i, j]); break else  
end if end do end do;


The same value is then verified by making graphs

plot([eval(f, t = 1), eval(f, t = 2), eval(f, t = 3), eval(f, t = 4), eval(f, t = 5), eval(f, t = 6), eval(f, t = 7)], x = 0 .. 1, color = [red, green, blue, cyan, yellow, black, purple]);
plot(eval(f, x = .8), t = 0.1e-1 .. N);

 

Here I want to know if is there any more effective maple command to find the value of t rather than using procedures (highlighted by red) or a graphical way.

Hi Users!

I hope everyone is fine. I want to plot any function say
f := exp(cos(x)+sin(x)) for x=a..b for any n say 12 so that h := (b-a)/n. 

For a=0, b=3 and n=12 I got h=1/4 and plot of f is:

But I want the plotting as given bellow where the value of f(x) is mentioned and girds line.

I am waiting for your answer. Thanks in advance.

 

1 2 3 4 5 6 7 Last Page 3 of 38