Traduction Programme MatLab en SciLab
laure64
-
laure64 -
laure64 -
Bonjour,
je souhaiterai savoir si quelqu'un serait capable de me traduire ce programme MatLab en SciLab s'il vous plait ?
% INVLAP Numerical Inversion of Laplace Transforms
function [radt,ft]=INVLAP(Fs,tini,tend,nnt,a,ns,nd);
% Fs is formula for F(s) as a string
% tini, tend are limits of the solution interval
% nnt is total number of time instants
% a, ns, nd are parameters of the method
% if not given, the method uses implicit values a=6, ns=20, nd=19
% it is recommended to preserve a=6
% increasing ns and nd leads to lower error
% an example of function calling
% [t,ft]=INVLAP('s/(s^2+4*pi^2)',0,10,1001);
% to plot the graph of results write plot(t,ft), grid on, zoom on
FF=strrep(strrep(strrep(Fs,'*','.*'),'/','./'),'^','.^');
if nargin==4
a=6; ns=20; nd=19; end; % implicit parameters
radt=linspace(tini,tend,nnt); % time vector
if tini==0 radt=radt(2:1:nnt); end; % t=0 is not allowed
tic % measure the CPU time
for n=1:ns+1+nd % prepare necessary coefficients
alfa(n)=a+(n-1)*pi*j;
beta(n)=-exp(a)*(-1)^n;
end;
n=1:nd;
bdif=fliplr(cumsum(gamma(nd+1)./gamma(nd+2-n)./gamma(n)))./2^nd;
beta(ns+2:ns+1+nd)=beta(ns+2:ns+1+nd).*bdif;
beta(1)=beta(1)/2;
for kt=1:nnt % cycle for time t
tt=radt(kt);
s=alfa/tt; % complex frequency s
bt=beta/tt;
btF=bt.*eval(FF); % functional value F(s)
ft(kt)=sum(real(btF)); % original f(tt)
end;
toc
Merci d'avance.
je souhaiterai savoir si quelqu'un serait capable de me traduire ce programme MatLab en SciLab s'il vous plait ?
% INVLAP Numerical Inversion of Laplace Transforms
function [radt,ft]=INVLAP(Fs,tini,tend,nnt,a,ns,nd);
% Fs is formula for F(s) as a string
% tini, tend are limits of the solution interval
% nnt is total number of time instants
% a, ns, nd are parameters of the method
% if not given, the method uses implicit values a=6, ns=20, nd=19
% it is recommended to preserve a=6
% increasing ns and nd leads to lower error
% an example of function calling
% [t,ft]=INVLAP('s/(s^2+4*pi^2)',0,10,1001);
% to plot the graph of results write plot(t,ft), grid on, zoom on
FF=strrep(strrep(strrep(Fs,'*','.*'),'/','./'),'^','.^');
if nargin==4
a=6; ns=20; nd=19; end; % implicit parameters
radt=linspace(tini,tend,nnt); % time vector
if tini==0 radt=radt(2:1:nnt); end; % t=0 is not allowed
tic % measure the CPU time
for n=1:ns+1+nd % prepare necessary coefficients
alfa(n)=a+(n-1)*pi*j;
beta(n)=-exp(a)*(-1)^n;
end;
n=1:nd;
bdif=fliplr(cumsum(gamma(nd+1)./gamma(nd+2-n)./gamma(n)))./2^nd;
beta(ns+2:ns+1+nd)=beta(ns+2:ns+1+nd).*bdif;
beta(1)=beta(1)/2;
for kt=1:nnt % cycle for time t
tt=radt(kt);
s=alfa/tt; % complex frequency s
bt=beta/tt;
btF=bt.*eval(FF); % functional value F(s)
ft(kt)=sum(real(btF)); % original f(tt)
end;
toc
Merci d'avance.
A voir également:
- Traduction Programme MatLab en SciLab
- Google traduction photo - Guide
- Scilab - Télécharger - Édition & Programmation
- Programme demarrage windows - Guide
- Mettre en veille un programme - Guide
- Hibiki traduction telecharger - Accueil - Intelligence artificielle
1 réponse
Bonjour,
Je connais pas assez les 2 pour le faire mais par contre il y a sur le site de Scilab un "traducteur" Matlab-Scilab :
https://help.scilab.org/docs/5.4.1/fr_FR/section_36184e52ee88ad558380be4e92d3de21.html
Je connais pas assez les 2 pour le faire mais par contre il y a sur le site de Scilab un "traducteur" Matlab-Scilab :
https://help.scilab.org/docs/5.4.1/fr_FR/section_36184e52ee88ad558380be4e92d3de21.html
https://help.scilab.org/docs/5.4.1/fr_FR/m2sci_balance.html
On voit donc que la fonction balance de Matlab a pour équivalent balanc en Scilab. Et tu as même un exemple plus bas.
Et je viens de me rappeler mais Scilab intégre un convertisseur, tu peux le trouver dans le menu "Applications" de Scilab. J'avais lu qu'il convertissait pas à 100% mais c'est déjà un début.