Git Product home page Git Product logo

Comments (11)

cuihantao avatar cuihantao commented on June 9, 2024

from andes.

cuihantao avatar cuihantao commented on June 9, 2024

I was able to replicate the issue with kundur_vsc.xlsx. Working on a fix now.

from andes.

cuihantao avatar cuihantao commented on June 9, 2024

It has been fixed in the latest develop branch in f8af14c.

from andes.

cuihantao avatar cuihantao commented on June 9, 2024

Also, the kundur_vsc.xlsx test case has been updated.

from andes.

YaeSakura1 avatar YaeSakura1 commented on June 9, 2024

I still report the following error:

UFuncTypeError Traceback (most recent call last)
C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_23800/1409670173.py in
----> 1 ss=andes.run('kundur_vsc.xlsx')

c:\users\administrator\andes\andes\andes\main.py in run(filename, input_path, verbose, mp_verbose, ncpu, pool, cli, codegen, shell, **kwargs)
578 t0, _ = elapsed()
579 if len(cases) == 1:
--> 580 system = run_case(cases[0], codegen=codegen, **kwargs)
581 elif len(cases) > 1:
582

c:\users\administrator\andes\andes\andes\main.py in run_case(case, routine, profile, convert, convert_all, add_book, codegen, remove_pycapsule, **kwargs)
389
390 if system.is_setup:
--> 391 system.PFlow.run(**kwargs)
392 for r in routine:
393 system.dict[routine_cli[r.lower()]].run(**kwargs)

c:\users\administrator\andes\andes\andes\routines\pflow.py in run(self, **kwargs)
196 self.niter = 0
197 while True:
--> 198 mis = self.nr_step()
199 logger.info('%d: |F(x)| = %.10g', self.niter, mis)
200

c:\users\administrator\andes\andes\andes\routines\pflow.py in nr_step(self)
100 system.s_update_var(self.models)
101 system.f_update(self.models)
--> 102 system.g_update(self.models)
103 system.l_update_eq(self.models)
104 system.fg_to_dae()

c:\users\administrator\andes\andes\andes\system.py in g_update(self, models)
890 except TypeError as e:
891 logger.error("g_update failed. Have you run andes prepare -i after updating?")
--> 892 raise e
893
894 def g_islands(self):

c:\users\administrator\andes\andes\andes\system.py in g_update(self, models)
887 """
888 try:
--> 889 self.call_models('g_update', models)
890 except TypeError as e:
891 logger.error("g_update failed. Have you run andes prepare -i after updating?")

c:\users\administrator\andes\andes\andes\system.py in call_models(self, method, models, *args, **kwargs)
1516 ret = OrderedDict()
1517 for name, mdl in models.items():
-> 1518 ret[name] = getattr(mdl, method)(*args, **kwargs)
1519
1520 return ret

c:\users\administrator\andes\andes\andes\core\model.py in g_update(self)
1232 for i, var in enumerate(self.cache.algebs_and_ext.values()):
1233 if var.e_inplace:
-> 1234 var.e += g_ret[i]
1235 else:
1236 var.e[:] = g_ret[i]

UFuncTypeError: Cannot cast ufunc 'add' output from dtype('complex128') to dtype('float64') with casting rule 'same_kind'

from andes.

YaeSakura1 avatar YaeSakura1 commented on June 9, 2024

Hi,
Why do I get such errors:
ss=andes.run('kundur_vsc.xlsx')

Storing generated pycode to "C:\Users\Administrator.andes\pycode"
Dumping calls to calls.pkl is not supported with NumPy 1.2+
ANDES is still fully functional with generated Python code.
Successfully generated numerical code in 2.5761 seconds.
Parsing input file "kundur_vsc.xlsx"...
Input file parsed in 0.6283 seconds.
System internal structure set up in 0.0239 seconds.
-> System connectivity check results:
No islanded bus detected.
A total of 1 island(s) detected.
Each island has a slack bus correctly defined and enabled.

-> Power flow calculation
Sparse solver: KLU
Solution method: NR method
Sparse addition: Fast in-place (kvxopt)

KeyError Traceback (most recent call last)
C:\Users\ADMINI~1\AppData\Local\Temp/ipykernel_6216/1409670173.py in
----> 1 ss=andes.run('kundur_vsc.xlsx')

c:\users\administrator\andes\andes\andes\main.py in run(filename, input_path, verbose, mp_verbose, ncpu, pool, cli, codegen, shell, **kwargs)
575 t0, _ = elapsed()
576 if len(cases) == 1:
--> 577 system = run_case(cases[0], codegen=codegen, **kwargs)
578 elif len(cases) > 1:
579

c:\users\administrator\andes\andes\andes\main.py in run_case(case, routine, profile, convert, convert_all, add_book, codegen, remove_pycapsule, **kwargs)
386
387 if system.is_setup:
--> 388 system.PFlow.run(**kwargs)
389 for r in routine:
390 system.dict[routine_cli[r.lower()]].run(**kwargs)

c:\users\administrator\andes\andes\andes\routines\pflow.py in run(self, **kwargs)
186
187 self.summary()
--> 188 self.init()
189
190 if system.dae.m == 0:

c:\users\administrator\andes\andes\andes\routines\pflow.py in init(self)
74
75 self.system.set_var_arrays(self.models, inplace=True, alloc=False)
---> 76 self.system.init(self.models, routine='pflow')
77 logger.info('Power flow initialized.')
78

c:\users\administrator\andes\andes\andes\system.py in init(self, models, routine)
667
668 # initialize variables second
--> 669 mdl.init(routine=routine)
670
671 self.vars_to_dae(mdl)

c:\users\administrator\andes\andes\andes\core\model.py in init(self, routine)
1651
1652 # evaluate ConstService and VarService
-> 1653 self.s_update()
1654
1655 # find out if variables need to be initialized for routine

c:\users\administrator\andes\andes\andes\core\model.py in s_update(self)
1047
1048 # Block-level s_numeric not supported.
-> 1049 self.get_inputs(refresh=True)
1050
1051 def s_update_var(self):

c:\users\administrator\andes\andes\andes\core\model.py in get_inputs(self, refresh)
904 if len(self._input) == 0 or refresh:
905 self.refresh_inputs()
--> 906 self.refresh_inputs_arg()
907
908 return self._input

c:\users\administrator\andes\andes\andes\core\model.py in refresh_inputs_arg(self)
976
977 for key, val in mapping.items():
--> 978 source = self.calls.dict[key]
979 for name in source:
980 val[name] = [self._input[arg] for arg in source[name]]

KeyError: 'ia_args'

from andes.

cuihantao avatar cuihantao commented on June 9, 2024

from andes.

YaeSakura1 avatar YaeSakura1 commented on June 9, 2024

Thank you!!
I solved the problem.
Than , when i run the command : ss.TDS.run()
I got the following problem:

I'm using jupyter lab ; python version is 3.9

-> Time Domain Simulation Summary:
Sparse Solver: KLU
Simulation time: 0-20.0 s.
Fixed step size: h=33.33 ms. Shrink if not converged.
C:\Users\Administrator.andes\pycode\EXDC2.py:75: RuntimeWarning: invalid value encountered in true_divide
return (sqrt(SAT_E1SAT_SE1/(SAT_E2SAT_SE2))*((greater(SAT_SE2, 0)) + (less(SAT_SE2, 0))))
Suspect initialization issue! Simulation may crash!

Name | Var. Value | Eqn. Mismatch
-----+------------+--------------

Initialization for dynamics failed in 0.0628 seconds.
0%| | 0/100 [00:00<?, ?%/s]
NaN found in solution. Convergence is not likely
Simulation terminated at t=0.0000 s.
Simulation completed in 0.0089 seconds.
TimeSeries does not contain any time stamp.
Outputs to "kundur_vsc_out.lst" and "kundur_vsc_out.npz".
Outputs written in 0.0019 seconds.

False

from andes.

cuihantao avatar cuihantao commented on June 9, 2024

from andes.

YaeSakura1 avatar YaeSakura1 commented on June 9, 2024

Thank you,
I need to clone the code under develop branch, right?

from andes.

cuihantao avatar cuihantao commented on June 9, 2024

from andes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.