I've a system that i need to use a graph to solve this function.
I'm trying to use tf.contrib.integrate.odeint(), however, this function can only get first order ODE, so I divided in two Differential equations. Here is what i did:
import tensorflow as tf
import numpy as np
import matplotlib.pyplot as plt
import math as mat
graph = tf.Graph()
with graph.as_default():
R = tf.constant(100.)
L = tf.constant(0.002)
C = tf.constant(0.000005)
E = tf.constant(10.)
'''
Inital EDO:
dˆ2(vc)/dtˆ2 + R/L * dvc/dt + vc/LC = E/LC
dvc/dt=z
dvz/dt = (E-vc)/LC - R*z/L
'''
#dvz/dt = (E-vc)/LC - R*z/L
EDO0 = lambda z, t: (E-vc)/(L*C) - R/L * z
#dvc/dt=z
EDO1 = lambda vc, t: z
#initial value
EDO1_init = constant_op.constant(1.0, dtype=dtypes.float64)
t = np.linspace(0.0, 1.0, 11)
EDO1_solved = tf.contrib.integrate.odeint(EDO0, 0.5, t)
with tf.Session() as sess:
y_solved = sess.run(EDO1_solved)
print(y_solved)
tf.summary.FileWriter('/tmp/logs', tf.get_default_graph()).close()
But i'm having some problems with the equations
The main problem that i couldn't find the solution is that i must use tensorflow package.