Is it possible use a battery in Simulink?

Dear all,
I am modeling a power microgrid model, like the example "power_microgrid", however, I wonder wether is feasible interchange the battery model of the example for one developed in Simscape or not?. My question arises because they are different environments, the battery is shown below.

6 commentaires

Andrew
Andrew le 17 Fév 2021
Hi Tony,
If your model is composed of Specialized Power Systems blocks, then the Battery you have highlighted is the best one to use.
If your model is composed of Libraries Compatible with Simscape Technology, then you should use either the Battery or Battery (Table-Based) blocks.
Best regards,
Andrew
Tony Castillo
Tony Castillo le 18 Fév 2021
Hello Andrew,
After reading your comment, I can conclude that it is not posible because my model is built into Simulink environment as I wrote before is based on the Example model "power_microgrid", is it what you meant?
Best wishes,
Tony
Jonas
Jonas le 18 Fév 2021
The example model is made with Specialized Power Systems blocks, so you should be able to integrate the block you showed in the model.
Tony Castillo
Tony Castillo le 18 Fév 2021
I can see you all are right, thank you, I have an error message at this very momment though, what do you think is producing these=?
Vinay Gurram
Vinay Gurram le 22 Juin 2021
Hi
Singular matrix error is commonly seen when there is a zero in denominator, could you disable all zero crossings from configuration parameters and check once.
Rik
Rik le 23 Juin 2021
Comment posted as flag by @Tony Castillo:
I appreciate your attempt, but even I added a zero crossing block at the output port of the Symscape Electrical battery the error still persisted

Connectez-vous pour commenter.

 Réponse acceptée

Joel Van Sickel
Joel Van Sickel le 2 Juil 2021

0 votes

Hello Tony,
the Rcond warning can be very common when using specialized power systesm. Essentially, the tool generates matrices behind the scenes, and they can be near singular depending on circuit topologies and parameter values. It can be non-trivial to determine what is causing these. Some things to try is adding snubbers, changing your time step value, removing extremely small or extremely larger circuit parameters. Eliminating parts of the model and and replacing them with controlled current/voltage sources to isolate what is causing the issue is another possibility. There is a chance your model will work just fine though. It is good to compare fixed step to variable step (ode23Tb) to make sure the results line up.
However, the error in your case is that something with the connection of the battery has the wrong signal dimensions. Can you provide a screen shot of both how you have connected the battery to the microgrid and the battery parameter settings?
Regards,
Joel

8 commentaires

Tony Castillo
Tony Castillo le 25 Oct 2021
Dear Joel,
I lost this in my inbox and also I have no realized your request till today, I regret not replying this before, I kindly ask for your help to overcome this issue.
Best regrads
Joel Van Sickel
Joel Van Sickel le 1 Nov 2021
Hello Tony,
it looks like you have a powertrain blockset battery in your model as well. I would not recommend using one of these for a microgrid. Also, if you are still using phasor domain, that will not work. For the DC components to work, you have to use continuous or discrete. I couldn't see your powergui block to see if that was the case. It looks like the old microgrid battery is still attatched which could also be a problem. I would rebuild it piece by piece starting with a battery and adding components one by one.
Regards,
Joel
Tony Castillo
Tony Castillo le 2 Nov 2021
Dear Joel,
You are right both batteries are still connected. And also it is the phasor powergui block in the model. Now, I wonder some issues: Why should I shift the battery?, and if I decide to change it how to connect it with the AC grid shown in the model because it is not a straightforward.
PD. I do not want to include converters because it decreses the simulation performance.
Best wishes
Joel Van Sickel
Joel Van Sickel le 2 Nov 2021
Hello Tony,
MathWorks provides multiple fidelity models and multiple technologies for simulating electrical systems. Phasor domain is one way, but is specifically for AC only systems. You can do something similar with Simscape that might work better. https://www.mathworks.com/help/physmod/sps/ug/phasor-mode-simulation-in-simscape-components.html
Powertrain Blockset is specifically for simulink only simulations and is not as flexible as Simscape and Specialized Power Systems.
Regards,
Joel
Tony Castillo
Tony Castillo le 3 Nov 2021
Dear Joel,
The problem using Simscape is the time that simulation takes so long to carry out when converters are included. It is why I decided to implement this model approach. I do agree with you about the flexibility which specialized Power Systems does, however, you have pointed out that Powertrain Blockset is specifically for simulink and only simulations, is not my case?, I do think it is.
Sincerely,
TCC
Joel Van Sickel
Joel Van Sickel le 3 Nov 2021
Hello Tony,
Any use of circuit componets means it is not a simulink only simulaiton. You could try and do it with PTBS but it will be very challenging to get correct results for a microgrid especially if you simulate anything on the AC side. Using average value converters or building your own simplified ones with controlled sources is probably the best bet to improve speed.
Regards,
Joel
Tony Castillo
Tony Castillo le 5 Nov 2021
Thank you for your information
Tony Castillo
Tony Castillo le 5 Nov 2021
Dear Joel,
I have started to replace some parts of the model in order to increase the accuracy and flexibility of the model as you former kindly recommended to me, but I am stuck in a error produced by the mode of the simulation "continous".
Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 2.638315e-18. [2 similar]
Matching "Goto" for "From" 'SCS_PED_model/Scopes/From2' not found
Component: Simulink | Category: Block warning
Matching "From" for "Goto" 'SCS_PED_model/Goto14' not found [2 similar]
Component: Simulink | Category: Block warning
Unconnected output line found on 'SCS_PED_model/Battery_Control/Product9' (output port: 1)
Component: Simulink | Category: Block warning
Complex signal mismatch. 'Input Port 4' of 'SCS_PED_model/powergui/EquivalentModel1/Sources/Mux' expects a signal of numeric type real. However, it is driven by a signal of numeric type complex
Component: Simulink | Category: Model error
Complex signal mismatch. 'Output Port 1' of 'SCS_PED_model/powergui/EquivalentModel1/Sources/From4' is a signal of numeric type complex. However, it is driving a signal of numeric type real
Component: Simulink | Category: Model error
Can you provide any workaround to overcome this problem?
PD. I wonder, what if I used mode discrete-phasor rather than phasor as I was using initially?
Best regards

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Energy Storage dans Centre d'aide et File Exchange

Produits

Version

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by