Hello everybody,
My question is very simple : is it possible to draw a bode plot from a COSELICA DIAGRAM?
I have created a diagram with COSELICA in SCILAB 2024.1.0
This diagram is working fine but now I wanted to get the corresponding bode plot. Is it possible?
The diagram:
The temporal simulation curve:
I should point out that I’ve already successfully used the post_xcos_simulate function in a scilab script to plot the bode curves of an XCOS schematic containing a transfer function block.
Here, I’m stuck because there’s no transfer function.
I give below the detail of such a script (this one is designed to search for CLR blocks):
//This module plots the Bode curves of an XCOS diagram with a transfer function
//
//We load the XCOS file to simulate
importXcosDiagram("C:\Users\file_name.zcos")
// Clear any pre_xcos_simulation
clear pre_xcos_simulate;
//Get data from the XCOS diagram (CLR block is the transfer function block)
function post_xcos_simulate(%cpr, scs_m, needcompile)
// Retrieve all objects
objs = scs_m.objs;
clrBlock = [];
//Looking for CLR block
for i=1:size(objs)
if objs(i).gui == "CLR" then
clrBlock = objs(i);
break;
end
end
// Retrieve exprs
s = poly(0,'s');
expr = clrBlock.graphics.exprs;
num = evstr(expr(1));
den = evstr(expr(2));
h = syslin('c', num/den);
// Open new figure then plot Bode
scf(max(winsid())+1);
bode(h, 0.01, 100,"Mon filtre");
endfunction
//Launching the Bode plot
xcos_simulate(scs_m, 4);
How to modify this script to fit with my purpose?