Items tagged with homework

I have the following two PDEs:

PDE := diff(u(x, t), t) = diff(u(x, t), x, x)+sin(x+t)-cos(x+t);

IBC:= D[1](u)(0,t)=-sin(t),

pds := pdsolve( PDE, [IBC], numeric, time = t, range = 0 .. 1,
spacestep = 1/32, timestep = 1/32,


PDE2 := diff(v(x, t), t) = diff(v(x, t), x, x);
IBC2:= D[1](v)(0,t)=0,
D[1](v)(1,t)=-0.000065*v(1, t)^4,

pds1 := pdsolve( PDE2, [IBC2], numeric, time = t, range = 0 .. 1,
spacestep = 1/32, timestep = 1/32,


Now, what I want to do with these two PDEs is the following:


For each h=timestep=spacestep  = 1/16 , 1/32 , 1/64 , 1/128 , 1/256

Calculate the error norm ||E||_h = sqrt(sum_{j=0}^{1/h} h* |u(j*h,tval)-v(j*h,tval)|^2)

where tval is some chosen point between 0 and 1 (this value is fixed for each spacestep chosen).


And then plot the graph of log ||E||_h vs. log h above.


What I don't know is how to extract each time the spacestep and its PDE's two solutions, does someone have a suggested script to use here?



let γ be the root 

i have to apply taylor series on f(x) and then do some substitution like (helped by a member of Mapleprime)

taylor(f(x), x = gamma, 8);
f(x[n]) := subs([x-gamma = e[n], f(gamma) = 0, seq(((D@@k)(f))(gamma) = factorial(k)*c[k]*(D(f))(gamma), k = 1 .. 1000)], %)

then find the derivative of result from above output

i do

b := diff((x[n]), e[n])

basically i have to find the value of newton method which is


here we substitute xn=γ and D(f)(xn)=b

and then want to apply f on yn

there are to problem which i face 

1  f(xn)/D(f)(xn) is not in simplified form i-e O(e[n]^8) and O(e[n]^7) is appeared in numerator and denominator respectively. how we get the simplified result.

2 wht step should i do to find f(yn)

plx help me to do this 

thanx in advance



I am very beginner about Maple. How to get the general solution from the follwoing equations by Maple. Please help me. Its Urgent. Please help me out.

Hi everyone, I'm working a problem

Given a dog and a man. At t=0, the position of the man and his dog is (0,0) and (0,h), respectively. Then, the man start moving along Ox with constant speed vm. The dog keep running toward its master with constant speed vd. Describe the movement of the dog?

Therefore, let say the position of the dog is (f1(x),f2(x)), I wrote these:



MD := proc (h, vm, vd) local x, y, ode, ics, sol;

ode := {(diff(f2(t), t))*(vm*t-f1(t))+(diff(f1(t), t))*f2(t), diff(f2(t), t) = -sqrt(vd^2-(diff(f1(t), t))^2)};

ics := {f1(0) = h, f2(0) = 0};

sol := dsolve(ode union ics);

x := unapply(eval(f1(t), sol), t);

y := unapply(eval(f2(t), sol), t);

plot([x(t), y(t), t = 0 .. 10], scaling = constrained) end proc;

MD(10, 1, 5);

However, "sol" is returned NULL, which means the equation has no solution. I supposed I completed the motion part of the problem correctly. Please help me or point out an another method


Hey guys! Can anyone help me with solving one of these Differential Equations ?


Explore the values of km digit(n,m) using km list for all m, 0 ≤ m ≤ 8.
Look at the output until you can make a conjecture that concerns the pattern
obtained for each fixed m, 0 ≤ m ≤ 8 using 

km := proc (n::posint, m::nonnegint)

local k,

mySum := 0;

for k to n do

mySum := mySum+k^m

end do;

return mySum

end proc

using a list km list(m,6,20) when m is not a multiple of 4, and km list(m,6,50) when m is a multiple of 4.


any help appreciated..THank you


Need to create a fibonacci defintiion using this form..Any help appreciated..thanks in advance

The Fibonacci numbers Fn are defined for all positive integers n as follows:

Fn = ( 1,                 n =1, 2 , )    

      (Fn−1 + Fn−2 , otherwise.)

 Complete the definition of fib so that fib(n) returns Fn for all positive integers n. You must compute Fn using the below definition! A recursive proc is most natural.

description "Calculate fib(n), the n'th Fibonacci number.";
option remember; # important for efficiency!
end proc; # fib

I need to complete the definition of P km using a for loop so that km(n,m) returns n k=1 k m whenever n, m ∈ Z, n > 0, and m ≥ 0.( You must use a for loop in the variable k, with k ranging from 1 to n, to do this question in the manner requested.)

km is defined as 

description "km(n,m) returns the sum of k^m as k ranges from 1 to n.";
end proc; # km

Not sure where tostart..Any help appreciated...thank you

hello all!

Pascal := proc (n::posint)

local x, y, i;

 for i from 0 to n do print(coeffs(expand((x+y)^i)))

end do end proc;


1, 1
1, 2, 1
1, 3, 3, 1
1, 4, 6, 4, 1

 How to create 


1  1
1  2  1
1  3  3  1
1  4  6  4  1


hello everybody!

I want to create a random symmetric matrix which have det=2. I just made it like this, no better than those ones. Thanks!

Doixung := proc (n)

local A, i, j; A := Matrix(n);

n := LinearAlgebra[Dimension](A);

for i to n do A[i, i] := RandomTools[Generate](integer(range = 1 .. 20))

   end do;

for i to n do

     for j to n do

           while j < i do A[i, j] := RandomTools[Generate](integer(range = 1 .. 20)) end do;

           while i < j do A[i, j] := A[j, i] end do

     end do

end do;

print(A) end proc

Hello everbody.


 local i,p,f;   i:=1;

 while i<= N do      


     if abs(p-p[0])<TOL then             return p;     else i:=i+1;            p[0]:=p; end if;  

end do;

printf("The method failed after N iterations,N=%d",N);  end proc:

Hello! I have written a algorithm. Can you help me find errors? thank you very much. sorry, my English is not very good!

uses LA= LinearAlgebra;
local i, j, k, n:= LA:-RowDimension(A),
L:= Matrix(LA:-Dimensions(A));
for j from 2 to n do
end do;
for i from 2 to n-1 do
for j from i+1 to n do
end do;
end do;

Given the sequence defined by the recursive relation a[n+1] = r*a[n](1-a[n])
You need to use the procedure iterate.
Throughout this problem you should choose initial values in the interval 0<a0<1.
(a) Let r=3/2. Calculate a moderate number of terms in the sequence (between 10 and 20). Does the sequence appear to be converging? If so to what value? Does the limit depend upon your choice of initial value? Plot the terms you have calculated
(b) Let r=2.8. Calculate a moderate number of terms in the sequence (between 10 and 20). Does the sequence appear to be converging? If so to what value? Does the limit
depend upon your choice of initial value? Plot the terms you have calculated How does this sequence differ from that in part (a).
(c) Let r=3.2. Calculate a moderate number of terms in the sequence (between 10 and 20). Show that the sequence does not appear to converging. Plot the terms you have calculated and describe how the sequence behaves in this case.
(d) Consider intermediate values between 2.8 and 3.2 to determine more precisely where the transition in behaviour takes place. Provide a few plots (no more than 4) showing the values you have investigated.
(e) Consider the values of r in the range 3.43<r<3.46. Determine as accurately as you can the value of r for which the period of oscillation doubles.
(f) As r increase further period doubling occurs. Try to find the when the sequence appears to oscillate between 8 values.
(g) Let r =3.65 and calculate a considerable number of terms (at least a few hundred) and plot your values.
(h) For r=3.65 choose a0=0.3 and then a0=0.301. Find and plot some terms in the sequence for each initial value. Determine how long the terms in the two sequences remain close together and when they begin to depart significantly from each other.

Hello all! I've just learned about Maple. My English is not very good :( I write matrix A:=L*U program. If you know it, you will understand my mind. But I received "error" from Maple. Thanks for your viewing

hello eveyone! sorry, my English is not very good

I writed Neville algorithm

I want to creat a table(or a matrix) Q with



with value of X: -2,1,0,1,2

-2   1/4

-1    1/2

0    1

1    2

2     4

I want to approximate f at x=0.5 by Neville

then:   for i:=2,...,n   (that case is 5)

             for j:=2,...i




this is:

-2  1/4     0       0            0          0

-1  1/2     0.875  0           0           0

0  1         1.25   1.3475    0           0

1  2         1.5    1.4375   1.421875  0

2  4         1      1.375      1.40625  1.412109375

do you understand my mind? sorry, my English is not very good



2 3 4 5 6 7 8 Last Page 4 of 23