Focuses on actions you can take in selecting your solver settings. Example model here: www.mathworks.... MathWorks happens to have free training courses as well: matlabacademy....
Man, I like the way you explain the stuff, thank you very much for your awesome work here! I would be happy to see a course in Electrical Engineering done on Simscape by you. Take care and all the best!
Does the solver and the algorithm behind is distoring the simulation. For example, te solver itself makes the simulation more damped than it is. I ve been simulating converter with switch model and DPL. I tried to replicate high-frequency resonance, I suspect the simulation is overly damped than it should be. Could you please explain to us that how the solver changes the system damping
A computer simulation is almost always an estimation of numerical equations, and even those equations if solved analytically, are a simplification of reality. For an ODE solver, which plays a large role in Simulink, certain algorithms have a tendency to either over estimate, or under estimate the integral of an equation. This is particularly noticeable for first order methods like forward and backward Euler. If you are using a variable step solver such as ode23t or the DAE solver, you probably aren't going to see an issue with damping. However, to make sure, you can tighten your tolerance and see if the simulation changes. By default, the simulation tolerance is rel: 1e-3, and abs: auto. You can change both of these to 1e-5 and see if your simulation results change. If there is no difference, it is likely an issue with the model or model parameters, and not the solver. If the tighter tolerance makes a noticeable difference, then you have a particularly challenging topology for the solver to handle and will need to have slower simulations with the tighter tolerance to get accurate results. Having particularly fast frequencies on top of an otherwise slow system (think wide bandgap device turn on and turn off transients compared to line frequency) can be a reason you would need tighter tolerances. One thing that happens when the tolerance is made tighter, is essentially the solver takes smaller time steps (I'm leaving out why and how for brevity), and the smaller the time step, the more accurate the estimation of the integral. The integral error approaches 0 as the time step approaches 0, but it is physically impossible to have a time step of 0, so you always have some error.
The simple reason is that is is much easier to put together complex models in Simscape than Simulink. Simscape supports bi-directional connections while all Simulink models must be represented by input and output ports. This makes Simscape models much easier to maintain and change compared to Simulink. Getting deeper into the math, the Simscape engine can solve DAEs which allows for more accurate representations of things like variable resistances and other physical realities that can't be represented as well by an ODE. A good exercise if you have free time, is to design your own RC circuit in Simulink and then in Simscape. Then add another RC circuit across the capacitor of that circuit. It is very easy to do in Simscape (just cut and paste), while it is hard to do in Simulink (your must rederive all of the equations).
Amazing video! Thank you very much for this content. Have you ever used LTspice components (SiC MOSFET) in Simscape Electrical? I know that the subcircuit2ssc function allows the conversion of .lib files and then the component can be generated in library browser. I have done all these steps. In the case of a buck converter, the signals are good. In the case of a single phase h bridge inverter, the simulation time becomes extremely slow, the signals are not good, etc. I have not found any examples or mathworks videos, using this approach with an inverter. You will save me if you make a video about it :D
Unfortunately, some of the LTspice models uses LTspice proprietary functions that don't import, so I have to look for PSPICE equivalents or hand modify the file to get the import to work. At that point I'm more likely to just use the n-channel mosfet and parameterize it from the data sheet.
Man, I like the way you explain the stuff, thank you very much for your awesome work here! I would be happy to see a course in Electrical Engineering done on Simscape by you. Take care and all the best!
Can discrete state solvers be used for simscape models? If not, what models do I use to have a realtime deployment for eg. in a microautobox?
Does the solver and the algorithm behind is distoring the simulation. For example, te solver itself makes the simulation more damped than it is. I ve been simulating converter with switch model and DPL. I tried to replicate high-frequency resonance, I suspect the simulation is overly damped than it should be. Could you please explain to us that how the solver changes the system damping
A computer simulation is almost always an estimation of numerical equations, and even those equations if solved analytically, are a simplification of reality. For an ODE solver, which plays a large role in Simulink, certain algorithms have a tendency to either over estimate, or under estimate the integral of an equation. This is particularly noticeable for first order methods like forward and backward Euler. If you are using a variable step solver such as ode23t or the DAE solver, you probably aren't going to see an issue with damping. However, to make sure, you can tighten your tolerance and see if the simulation changes. By default, the simulation tolerance is rel: 1e-3, and abs: auto. You can change both of these to 1e-5 and see if your simulation results change. If there is no difference, it is likely an issue with the model or model parameters, and not the solver. If the tighter tolerance makes a noticeable difference, then you have a particularly challenging topology for the solver to handle and will need to have slower simulations with the tighter tolerance to get accurate results. Having particularly fast frequencies on top of an otherwise slow system (think wide bandgap device turn on and turn off transients compared to line frequency) can be a reason you would need tighter tolerances. One thing that happens when the tolerance is made tighter, is essentially the solver takes smaller time steps (I'm leaving out why and how for brevity), and the smaller the time step, the more accurate the estimation of the integral. The integral error approaches 0 as the time step approaches 0, but it is physically impossible to have a time step of 0, so you always have some error.
Elaborate on how to use different solvers for different modules of a model
Can you please explain advantages of simscape models over simulink models.....why should we prefer simscape models.
The simple reason is that is is much easier to put together complex models in Simscape than Simulink. Simscape supports bi-directional connections while all Simulink models must be represented by input and output ports. This makes Simscape models much easier to maintain and change compared to Simulink. Getting deeper into the math, the Simscape engine can solve DAEs which allows for more accurate representations of things like variable resistances and other physical realities that can't be represented as well by an ODE.
A good exercise if you have free time, is to design your own RC circuit in Simulink and then in Simscape. Then add another RC circuit across the capacitor of that circuit. It is very easy to do in Simscape (just cut and paste), while it is hard to do in Simulink (your must rederive all of the equations).
Amazing video! Thank you very much for this content. Have you ever used LTspice components (SiC MOSFET) in Simscape Electrical? I know that the subcircuit2ssc function allows the conversion of .lib files and then the component can be generated in library browser. I have done all these steps. In the case of a buck converter, the signals are good. In the case of a single phase h bridge inverter, the simulation time becomes extremely slow, the signals are not good, etc. I have not found any examples or mathworks videos, using this approach with an inverter. You will save me if you make a video about it :D
Unfortunately, some of the LTspice models uses LTspice proprietary functions that don't import, so I have to look for PSPICE equivalents or hand modify the file to get the import to work. At that point I'm more likely to just use the n-channel mosfet and parameterize it from the data sheet.
@@electrificationenthusiasts8611hello, do you have a video about how to parametrize the n-channel mosfet from datasheet?