Hello Peter,
Adding the keyword to both solvers didn't work.
I made a simple model with 2 circuits and everything went well. Next, I tried my big model with the function
Code: Select all
$ function test_function(c, circuitNumber)\
{\
fprintf(stdout, "\n circuit: %g; c(0): %g\n\n", circuitNumber c(0));\
_test_function = 0.0\
}
If I use
Code: Select all
Body Force 1 ! circuit
v_ac_source = Variable "crt 2 i 1"
Real MATC "test_function(tx, 1)"
v_xz_source = Variable "crt 2 i 1"
Real MATC "test_function(tx, 2)"
I get zeros for the first function call, but the right values for the second call, for all time steps.
If I use
Code: Select all
Body Force 1 ! circuit
v_ac_source = Variable "crt 1 i 1"
Real MATC "test_function(tx, 1)"
v_xz_source = Variable "crt 2 i 1"
Real MATC "test_function(tx, 2)"
everything works well!
Code: Select all
Body Force 1 ! circuit
v_ac_source = Variable "crt 1 i 1"
Real MATC "test_function(tx, 1)"
v_xz_source = Variable "crt 1 i 1"
Real MATC "test_function(tx, 2)"
also gives correct results.
Further, in all experiments, I noticed that all values are either the correct ones or zero. Knowing this, I can work with the second Body Force shown above.
I can imagine that there are not too many users for this, because it is quite complicated. I stopped trying about 4 years ago, but with the retry this year, I got a better understanding and I get very nice results with a synchronous generator with an external circuit. If I have some time, I will write some examples for learning working with circuits to help other people.
Thank you again,
Kind regards,
Martin