Python Forum

Full Version: Automatically generate coupled equations from given conditions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I would like you to help me create a python code that will automatically generate equations from given conditions for the given function F.



The function is given by:

F(n1,n2)=Ax(n1,n2)+Bx(n1+1,n2)+Cx(n1-1,n2)+Dx(n1,n2+1)+Ex(n1,n2-1)

for n1+n2<N (where 0<n1,n2)

and

F(n1,n2)=Ax(n1,n2)

Example

For n1+n2<=2
F(0,0)=Ax(0,0)+Bx(1,0)+Dx(0,1)
F(1,0)=Ax(1,0)+Cx(0,0)+Bx(2,0)+Dx(1,1)
F(0,1)=Ax(0,1)+Ex(0,0)+Bx(1,1)+Dx(0,2)
F(1,1)=Ax(1,1)
F(0,2)=Ax(0,2)
F(2,0)=Ax(2,0)
We do not write code for others here. You are welcome to post your attempt at writing the program, and we can assist if you get errors or incorrect results.

Otherwise, if you want to hire someone to do the task for you, this thread will be moved to Jobs subforum.
We don't want to see some one offering homework as a job either.
Be aware that your professor probably uses this site and will notice.