简体   繁体   中英

using crank-nicolson to solve a 1D wave equation in python

I am trying to solve the 1D-wave equation

d2phi/dt2 = v^2d2phi/dx2 and am having trouble using the crank-nicolson method to form a system of linear equations and solve it in python as a matrix
A phi(x,t+h) = B phi(x,t) Any help finding the elements A and B would be greatly appreciated! Thanks

You can form matrices using numpy.matrix

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM