Hi,
I am trying to plot the solutions the following system of ODEs
var('t')
A = function('A',t)
B = function('B',t)
de1 = diff(A,t) == -k1*A+k2*B
de2 = diff(B,t) == k1*A-k2*B
sol = desolve_system([de1,de2],[A,B],ics=[500,0])
show(sol)
solA, solB = sol[0].rhs(), sol[1].rhs()
plot((solA,solB),(t,0,50))
however the solution includes A(0) and B(0) as seen below:
[A(t)=111(6A(0)−5B(0))e(−1120t)+511A(0)+511B(0),B(t)=−111(6A(0)−5B(0))e(−1120t)+611A(0)+611B(0)]
How do specify the initial contidions so that my plot command above works? Now I am getting the following error:
verbose 0 (2424: plot.py, generate_plot_points) WARNING: When plotting,
failed to evaluate function at 200 points.
verbose 0 (2424: plot.py, generate_plot_points) Last error message:
'unable to simplify to float approximation'
verbose 0 (2424: plot.py, generate_plot_points) WARNING: When plotting,
failed to evaluate function at 200 points.
verbose 0 (2424: plot.py, generate_plot_points) Last error message:
'unable to simplify to float approximation'