Skip to content

Commit

Permalink
test doc
Browse files Browse the repository at this point in the history
  • Loading branch information
mongibellili committed Jun 11, 2024
1 parent 95a85b3 commit 2ab9c3f
Show file tree
Hide file tree
Showing 84 changed files with 2,558 additions and 171 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
2 changes: 1 addition & 1 deletion src/Common/QSSNLdiscrProblem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ dDVect = [[5, 2, 3, 4, 1], [5, 1]] =#



if VERBOSE println("discrete problem created") end

myodeProblem = NLODEDiscProblem(fname,Val(1),Val(T),Val(Z),Val(D),Val(num_cache_equs),initCond, discrVars, jacVect ,ZCjac ,functioncodeF, evsArr,SDVect,HZ,HD,SZvect,exacteJacfunctionF)

Expand Down
2 changes: 1 addition & 1 deletion src/Common/SolutionPlot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function getPlot(sol::Sol{T,O}) where{T,O}
p1
end
function getPlot(sol::Sol{T,O},k::Int) where{T,O}
p1=plot!(sol.savedTimes[k], sol.savedVars[k],marker=(:circle),markersize=2,#= title="$(sol.sysName)_$(sol.algName)_$(sol.absQ)_$(sol.simulStepCount) ", =#label="x$index ")
p1=plot!(sol.savedTimes[k], sol.savedVars[k],marker=(:circle),markersize=2,#= title="$(sol.sysName)_$(sol.algName)_$(sol.absQ)_$(sol.simulStepCount) ", =#label="x$k ")
end
function getPlot!(sol::Sol{T,O}) where{T,O}
p1=plot!(title="$(sol.sysName)")
Expand Down
8 changes: 7 additions & 1 deletion src/Interface/QSS_Solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ function custom_Solve(prob::NLODEProblem{PRTYPE,T,Z,D,CS},al::QSSAlgorithm{Solve
else
liqssdata=createLiqssData(prob,Val(Sparsity),Val(T),Val(Order))
specialLiqssData=createSpecialLiqssData(Val(T))
if VERBOSE println("begin dispatch on liqss algorithm") end
#integrate()
integrate(al,commonQSSdata,liqssdata,specialLiqssData,prob)
integrate(al,commonQSSdata,liqssdata,specialLiqssData,prob,prob.eqs,jac,SD,prob.exactJac)
#= if Solver==:nmliqss
nmLiQSS_integrate(commonQSSdata,liqssdata,specialLiqssData,prob,prob.eqs,jac,SD,prob.exactJac)
Expand Down Expand Up @@ -55,6 +58,7 @@ function custom_Solve(prob::NLODEProblem{PRTYPE,T,Z,D,CS},al::QSSAlgorithm{Solve
#helper methods...not to be touched...extension can be done through creating others via specializing on one PRTYPE or more of the symbols (PRTYPE,T,Z,D,Order) if in the future...
#################################################################################################################################################################################
function createCommonData(prob::NLODEProblem{PRTYPE,T,Z,D,CS},::Val{Order},finalTime::Float64,saveat::Float64,initialTime::Float64,abstol::Float64,reltol::Float64,maxErr::Float64)where{PRTYPE,T,Z,D,CS,Order}
if VERBOSE println("begin create common data") end
quantum = zeros(T)
x = Vector{Taylor0}(undef, T)
q = Vector{Taylor0}(undef, T)
Expand Down Expand Up @@ -90,7 +94,7 @@ function createCommonData(prob::NLODEProblem{PRTYPE,T,Z,D,CS},::Val{Order},final
for i=1:CS
push!(taylorOpsCache,Taylor0(zeros(Order+1),Order))
end

if VERBOSE println("END create common data") end
commonQSSdata= CommonQSS_data(quantum,x,q,tx,tq,d,nextStateTime,nextInputTime ,nextEventTime , t, integratorCache,taylorOpsCache,finalTime,saveat, initialTime,abstol,reltol,maxErr,savedTimes,savedVars)
end

Expand All @@ -100,6 +104,7 @@ end

#no sparsity
function createLiqssData(prob::NLODEProblem{PRTYPE,T,Z,D,CS},::Val{false},::Val{T},::Val{Order})where{PRTYPE,T,Z,D,CS,Order}
if VERBOSE println("begin create Liqss data") end
a = Vector{Vector{Float64}}(undef, T)
# u=Vector{Vector{MVector{Order,Float64}}}(undef, T)
qaux = Vector{MVector{Order,Float64}}(undef, T)
Expand All @@ -119,6 +124,7 @@ function createLiqssData(prob::NLODEProblem{PRTYPE,T,Z,D,CS},::Val{false},::Val{
olddxSpec[i]=zeros(MVector{Order,Float64})

end
if VERBOSE println("END create Liqss data") end
liqssdata= LiQSS_data(Val(false),a#= ,u =#,qaux,olddx,dxaux,olddxSpec)
end

Expand Down
2 changes: 1 addition & 1 deletion src/Interface/indexMacro.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


#macro NLodeProblem(odeExprs)
function NLodeProblem(odeExprs)
Base.remove_linenums!(odeExprs)
if VERBOSE println("starting prob parsing...") end
Expand Down
8 changes: 4 additions & 4 deletions src/QuantizedSystemSolver.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ import Base: sqrt, exp, log, sin, cos, sincos, tan,

# integrator

include("dense/NL_integrators/NL_QSS_Integrator.jl")
include("dense/NL_integrators/NL_QSS_discreteIntegrator.jl")
# include("dense/NL_integrators/NL_QSS_Integrator.jl")
# include("dense/NL_integrators/NL_QSS_discreteIntegrator.jl")
# implicit integrator when large entries on the main diagonal of the jacobian
# include("dense/NL_integrators/NL_LiQSS_Integrator.jl")
# include("dense/NL_integrators/NL_LiQSS_discreteIntegrator.jl")
# implicit integrator when large entries NOT on the main diagonal of the jacobian

include("dense/NL_integrators/NL_nmLiQSS_Integrator.jl")
# include("dense/NL_integrators/NL_nmLiQSS_Integrator.jl")
include("dense/NL_integrators/NL_nmLiQSS_discreteIntegrator.jl")


#implicit intgrators used to show improvement of modifications
include("dense/NL_integrators/NL_mLiQSS_Integrator.jl")
# include("dense/NL_integrators/NL_mLiQSS_Integrator.jl")
# include("dense/NL_integrators/NL_nLiQSS_Integrator.jl")

include("dense/Quantizers/Quantizer_Common.jl")
Expand Down
10 changes: 5 additions & 5 deletions src/dense/NL_integrators/NL_QSS_discreteIntegrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@ while simt<ft && totalSteps < 50000000

end#end state/input/event
if stepType != :ST_EVENT
#= push!(savedVars[index],x[index][0])
push!(savedTimes[index],simt) =#
push!(savedVars[index],x[index][0])
push!(savedTimes[index],simt)

for i =1:T
#= for i =1:T
push!(savedVars[i],x[i][0])
push!(savedTimes[i],simt)
end
end =#
else
#if needSaveEvent
for j in (HD[modifiedIndex])
Expand All @@ -230,7 +230,7 @@ while simt<ft && totalSteps < 50000000

end#end while

@show countEvents,totalSteps
#@show countEvents,totalSteps


createSol(Val(T),Val(O),savedTimes,savedVars, "qss$O",string(odep.prname),absQ,totalSteps,0,countEvents,numSteps,ft)
Expand Down
6 changes: 3 additions & 3 deletions src/dense/NL_integrators/NL_mLiQSS_Integrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ function mLiQSS_integrate(Al::QSSAlgorithm{:nmliqss,O},CommonqssData::CommonQSS_
savedVarsQ = Vector{Vector{Float64}}(undef, T)
savedVarsQ[1]=Vector{Float64}() ;savedVarsQ[2]=Vector{Float64}()
cacherealPosi=Vector{Vector{Float64}}(undef,3);cacherealPosj=Vector{Vector{Float64}}(undef,3);
for i =1:3
for i =1:3
cacherealPosi[i]=zeros(2)
cacherealPosj[i]=zeros(2)
end
end
exacteA(q,cacheA,1,1) # this 'unnecessary call' 'compiles' the function and it helps remove allocations when used after !!!

#@show exacteA
Expand Down Expand Up @@ -220,7 +220,7 @@ end

end#end while

#@show temporaryhelper
#@show temporaryhelper
#= @timeit "createSol" =#
createSol(Val(T),Val(O),savedTimes,savedVars, "mLiqss$O",string(odep.prname),absQ,totalSteps,simulStepCount,0,numSteps,ft)
#createSol(Val(T),Val(O),savedTimes,savedVars,savedVarsQ, "mliqss$O",string(odep.prname),absQ,totalSteps#= ,totalStepswhenCycles =#,simulStepCount,numSteps,ft)
Expand Down
43 changes: 25 additions & 18 deletions src/dense/NL_integrators/NL_nmLiQSS_discreteIntegrator.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#using TimerOutputs
function integrate(Al::QSSAlgorithm{:nmliqss,O},CommonqssData::CommonQSS_data{Z},liqssdata::LiQSS_data{O,false},specialLiqssData::SpecialLiqssQSS_data, odep::NLODEProblem{PRTYPE,T,Z,D,CS}) where {PRTYPE,O,T,Z,D,CS}
if VERBOSE println("begining of intgrate dummy function") end
end
function integrate(Al::QSSAlgorithm{:nmliqss,O},CommonqssData::CommonQSS_data{Z},liqssdata::LiQSS_data{O,false},specialLiqssData::SpecialLiqssQSS_data, odep::NLODEProblem{PRTYPE,T,Z,D,CS},f::Function,jac::Function,SD::Function,exactA::Function) where {PRTYPE,O,T,Z,D,CS}
if VERBOSE println("begining of intgrate function") end
cacheA=specialLiqssData.cacheA
ft = CommonqssData.finalTime;initTime = CommonqssData.initialTime;relQ = CommonqssData.dQrel;absQ = CommonqssData.dQmin;maxErr=CommonqssData.maxErr;

Expand All @@ -12,7 +16,9 @@ function integrate(Al::QSSAlgorithm{:nmliqss,O},CommonqssData::CommonQSS_data{Z}
#*********************************problem info*****************************************
d = CommonqssData.d


#= exactA=odep.exactJac
f=odep.eqs
if VERBOSE println("after function declare") end =#
zc_SimpleJac=odep.ZCjac

HZ=odep.HZ
Expand Down Expand Up @@ -50,14 +56,21 @@ for i =1:4*O-1 #3
acceptedi[i]=[0.0,0.0]#zeros(2)
acceptedj[i]=[0.0,0.0]#zeros(2)
end

#@show exactA
exactA(q,d,cacheA,1,1,initTime+1e-9)

#@show f
f(1,-1,-1,q,d, t ,taylorOpsCache)

trackSimul = Vector{Int}(undef, 1)
# cacheRatio=zeros(5);cacheQ=zeros(5)
#********************************helper values*******************************

oldsignValue = MMatrix{Z,2}(zeros(Z*2)) #usedto track if zc changed sign; each zc has a value and a sign
numSteps = Vector{Int}(undef, T)
#######################################compute initial values##################################################
if VERBOSE println("before x init") end
n=1
for k = 1:O # compute initial derivatives for x and q (similar to a recursive way )
n=n*k
Expand All @@ -69,7 +82,7 @@ for k = 1:O # compute initial derivatives for x and q (similar to a recursive wa
x[i].coeffs[k+1] = (integratorCache.coeffs[1]) / n # /fact cuz i will store der/fac like the convention...to extract the derivatives (at endof sim) multiply by fac derderx=coef[3]*fac(2)
end
end

if VERBOSE println("after init") end
for i = 1:T
numSteps[i]=0
#savedDers[i]=Vector{Float64}()
Expand All @@ -79,22 +92,10 @@ for i = 1:T

quantum[i] = relQ * abs(x[i].coeffs[1]) ;quantum[i]=quantum[i] < absQ ? absQ : quantum[i];quantum[i]=quantum[i] > maxErr ? maxErr : quantum[i]

updateQ(Val(O),i,x,q,quantum,exactA,d,cacheA,dxaux,qaux,tx,tq,initTime+1e-9,ft,nextStateTime) #1e-9 exactAfunc contains 1/t
updateQ(Val(O),i,x,q,quantum,exactA,d,cacheA,dxaux,qaux,tx,tq,initTime+1e-12,ft,nextStateTime) #1e-9 exactAfunc contains 1/t
end
#= for i = 1:T
clearCache(taylorOpsCache,Val(CS),Val(O));f(i,-1,-1,q,d,t,taylorOpsCache);
computeDerivative(Val(O), x[i], taylorOpsCache[1])#0.0 used to be elapsed...even down below not neeeded anymore
Liqss_reComputeNextTime(Val(O), i, initTime, nextStateTime, x, q, quantum)
computeNextInputTime(Val(O), i, initTime, 0.1,taylorOpsCache[1] , nextInputTime, x, quantum)#not complete, currently elapsed=0.1 is temp until fixed
#prevStepVal[i]=x[i][0]#assignXPrevStepVals(Val(O),prevStepVal,x,i)
end =#


#assignXPrevStepVals(Val(O),prevStepVal,x,i)



#@show nextStateTime,nextInputTime
if VERBOSE println("after initial updateQ") end
for i=1:Z
clearCache(taylorOpsCache,Val(CS),Val(O)); f(-1,i,-1,x,d,t,taylorOpsCache)
oldsignValue[i,2]=taylorOpsCache[1][0] #value
Expand All @@ -109,6 +110,7 @@ end
####################################################################################################################################################################
simt = initTime ;totalSteps=0;prevStepTime=initTime;modifiedIndex=0; countEvents=0;inputstep=0;statestep=0;simulStepCount=0
ft<savetime && error("ft<savetime")
if VERBOSE println("start integration") end
while simt< ft && totalSteps < 50000000

sch = updateScheduler(Val(T),nextStateTime,nextEventTime, nextInputTime)
Expand All @@ -122,7 +124,7 @@ while simt< ft && totalSteps < 50000000

t[0]=simt

DEBUG_time=DEBUG && #= (29750 <=totalSteps<=29750) =# (0.0003557 <=simt<=0.0003559 )
DEBUG_time=DEBUG && #= (29750 <=totalSteps<=29750) =# #= (0.0003557 <=simt<=0.0003559 ) =# simt==1.0323797751288692e-9
##########################################state########################################
if stepType == :ST_STATE
statestep+=1
Expand All @@ -145,7 +147,10 @@ while simt< ft && totalSteps < 50000000

quantum[index] = relQ * abs(x[index].coeffs[1]) ;quantum[index]=quantum[index] < absQ ? absQ : quantum[index];quantum[index]=quantum[index] > maxErr ? maxErr : quantum[index]

#if abs(x[index].coeffs[2])>1e9 quantum[index]=10*quantum[index] end # i added this for the case a function is climbing (up/down) fast
#= if abs(x[index].coeffs[2])>1e9
quantum[index]=10*quantum[index]
@show simt, index,x[index]
end =# # i added this for the case a function is climbing (up/down) fast



Expand Down Expand Up @@ -180,6 +185,8 @@ while simt< ft && totalSteps < 50000000
cacherealPosj[i][1]=0.0; cacherealPosj[i][2]=0.0
end =#
# @show aij,aji
#= test=false
if test =#
if nmisCycle_and_simulUpdate(cacheRootsi,cacheRootsj,acceptedi,acceptedj,aij,aji,respp,pp,trackSimul,Val(O),index,j,dirI,firstguess,x,q,quantum,exactA,d,cacheA,dxaux,qaux,tx,tq,simt,ft)
simulStepCount+=1

Expand Down
2 changes: 2 additions & 0 deletions src/dense/Quantizers/LiQSS_quantizer2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ function Liqss_reComputeNextTime(::Val{2}, i::Int, simt::Float64, nextStateTime:
β=0
if abs(q-x) >= 2*quani # this happened when var i and j s turns are now...var i depends on j, j is asked here for next time...or if you want to increase quant*10 later it can be put back to normal and q & x are spread out by 10quan
nextStateTime[i] = simt+1e-12
# @show simt,i,q-x,quani,q,x

#= if simt==2.500745083181994e-5
println("quantizer-recomputeNext: abs(q-x) >= 2*quani")
@show simt,i,x,q,abs(q-x),quani
Expand Down
8 changes: 4 additions & 4 deletions src/dense/Quantizers/mLiQSS_quantizer2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@ function nmisCycle_and_simulUpdate(cacheRootsi::Vector{Float64},cacheRootsj::Vec
αidir=xi1+hi*xi2/2
βj=xj1+hj*xj2/2
########condition:Union
#= if (abs(dxj-xj1)>(abs(dxj+xj1)/2) || abs(ddxj-xj2)>(abs(ddxj+xj2)/2)) || dqjplus*newDiff<0.0 #(dqjplus*qj1)<=0.0 with dir is better since when dir =0 we do not enter
if (abs(dxj-xj1)>(abs(dxj+xj1)/2) || abs(ddxj-xj2)>(abs(ddxj+xj2)/2)) || dqjplus*newDiff<0.0 #(dqjplus*qj1)<=0.0 with dir is better since when dir =0 we do not enter

if (abs(dxi-xi1)>(abs(dxi+xi1)/2) || abs(ddxi-xi2)>(abs(ddxi+xi2)/2)) || βidir*dirI<0.0
iscycle=true
end
end =#
end
########condition:Union i
#= if (abs(dxj-xj1)>(abs(dxj+xj1)/2) || abs(ddxj-xj2)>(abs(ddxj+xj2)/2)) || dqjplus*newDiff<0.0 #(dqjplus*qj1)<=0.0 with dir is better since when dir =0 we do not enter
Expand All @@ -101,7 +101,7 @@ function nmisCycle_and_simulUpdate(cacheRootsi::Vector{Float64},cacheRootsj::Vec
########condition:combineDer Union i


if abs(βjdir-βj)>(abs(βjdir+βj)/2) || dqjplus*newDiff<0.0
#= if abs(βjdir-βj)>(abs(βjdir+βj)/2) || dqjplus*newDiff<0.0
if abs(βidir-βidth)>(abs(βidir+βidth)/2) || βidir*dirI<0.0
iscycle=true
Expand All @@ -113,7 +113,7 @@ function nmisCycle_and_simulUpdate(cacheRootsi::Vector{Float64},cacheRootsj::Vec
#= if abs(βidir-αidir)>(abs(βidir+αidir)/2)
iscycle=true
end =#
end
end =#


if (ddxithrow>0 && dxithrow<0 && qi1>0) || (ddxithrow<0 && dxithrow>0 && qi1<0)
Expand Down
15 changes: 8 additions & 7 deletions test/systemsTests/commonTests/globalTest_ord1tol-2-5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
using QuantizedSystemSolver
#using XLSX
#using BenchmarkTools
using BSON
#using BSON
#using TimerOutputs
#using Plots
function test(case,solvr)
absTol=1e-5
relTol=1e-2
odeprob = @NLodeProblem begin
odeprob = NLodeProblem(
quote
#sys b53
name=(sysb53,)
u = [-1.0, -2.0]
du[1] = -20.0*u[1]-80.0*u[2]+1600.0
du[2] =1.24*u[1]-0.01*u[2]+0.2
end
end )
# @show odeprob.prname
u1, u2 = -8.73522174738572, -7.385745994549763
λ1, λ2 = -10.841674966758294, -9.168325033241706
Expand All @@ -29,7 +30,7 @@ function test(case,solvr)
tspan=(0.0,100.0)
solnmliqss=solve(odeprob,solvr,abstol=absTol,saveat=0.01,reltol=relTol,tspan#= ,maxErr=10000*relTol =#)
@show solnmliqss.totalSteps
# save_Sol(solnmliqss,note="xi10dxi")
save_Sol(solnmliqss,note="xi10dxi")

solnmliqssInterp=solInterpolated(solnmliqss,0.01)
er1=getError(solnmliqssInterp,1,x1)
Expand All @@ -39,7 +40,7 @@ function test(case,solvr)
@show resnmliqss1E_2



#=
BSON.@load "ref_bson/solVect_Tyson_Rodas5Pe-12.bson" solRodas5PVectorTyson
odeprob = @NLodeProblem begin
name=(tyson,)
Expand Down Expand Up @@ -103,7 +104,7 @@ function test(case,solvr)
# ttnmliqss=@belapsed solve($prob,$solvr,abstol=$absTol,saveat=0.01,reltol=$relTol,tspan)
resnmliqss12E_2= ("$(solnmliqss.algName)",relTol,err4,solnmliqss.totalSteps,solnmliqss.simulStepCount,ttnmliqss)
@show resnmliqss12E_2

=#


#= XLSX.openxlsx("3sys $(solvr)_$(case)_$(relTol).xlsx", mode="w") do xf
Expand All @@ -121,5 +122,5 @@ function test(case,solvr)
end

case="order1_"
test(case,nmliqss2())
test(case,qss2())
#test(case,nmliqss2())
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Symbolics, LinearAlgebra
import Base.:+
+(a::T, b::Vector{T}) where {T <:Union{Float64,Num}}=a+b[1]
@show 2
@variables x,il1,il2,il3,il4,il5,il6,il7,il8,il9,il10,rd1,rd2,rd3,rd4,rd5,rd6,rd7,rd8,rd9,rd10,rr,rpr,v,is1,is2,is3,is4,is5,is6,is7,is8,is9,is10,Il
b=4.2e-3+0.453*x;a=5.1+4.2e-3+0.453*x ;λ=a-b;u=[b;b;b;b;b;b;b;b;b;b];vec=[1 1 1 1 1 1 1 1 1 1]
mm=I/λ-(u*vec)/*+vec*u))
#display(mm)
C=[-(rd1+3.88e-3)*il1-(rr+rpr+0.453e-6*v)*Il+rd1*is1;-(rd2+3.88e-3)*il2-(rr+rpr+0.453e-6*v)*Il+rd2*is2;-(rd3+3.88e-3)*il3-(rr+rpr+0.453e-6*v)*Il+rd3*is3;-(rd4+3.88e-3)*il4-(rr+rpr+0.453e-6*v)*Il+rd4*is4;-(rd5+3.88e-3)*il5-(rr+rpr+0.453e-6*v)*Il+rd5*is5;-(rd6+3.88e-3)*il6-(rr+rpr+0.453e-6*v)*Il+rd6*is6;-(rd7+3.88e-3)*il7-(rr+rpr+0.453e-6*v)*Il+rd7*is7;-(rd8+3.88e-3)*il8-(rr+rpr+0.453e-6*v)*Il+rd8*is8;-(rd9+3.88e-3)*il9-(rr+rpr+0.453e-6*v)*Il+rd9*is9;-(rd10+3.88e-3)*il10-(rr+rpr+0.453e-6*v)*Il+rd10*is10]
#display(C)
D=mm*C
display(D)
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using Symbolics, LinearAlgebra
import Base.:+
+(a::T, b::Vector{T}) where {T <:Union{Float64,Num}}=a+b[1]
@show 2
@variables x,il1,il2,il3,il4,il5,il6,il7,il8,il9,il10,il11,il12,rd1,rd2,rd3,rd4,rd5,rd6,rd7,rd8,rd9,rd10,rd11,rd12,rr,rpr,v,is1,is2,is3,is4,is5,is6,is7,is8,is9,is10,is11,is12,Il
b=4.2e-3+0.453*x;a=5.1+4.2e-3+0.453*x ;λ=a-b;u=[b;b;b;b;b;b;b;b;b;b;b;b];vec=[1 1 1 1 1 1 1 1 1 1 1 1]
mm=I/λ-(u*vec)/*+vec*u))
#display(mm)
C=[-(rd1+3.88e-3)*il1-(rr+rpr+0.453e-6*v)*Il+rd1*is1;-(rd2+3.88e-3)*il2-(rr+rpr+0.453e-6*v)*Il+rd2*is2;-(rd3+3.88e-3)*il3-(rr+rpr+0.453e-6*v)*Il+rd3*is3;-(rd4+3.88e-3)*il4-(rr+rpr+0.453e-6*v)*Il+rd4*is4;-(rd5+3.88e-3)*il5-(rr+rpr+0.453e-6*v)*Il+rd5*is5;-(rd6+3.88e-3)*il6-(rr+rpr+0.453e-6*v)*Il+rd6*is6;-(rd7+3.88e-3)*il7-(rr+rpr+0.453e-6*v)*Il+rd7*is7;-(rd8+3.88e-3)*il8-(rr+rpr+0.453e-6*v)*Il+rd8*is8;-(rd9+3.88e-3)*il9-(rr+rpr+0.453e-6*v)*Il+rd9*is9;-(rd10+3.88e-3)*il10-(rr+rpr+0.453e-6*v)*Il+rd10*is10;-(rd11+3.88e-3)*il11-(rr+rpr+0.453e-6*v)*Il+rd11*is11;-(rd12+3.88e-3)*il12-(rr+rpr+0.453e-6*v)*Il+rd12*is12]
#display(C)
D=mm*C
display(D)
Loading

0 comments on commit 2ab9c3f

Please sign in to comment.