Ask Your Question

Revision history [back]

Concerning your first issue, instead of the symbolic solve() approach, you can use a numerical approach using find_root() function:

sage: find_root(diff(specificSolution,t),1e-6,5e-6)
3.6275987337046833e-06

Concerning your first issue, instead of the symbolic solve() approach, you can use a numerical approach using the find_root() function:

sage: find_root(diff(specificSolution,t),1e-6,5e-6)
3.6275987337046833e-06

This approach also works for your second issue:

sage: find_root(specificSolution-Vin*0.1,0,1)
4.882292726784699e-07

Hence, you can check:

sage: Max = find_root(diff(specificSolution,t),1e-6,5e-6)
sage: M10 = find_root(specificSolution-Vin*0.1,0,1)      
sage: M90 = find_root(specificSolution-Vin*0.9,0,1)
sage: plot1 += line([(Max,0),(Max,6)])
sage: plot1 += line([(M10,0),(M10,6)])
sage: plot1 += line([(M90,0),(M90,6)])
sage: plot1

Which looks quite good.

Concerning your first issue, instead of the symbolic solve() approach, you can use a numerical approach using the find_root() function:

sage: find_root(diff(specificSolution,t),1e-6,5e-6)
3.6275987337046833e-06

This approach also works for your second issue:

sage: find_root(specificSolution-Vin*0.1,0,1)
4.882292726784699e-07

Hence, you can check:

sage: Vout,t = var("Vout,t")
sage: L = 1e-3
sage: C = 1e-9
sage: Vin = 5
sage: R = 1e3
sage: Vout = function("Vout",t)
sage: equation = L*C*diff(Vout,t,2) + R*C*diff(Vout,t) + Vout == Vin
sage: specificSolution = desolve(equation,Vout,ivar=t,ics=[0,0,0])
sage: Max = find_root(diff(specificSolution,t),1e-6,5e-6)
sage: M10 = find_root(specificSolution-Vin*0.1,0,1)      
sage: M90 = find_root(specificSolution-Vin*0.9,0,1)
sage: plotMax = 2e-5
sage: plot1 += line([(Max,0),(Max,6)])
= plot(specificSolution,[t,0,plotMax],rgbcolor=[0,0,0])
sage: plot1 += line([(M10,0),(M10,6)])
plot(Vin*0.1,[t,0,plotMax],rgbcolor=[0,0,1]) #10% line
sage: plot1 += line([(M90,0),(M90,6)])
plot(Vin*0.9,[t,0,plotMax],rgbcolor=[0,1,0]) #90% line
sage: plot1 += line([(Max,0),(Max,6)],rgbcolor=[1,0,0])
sage: plot1 += line([(M10,0),(M10,6)],rgbcolor=[0,0,1])
sage: plot1 += line([(M90,0),(M90,6)],rgbcolor=[0,1,0])
sage: plot1

Which looks quite good.correct.

Concerning your first issue, instead of the symbolic solve() approach, you can use a numerical approach using the find_root() function:

sage: find_root(diff(specificSolution,t),1e-6,5e-6)
3.6275987337046833e-06

This approach also works for your second issue:

sage: find_root(specificSolution-Vin*0.1,0,1)
4.882292726784699e-07

Hence, you can check:

sage: Vout,t = var("Vout,t")
sage: L = 1e-3
sage: C = 1e-9
sage: Vin = 5
sage: R = 1e3
sage: Vout = function("Vout",t)
sage: equation = L*C*diff(Vout,t,2) + R*C*diff(Vout,t) + Vout == Vin
sage: specificSolution = desolve(equation,Vout,ivar=t,ics=[0,0,0])
sage: Max = find_root(diff(specificSolution,t),1e-6,5e-6)
sage: M10 = find_root(specificSolution-Vin*0.1,0,1)      
sage: M90 = find_root(specificSolution-Vin*0.9,0,1)
sage: plotMax = 2e-5
sage: plot1 = plot(specificSolution,[t,0,plotMax],rgbcolor=[0,0,0])
sage: plot1 += plot(Vin*0.1,[t,0,plotMax],rgbcolor=[0,0,1]) #10% line
sage: plot1 += plot(Vin*0.9,[t,0,plotMax],rgbcolor=[0,1,0]) #90% line
sage: plot1 += plot(specificSolution(t=Max),[t,0,plotMax],rgbcolor=[1,0,0])
sage: plot1 += line([(Max,0),(Max,6)],rgbcolor=[1,0,0])
sage: plot1 += line([(M10,0),(M10,6)],rgbcolor=[0,0,1])
sage: plot1 += line([(M90,0),(M90,6)],rgbcolor=[0,1,0])
sage: plot1

Which looks correct.