Changeset c948324 in git
 Timestamp:
 Dec 15, 2000, 1:08:46 PM (22 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
 Children:
 edef3080503be9dafb0b4d33562cb634ef9d50a8
 Parents:
 116c0963c62cef54596fdf23c8b1827f59377a05
 Location:
 Singular/LIB
 Files:

 1 deleted
 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/ntsolve.lib
r116c09 rc948324 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: ntsolve.lib,v 1. 6 20000706 13:32:25 pohlExp $";2 version="$Id: ntsolve.lib,v 1.7 20001215 12:08:46 Singular Exp $"; 3 3 info=" 4 4 LIBRARY: ntsolve.lib ONE REAL SOLUTION OF POLYNOMIAL SYSTEMS (NEWTON ITERATION) 5 AUTHOR: Wilfred Pohl, email: pohl@mathematik.unikl.de 5 AUTHORS: Wilfred Pohl, email: pohl@mathematik.unikl.de 6 Dietmar Hillebrand 6 7 7 8 PROCEDURES: 8 nt_solve(i,..); find one real root of 0dimensional ideal 9 nt_solve(G,..); find one real root of 0dimensional ideal G 10 triMNewton(G,..); find one real root for 0dim. triangular system G 9 11 "; 10 12 /////////////////////////////////////////////////////////////////////////////// … … 233 235 /////////////////////////////////////////////////////////////////////////////// 234 236 235 // End: *** 237 /////////////////////////////////////////////////////////////////////////////// 238 // solver.lib // 239 // algorithms for solving algebraic system of dimension zero // 240 // written by Dietmar Hillebrand and ... // 241 // // 242 /////////////////////////////////////////////////////////////////////////////// 243 244 245 246 /////////////////////////////////////////////////////////////////////////////// 247 // 248 // Multivariate Newton for triangular systems 249 // 250 // 251 /////////////////////////////////////////////////////////////////////////////// 252 253 proc triMNewton (ideal G, list a, number err, int itb) 254 "USAGE: triMNewtion(G,a,err,itb); 255 ideal G=g1,..,gn, a triangular system 256 in n vars, i.e gi=gi(var(ni+1),..,var(n)); 257 list of numbers a, an approximation of a common zero of G, 258 (a[i] to be substituted in var(i)); 259 number err, an error bound; 260 int itb, the maximal number of iterations performed. 261 RETURN: an improved approximation for a common zero of G; 262 EXAMPLE: example triMNewton; shows an example 263 " 264 { 265 if (itb == 0) 266 { 267 dbprint("iteration bound performed!"); 268 return(a); 269 } 270 271 int i,j,k; 272 ideal p=G; 273 matrix J=jacob(G); 274 list h; 275 poly hh; 276 int fertig=1; 277 int n=nvars(basering); 278 279 for (i = 1; i <= n; i++) 280 { 281 for (j = n; j >= ni+1; j) 282 { 283 p[i] = subst(p[i],var(j),a[j]); 284 for (k = n; k >= ni+1; k) 285 { 286 J[i,k] = subst(J[i,k],var(j),a[j]); 287 } 288 } 289 if (J[i,ni+1] == 0) 290 { 291 print("Error: ideal not radical!"); 292 return(); 293 } 294 295 // solve linear equations 296 hh = p[i]; 297 for (j = n; j >= ni+2; j) 298 { 299 hh = hh  J[i,j]*h[j]; 300 } 301 h[ni+1] = number(hh/J[i,ni+1]); 302 } 303 304 for (i = 1; i <= n; i++) 305 { 306 if ( abs(h[i]) > err) 307 { 308 fertig = 0; 309 break; 310 } 311 } 312 if ( not fertig ) 313 { 314 for (i = 1; i <= n; i++) 315 { 316 a[i] = a[i] + h[i]; 317 } 318 return(triMNewton(G,a,err,itb1)); 319 } 320 else 321 { 322 return(a); 323 } 324 } 325 example 326 { "EXAMPLE:"; echo = 2; 327 ring r=real,(z,y,x),(lp); 328 ideal i=x^21,y^2+x43,z2y4+x1; 329 list a=2,3,4; 330 number e=1.0e10; 331 332 list l = triMNewton(i,a,e,20); 333 l; 334 } 335 336 337 //////////////////////////////////////////////////////////////////////////////// 338 339 static proc abs( number r) 340 { 341 if (r >= 0) 342 { 343 return(r); 344 } 345 else 346 { 347 return(r); 348 } 349 } 350
Note: See TracChangeset
for help on using the changeset viewer.