Thank you Georgio, this works and it is exactly what I was looking for.
What about secont part of my thread. Does anyone knows how to derivative equation with coefficients which contains elements which should be derivative. It means that the function or command should looks through the whole document what actually the equation contains.
David
"Georgios" <gkokovid@yahoo.com> wrote in message <hekb1j$9ub$1@fred.mathworks.com>...
> "David " <d.appelfeld@gmail.com> wrote in message <hek2r6$fff$1@fred.mathworks.com>...
> > Hi All,
> > I would like to solve problem of four nonlinear equations with 4 unknown by NewtonRaphson's method. I understand the method since it is not difficult, but my problem is how to differentiate the equations in Matlab. So far I have been using 'syms' and then 'diff' this works perfectly and it gives me a differential of the equation. But I don't know how to use obtained equation and how to feed them by actual numbers. For example one of my functions is :
> >
> > F1 = (Tin  Ts_in) * h_rad_in + (Tin  Ts_in) * h_conv_in  (Ts_in  Ts_cav_in) * 1./Rm_in;
> >
> > then I derivative F1 , for example, by Ts_in, so I will get:
> >
> > F1' = h_rad_in  h_conv_in  1/Rm_in.
> >
> > and here I finish and don't know how to get the F1'. I know all the coefficients but the functions is probably still symbolic and does not substitute all symbolic variable by number, for example Rm_in by 15, etc.
> > I assume that there should be easy solution of this just by using some builtin matlab function, but I dont know how to turn it back to use number instead of symbols.
> >
> > Another think is that h_rad_in is actually coefficient which contains also Ts_in:
> >
> > h_rad_in = emis_res_in*SB*(Ts_in^4Troom^4)/(Ts_inTroom)
> >
> > , therefore the derivation of F1' as I wrote above is probably not correct. Is in matlab possible to differentiate the function in the way that it looks what the coefficients actually contains? As far as I understand this I should not use 'syms' since it will treat the coefficient only as variable symbol.
> >
> > I can of course write all the derivations of the functions manually and then just by NewtonRaphson's metnod to get all the roots correctly but I am more curious about this and would like to know it for my further work since it will be probably more complex than just 4 nonlinear equations. I hope that I used correct therms and that you will understand.
> >
> > Thank you for all suggestions and advices
> > David
>
> See the help file for the "subs" command. The link takes you to the Mathworks site.
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/symbolic/subs.html
>
> Regards,
> Georgios
