# Algebraic System of Equations

**URL:** <https://community.freefem.org/t/algebraic-system-of-equations/2904>\
**Category:** General Discussion\
**Created:** [January 24, 2024, 8:22pm UTC](https://community.freefem.org/t/algebraic-system-of-equations/2904 "2024-01-24T20:22:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![karligor](https://avatars.discourse-cdn.com/v4/letter/k/f08c70/32.png) [@karligor](https://community.freefem.org/u/karligor)\
**Post date:** [January 24, 2024, 8:22pm UTC](https://community.freefem.org/t/algebraic-system-of-equations/2904/1 "2024-01-24T20:22:39Z")

</div>

Hello dear colleagues. I hope someone can help me.  
I am solving a linear parabolic PDE on two variables, say, u1(x,t) and u2(x,t).  
Then, for each node i want to calculate new quantities that depend on the values of u1 and u2. Those quantities are the solution of a nonlinear system of algebraic equations.  
My code already solves perfectly de PDE itself but as i am not a good programmer, i don’t know how to write matrices and vectors of u1,u2 ( and its gradient) in C++ in order to perform a Newton method.  
I want to do something like:

F = [f1(u1,u2) , f2(u1,u2)];  
J = [df1/du1, df1/du2; df2/du1, df2/du2];  
dU = solve(F, -J);  
u1 = u1 + du1;  
u2 = u2 + du2;

Thank you very much.

Karl
