81 Reputation

2 Badges

16 years, 269 days

MaplePrimes Activity

These are questions asked by mailman

I would like to be able to code boundary conditions of the following type: u[x](0,t)=0 and u[x](1,t)=4 where u[x] is differentiating u with respect to x. I can code for non derivative boundary conditions using a for loop. Is the process similar? I have tried to find some examples on the internet but can't find any.
I am trying to gain some experience in maple coding, frankly I'm terrible so a tutor has kindly set me some tasks. He wants me to write a procedure for solving any tridiagonal system of equations. Here is his brief: Write a procedure to solve a given tridiagonal system of equations. Use lists to input the coefficients and do NOT use matrices and/or Maple arrays. The procedure can then be called at every time step. This will also be more involved. After a bit of research I know this is the starting matrix: b1x1 + c1x2 = d1 a2x1 + b2x2 + c2x3 = d2
I have been told my code is not 'perfect', I'm not too hot on maple and it has taken me a week to get to this stage. Any help or suggestions would be very welcome! h:=0.1: k:=0.001: r:=k/h^2: xl:=0: xr:=1: # left and right ends of interval in x nxpoints:=round((xr-xl)/h): ntsteps:=5: # total number of time steps iprint:=1: # print output every iprint time steps printf(cat(" x,t ","%7.3f"$(nxpoints+1),"\n"),seq(i*h,i=0..nxpoints)): format:=cat("%7.3f"$(nxpoints+2),"\n"): # format for printing output Boundary conditions for j to ntsteps+1 do u[0,j]:=0: u[nxpoints,j]:=0
Page 1 of 1