2nd order gradient
    34 vues (au cours des 30 derniers jours)
  
       Afficher commentaires plus anciens
    
Assuming I have a function  where
where  is a
 is a  vector. Is there a method that I can use system equation to obtain
vector. Is there a method that I can use system equation to obtain 
 where
where  is a
 is a  vector. Is there a method that I can use system equation to obtain
vector. Is there a method that I can use system equation to obtain 
0 commentaires
Réponses (1)
  KSSV
      
      
 le 18 Mai 2021
        Let b be your N*1 vector and f be your function values evealuated and of size N*1. 
df = gradient(f,b) ;  % first derivative 
d2f = gradient(df,b) ;  % second order gradient 
The above is one method. Also you can evaluate the second derivative of f w.r.t. b and then you can substitute the values of b at the end. 
Example:
syms b 
f = 3*b^2+2*b+5 ;
d2f = diff(f,b,2)
7 commentaires
  KSSV
      
      
 le 18 Mai 2021
				The variable g is 4*1. Run gradient i.e. gg for each element. 
gg = gradient(g(1), b);
Voir également
Catégories
				En savoir plus sur Calculus dans Help Center et File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


