help-octave
[Top][All Lists]

## solving non-linear set of equations

 From: Fritz Fischer Subject: solving non-linear set of equations Date: Wed, 28 Sep 2011 12:50:21 +0200

Hello,

I need to solve a set of non-linear equations and home
that you can help me.

The original plan is to write a function that recieves some
variables:

---
T_ambient_kelvin = 334
T_sky_kelvin = 273
...

...

end
---

I want to solve a set of non-linear equations within
this function. My plan was to use the following
directly from the function above, but this
does not seem to work.

----
function y = myfun(x)

y(1) = x(3) -(( x(1) - T_ambient_kelvin ) * h_conv * area_pv_cell)
y(2) = x(4) - (( x(1)^4 - T_sky_kelvin^4) * h_pv_front_rad * area_pv_cell)
y(3) = x(5) - ((x(1) - x(2)) * thermal_conductivity_pv_cell * area_pv_cell)
y(4) = x(6) - (( x(2) - T_ambient_kelvin ) * h_conv * area_pv_cell)
y(5) = S_in - (x(3) + x(4) + x(5))
y(6) = x(5) - x(6)

end

[x, info] = fsolve ("myfun", [10; 10; 10; 10; 10;10])

---

I read somewhere that I have to create a single file with myfunc. Is this
correct? Or is there a way to use this from within the function heat_flux ?

If there is a way to use it from within, is it allowed to call the variables
like T_sky_kelvin or T_ambient_kelvin ?

If not, how do I pass the functions to myfun if i call is using

[x, info] = fsolve ("myfun", [10; 10; 10; 10; 10;10])

Or am I doing something completly wrong??

Kind regards,
Walter