Re: [Scilab-users] inquiry

2014-02-18 Thread Paul Bignier


Hi Mohammed,

Scilab and Matlab are meant for the same purposes and share many similar 
features, but their semantic, function names and conventions are not 
exactly the same.


So no, they are not directly equivalent, but a Scilab job is often 
translatable in Matlab, and vice versa.
Check out the Matlab-Scilab equivalents 
http://help.scilab.org/docs/5.4.1/fr_FR/section_36184e52ee88ad558380be4e92d3de21.html 
http://help.scilab.org/docs/5.4.1/fr_FR/section_36184e52ee88ad558380be4e92d3de21.htmlhelp 
page for more information.


Regards,
Paul


On 02/18/2014 12:33 AM, Mohammed Bashir wrote:

is scilab equivalent to matlab



On Mon, Nov 25, 2013 at 3:06 PM, Mohammed Bashir mobash2...@gmail.com 
mailto:mobash2...@gmail.com wrote:



is scilab equivalent to matlab




___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


--
Paul BIGNIER
Scilab Engineer  Xcos Developer
---
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
Phone: +33.1.80.77.04.69
http://www.scilab-enterprises.com

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Xcos PID controller problem

2014-02-18 Thread Serge Steer
The PID controller is an improper transfer function (degree of 
numdegree of den). In Xcos the derivative term of the PID bloc is 
computed by an approximation

which seems to fail in your context.

A solution should be to replace the PID bloc with a transfert function 
block made proper adding a very small term in s^2 for the denominator 
(sse the attched diagram)


Please report the problem in http://bugzilla.scilab.org/

Serge Steer

Le 17/02/2014 21:51, john a écrit :

Hello,
I'm new to Scilab and Xcos so may be making a simple mistake, but I have the
following problem.  I created an Xcos model of a simple mass-spring-damper
with PID control using the data from the Matlab example shown  here
http://ctms.engin.umich.edu/CTMS/index.php?example=Introductionsection=ControlPID
.

The Xcos results are the same as the Matlab example except for the case when
all three gains are used as follows Kp=350, Ki=300 and Kd=50 .

My result looks like this (red line) and is clearly giving a different
response to the Matlab example for the same gain values.
   http://mailinglists.scilab.org/file/n4028669/PID.png
I have tried different solvers and time steps, but this doesn't seem to be
the problem.  I have also modelled the problem in Mathcad 7, Mathcad Prime 3
and using csim in Scilab and all those results agree broadly with the Matlab
example.

Any advice would be greatly appreciated and I have attached the Xcos file
for information. spring-damper-PID.zcos
http://mailinglists.scilab.org/file/n4028669/spring-damper-PID.zcos




--
View this message in context: 
http://mailinglists.scilab.org/Xcos-PID-controller-problem-tp4028669.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users





spring-damper-PID.zcos
Description: Binary data
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] How to get a reguar sampled vector in Scilab

2014-02-18 Thread Matiasb
I'm trying to program function (or even better it it already exists) in
scilab that calculates a regular timed samples of values. IE: I have a
vector 'values' which defines contains the value of a signal at different
times. This times are in the vector 'times'. So at time times(N), the signal
has value values(N). At the moment the times are not regular, so the
variable 'times' and 'values' can look like:

times = [0, 2, 6, 8, 14] 
values= [5, 9, 10, 1, 6]
This represents that the signal had value 5 from second 0 to second 2. Value
9 from second 2 to second 6, etc. Therefore, if I want to calculate the
signal average value I can not just calculate the average of vector
'values'. This is because for example the signal can be for a long time with
the same value, but there will be only one value in the vector. One option
is to take the deltaT to calculate the media, but I will also need to
perform other calculations:average, etc.

Other option is to create a function that given a deltaT, samples the time
and values vectors to produce an equally spaced timeVector and corresponding
values. For example, with deltaT=2 and the previous vectors,

[sampledTime, sampledValues] = regularSample(times, values, 2)
sampledTime = [0, 2, 4, 6, 8, 10, 12, 14]
sampledValues = [5, 9, 9, 10, 1, 1, 1, 6]

This is easy if deltaT is small enough to fit exactly with all the times. If
the deltaT is bigger, then the average of values or some aproximation must
be done...

Is there anything already done in Scilab? How can this function be
programmed?

Thanks a lot! PS: I don't know if this is the correct forum to post scilab
questions, so any pointer would also be useful.



--
View this message in context: 
http://mailinglists.scilab.org/How-to-get-a-reguar-sampled-vector-in-Scilab-tp4028712.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] How to get a reguar sampled vector in Scilab

2014-02-18 Thread Serge Steer
I think there is a little mistake in the sampledValues you are expecting:
 times = [0, 2, 6, 8, 14]
 values= [5, 9, 10, 1, 6]
sampledTime =   [0, 2, 4, 6,  8, 10, 12, 14]
sampledValues = [5, 9, 9, 10, 1,  1,  1, 6] 
According to the rule used for the previous values, the last value of 
sampledValues must be 1 and not 6

Here is a code doing what you expect (but with a different last point)
times = [0, 2, 6, 8, 14];
values= [5, 9, 10, 1, 6];

sampletimes=0:14;
V=zeros(sampletimes);
for k=1:size(times,'*')-1
  V(sampletimes=times(k)sampletimestimes(k+1))=values(k);
end
V(sampletimestimes($))=timesvalues($);
clf;plot(sampletimes,V,'-+')

//You can also use linear interpolation
V1=interpln([times;values],sampletimes);
plot(sampletimes,V1,'r-+')
//or Splin interpolation
V2=interp(sampletimes,times,values,splin(times,values))
plot(sampletimes,V2,'m-*')

Serge Steer
- Mail original -
 De: Matiasb mati...@gmail.com
 À: users@lists.scilab.org
 Envoyé: Mardi 18 Février 2014 20:59:10
 Objet: [Scilab-users] How to get a reguar sampled vector in Scilab
 
 I'm trying to program function (or even better it it already exists) in
 scilab that calculates a regular timed samples of values. IE: I have a
 vector 'values' which defines contains the value of a signal at different
 times. This times are in the vector 'times'. So at time times(N), the signal
 has value values(N). At the moment the times are not regular, so the
 variable 'times' and 'values' can look like:
 
 times = [0, 2, 6, 8, 14]
 values= [5, 9, 10, 1, 6]
 This represents that the signal had value 5 from second 0 to second 2. Value
 9 from second 2 to second 6, etc. Therefore, if I want to calculate the
 signal average value I can not just calculate the average of vector
 'values'. This is because for example the signal can be for a long time with
 the same value, but there will be only one value in the vector. One option
 is to take the deltaT to calculate the media, but I will also need to
 perform other calculations:average, etc.
 
 Other option is to create a function that given a deltaT, samples the time
 and values vectors to produce an equally spaced timeVector and corresponding
 values. For example, with deltaT=2 and the previous vectors,
 
 [sampledTime, sampledValues] = regularSample(times, values, 2)
 sampledTime = [0, 2, 4, 6, 8, 10, 12, 14]
 sampledValues = [5, 9, 9, 10, 1, 1, 1, 6]
 
 This is easy if deltaT is small enough to fit exactly with all the times. If
 the deltaT is bigger, then the average of values or some aproximation must
 be done...
 
 Is there anything already done in Scilab? How can this function be
 programmed?
 
 Thanks a lot! PS: I don't know if this is the correct forum to post scilab
 questions, so any pointer would also be useful.
 
 
 
 --
 View this message in context:
 http://mailinglists.scilab.org/How-to-get-a-reguar-sampled-vector-in-Scilab-tp4028712.html
 Sent from the Scilab users - Mailing Lists Archives mailing list archive at
 Nabble.com.
 ___
 users mailing list
 users@lists.scilab.org
 http://lists.scilab.org/mailman/listinfo/users
 
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users