Post Reply 
Creating an equation library (Updated 03-FEB-2017)
01-19-2015, 01:52 AM (This post was last modified: 01-21-2015 04:45 PM by compsystems.)
Post: #33
RE: Creating an equation library (updated)
Another option is to create a version SVD, I extracted the source code of (SVD MathTools TI 89) With tiedit http://home.arcor.de/p-engels/tiedit/
/!\
© = COMMENT
TM = TRANSPOSE
Code:
SVD(mm)
Func
©SVD(mat) computes the singular value decomposition of numeric matrix mat
©Bhuvanesh Bhatt
Local mm2,eps,evl,evc,isxact,nzevl,tmp,tmp2,tmp3,ss,uuu,vvv
dim(mm)→tmp2
inString(string(mm),".")=0→isxact
mm TM*mm→mm2
If not isxact Then
  real(eigVl(mm2))→evl
  ©"If dim(evl)>max(tmp2[1],tmp2[2]) Then:mm*(mm)TM→mm2:real(eigVl(mm2))→evl:EndIf"
  when(getType(tol)="NUM",tol,5.E­13,5.E­13)→eps
  ©"seq(when(real(evl[ii])<eps,0,real(evl[ii]),real(evl[ii]))+when(imag(evl[ii])<eps,0,imag(evl[ii]),imag(evl[ii]))*tm,ii,1,dim(evl))→evl"
  conj(eigVc(mm2))→evc
Else
  mathtool\eigenval(mm2)→evl
  0→eps
  conj(mathtool\gschmidt(mathtool\eigenvec(mm2)))TM→evc
EndIf
Σ(when(abs(evl[ii])>eps,1,0,1),ii,1,dim(evl))→nzevl
mathtool\reverse(mathtool\sort(seq(augment({evl[ii]},mat▸list(evc[ii])),ii,1,dim(evl))))→tmp
subMat(tmp,1,2)→vvv
seq(tmp[ii,1],ii,1,rowDim(tmp))→evl
√(left(evl,min(tmp2[1],tmp2[2])))→tmp3
diag(tmp3)→ss
seq(mat▸list(tmp3[ii]^(­1)*mm*conj(vvv[ii])),ii,1,nzevl)→uuu
If tmp2[1]>nzevl
  augment(uuu;subMat(identity(colDim(uuu)),1,1,tmp2[1]-nzevl,colDim(uuu)))→uuu
conj(mathtool\gschmidt(uuu TM))→uuu
If tmp2[1]>tmp2[2] Then
  seq(seq(0,jj,1,tmp2[2]),ii,1,tmp2[1]-tmp2[2])→tmp3
  If getType(tmp3)="LIST"
    {tmp3}→tmp3
  augment(ss;tmp3)→ss
EndIf
If tmp2[1]<tmp2[2] Then
  seq(seq(0,jj,1,tmp2[2]-tmp2[1]),ii,1,tmp2[1])→tmp3
  If getType(tmp3)="LIST"
    {tmp3}→tmp3
  augment(ss,tmp3)→ss
EndIf
©if rowdim(vvv)≠coldim(vvv) or rowdim(vvv)≠tmp2[2] or rowdim(uuu)≠coldim(uuu) or rowdim(uuu)≠tmp2[1] or dim(ss)≠tmp2
return "Error: Final matrix structure inconsistent. Please report to the author."
{uu=uuu,ΣΣ=ss,vv=conj(vvv)}
EndFunc

MathTools Guide

http://www.ibiblio.org/technicalc/packag...hTools.pdf

/////////

PD: A help from the community would be create a form to add equations, as doing FORMULAPRO for TInspire calculators

FormulaPro Project Home Page

http://tiplanet.org/forum/viewtopic.php?t=9576

[Image: ZaqAY.jpg]

FormulaPro Creator Home Page

http://education.bwns.be/FormulaPro/
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Creating an equation library - Han - 01-10-2015, 03:45 AM
RE: Creating an equation library (updated) - compsystems - 01-19-2015 01:52 AM



User(s) browsing this thread: 5 Guest(s)