User Portlet
Discussions |
---|
Those statements create the lists to hold the alpha and beta values. Without those statements those lists don't exist and you'll then get errors such as Set::noval: Symbol alpha in part assignment does not have an immediate value. >> ... |
Hi All, I want to find dominant eigenvalue using Power Method. I could not figure out how to find number of iteration.. Is there anyway to count number of output after run the code? This is my code to solve the problem that attached (power... |
It does what you requested, that is, sues fewer iterations (factor of 10). Also each iteration does less work (fewer matrix-times-vector products). Here is the full code I used. n = 5; amat = HilbertMatrix[n]; b = amat.ConstantArray[1,... |
An alternative is to bake the length into the function. X[{j_, k_}] := {j + 1, BGS.k + Inverse[DD - EE].b} NestWhile[X, {0, X0}, (Norm[b - A.#[[2]]]/Norm[b] > 10^(-10)) &] (* Out[137]= {27, {1.00000000003,... |
This is it.. Thanks a lot Christopher and thanks the other repliers , you saved my life.. Selahittin.. |
Here's the file and code: [mcode](* Konstanten *) m = 4*1.672621777*10^-27;(* Masse Alpha-Teilchen *) e = 1.60218 * 10^-19 ; (* Elementarladung *) z = 79 ;(* Ordnungszahl Gold *) r = 4*Pi*8.854*10^-12; (* 4 Pi Epsilon Null *) (* Variablen *) ... |
I have come up with new version of my code. Man this is much much faster. It takes a Just second.. |
Show[{Plot[x^2, {x, -1, 1}], ListPlot[Table[{x, 2 x}, {x, 0, 1, .1}]], Graphics[{Circle[]}] }]I gues this is the right one..[mcode]Plot[x^2, {x, -1, 1}, Epilog -> {Inset[ListPlot[Table[{x, 2 x}, {x, 0, 1.1}]]], ... |
This code is setting up finite differences that are being used. For more information on ListCorrelate, please see the documentation for the function:... |
Thanks. I have found a way to do that. I have added table in plot code..[mcode]Table[ParametricPlot3D[ Evaluate[Table[{i*h, t, First[Subscript[u, i][t] /. lines /. A]}, {i, 0, n}]], {t, 0, 1000}, PlotRange -> All, AxesLabel ->... |