Commit 6c513eb7 authored by Frank Hellmann's avatar Frank Hellmann
Browse files

Some sketches

parent e79be91e
......@@ -5,6 +5,7 @@ from numba import vectorize, njit, float64, complex128, void, int32, __version__
# from assimulo.solvers import CVODE
# from assimulo.problem import Explicit_Problem
import scipy.sparse as sps
import scipy.linalg as la
import os
# numba version on the cluster does not support caching
......@@ -149,6 +150,9 @@ class DroopEquationNode_New(NodeType):
domega[index] = self.t_inv * (self.omega_set - omega[index]) - self.t_inv * self.freq_droop_gain * (
(v[index] * i[index].conjugate()).real - self.infeed.real)
def node_dynamics_symbolic(self):
raise NotImplementedError
def node_dynamics_string(self, j="{index}"):
return """
dv[{index}] = {t_inv} * ( -v[{index}] + {v_set} - {volt_droop_gain} * ( (v[{index}] * i[{index}].conjugate()).imag - {infeed}.imag) )
......@@ -242,7 +246,8 @@ def define_root_rhs_omega(total_length, rhs):
omega_global = y[-1]
a = 1.j * omega_global * v - dv
#Q: sollte hier nicht eventuell noch d/dt(v)*exp(i*phi) stehen?
return np.concatenate((zero, domega, a.view(np.float64)))
crit = 1. - la.norm(la.expm(approx_jac(y[:-1], rhs)))
return np.concatenate((crit, domega, a.view(np.float64)))
return root_rhs
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment