Borrar filtros
Borrar filtros

How to input crank nicolson into matlab?

16 visualizaciones (últimos 30 días)
Conrad Suen
Conrad Suen el 9 de Feb. de 2016
Respondida: Bjorn Gustavsson el 11 de Mayo de 2016
<<
>>
I am at a loss on how to code these to solve in the Crank Nicolson equation. I have solved the equations, but cannot code it into matlab.

Respuestas (4)

Conrad Suen
Conrad Suen el 9 de Feb. de 2016

Conrad Suen
Conrad Suen el 9 de Feb. de 2016
This is the code and errors I am getting.

simopera6
simopera6 el 11 de Mayo de 2016
Editada: simopera6 el 11 de Mayo de 2016
Hi Conrad, If you are trying to solve by crank Nicolson method, this is not the way to do it. You have to solve it by tri-diagonal method as there are minimum 3 unknowns for the next time step. There are many videos on YouTube which can explain this. Hope this helps. If you can post a code after doing this, we can have a look at it. Best,

Bjorn Gustavsson
Bjorn Gustavsson el 11 de Mayo de 2016
Crank-Nicolson is for partial differential equations, this seems to be ordinary differential equations. Perhaps try matlabs ode23 et al.
HTH

Categorías

Más información sobre Programming en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by