# Sam Chak

**Statistics**

**MATLAB Answers**

**0** Questions

**746** Answers

RANK**94**

of 271,287

REPUTATION**1,386**

CONTRIBUTIONS

**0** Questions

**746** Answers

ANSWER ACCEPTANCE **
0.00%
**

VOTES RECEIVED**158**

RANK

of 18,295

REPUTATION**N/A**

AVERAGE RATING**0.00**

CONTRIBUTIONS**0** Files

DOWNLOADS **0**

ALL TIME DOWNLOADS**0**

RANK

of 119,840

CONTRIBUTIONS

**0** Problems

**0** Solutions

SCORE**0**

NUMBER OF BADGES**0**

CONTRIBUTIONS**0 Posts**

CONTRIBUTIONS**0** Public Channels

AVERAGE RATING

CONTRIBUTIONS**0** Highlights

AVERAGE NO. OF LIKES

**Content Feed**

How can i calculate the PI controller gains from my plant transfer function

Hi @Mads Olesen Perhaps you can directly insert the PI controller and obtain the closed-loop response. Tune the gains if not go...

7 hours ago | 0

Derivative of state '3' is not finite.

Hi @younwook song The system is unstable. It is rather difficult to decipher the dynamics from the displayed block diagram and ...

10 hours ago | 0

I want help solving differential equations

Hi @kubel Follow the example in the dsolve() documentation https://www.mathworks.com/help/symbolic/dsolve.html syms x(t) eq...

11 hours ago | 0

| accepted

Plot several solution curves to y'(t) = y(t) - t

Hi @Carla Roos You can create an anonymous function of t and y. fun = @(t, y) y - t; % <--- Type like this % solve f...

1 day ago | 0

| accepted

How to import my state space Modell into Simulink

Hi @Ann-Christin Schlupek You will need to import the identified model from the MATLAB workspace into Simulink. Follow the step...

1 day ago | 0

Closed-loop parameters identification

Hi @Andrea Carlo Giorgio Gottardini I see. You need the mathematical model to perform tuning on the PID. Since the Simulink mod...

1 day ago | 0

is there any way to train a model to learn a matrix and all variables in it then generate same matrix

Hi @hessam asadi The answer is generally yes, it is possible to train so long as it is a non-singular (invertible) matrix. Fir...

1 day ago | 0

Why the controller block diagram is not working (while tracking the reference and water level in tank 2 at specific level)?

Hi @Sana Mohamed It seems that your equation for causes the level of Tank #2 to dip below 0, thus term sqrt(x(2)) returns an ...

1 day ago | 0

defining state matrix as anonymous function

Hi @Nicole The input should be defined for in order for the anonymous function to work properly in MATLAB. % parameters m ...

1 day ago | 0

2-DOF Damped Unforced System. Finding Natural Frequences/Damping ratios. Receptance Matrix.

Hi @Nikolaj Gatijatullin I don't have sufficient knowledge about System 2 (2-DOF). If you can show how you normally use Mathema...

4 days ago | 0

Plot step response for control signal (u1 u2 ...) in a MIMO system with feedback

Hi @Cesar Adolfo Cruz Vargaya The original plant is a coupled 2nd-order MIMO system. If the desired closed-loop transfer functi...

5 days ago | 0

PID implementation using code

Hi @Sanjeet Kulkarni Wouldn't it be simpler if you obtain the signal directly from the Integrator block, and then feed it into...

6 days ago | 0

Optimizing simulink parameters from matlab code

Hi @Jasmin Falconer Put it another way around, you can fminunc() to directly optimize the gains from the Simulink model and th...

6 days ago | 0

conversion from fmincom to NSGA -II

Hi @basit mujtaba If you have written your own NSGA-II algorithm in a MALTAB function file, for example, called nsga2.m, then y...

6 days ago | 0

Find likelihood from state space with Kalman filter

Hi @Rob Perhaps you are looking for the likelihood() function. help likelihood

7 days ago | 0

| accepted

Driving force of driven damped harmonic oscillator missing

Hi @Jerry Yeung Basically, there is nothing wrong with your original code. The reason that the spring response is not affected ...

8 days ago | 0

I need cost function for tuning PID controller help me

Hi @Yazeed Ali Not sure what your system is, but I think you can try the one of the simplest cost function probably looks like ...

8 days ago | 0

nonlinear variable state space observer pole placement

Hi @Bernd Pfeifer Long time I didn't solve math puzzles like this one. Generally, you should be able find the analytical soluti...

15 days ago | 2

finding the distance between two points

Hi @Natali Petani You can try the function: pdist2(). https://www.mathworks.com/help/stats/pdist2.html help pdist2

19 days ago | 0

Input Signal from state space model

Hi @Justin You can try using the lsim() function. Search Google/Documentation for details. Example is shown below: A = [ 0 ...

19 days ago | 0

My Simulink Model takes hours to complete 1 second, and I need to run it for 5,000 second. I tried to change the minimum time step, but Matlab keeps giving erros when I do so.

Hi @janna roberts The typical satellite attitude dynamics are not stiff. You can try, but I think changing it to a stiff solver...

19 days ago | 0

How to verify if my system (Z-domain) is stable in MATLAB

Hi @Rafael Most probably because you did a "positive feedback". Try do this impulse(feedback(K*TF, 1)) instead of impulse(f...

20 days ago | 0

How to make the linear function

Aha, I see... If you want to get rid of spikes and want a smooth transition, but not strictly linear, then you can consider addi...

21 days ago | 0

Creating custom Transfer Function with more learnable parameters

*Edit*: This article contains information about creating custom functions for NN. https://www.mathworks.com/help/deeplearnin...

21 days ago | 0

What algorithm to use for collision avoidance of a robot?

Hi @Farzad Torabi I'm unsure. Maybe you intend to tell the robot to "back down" or retract the arm? Conventionally, RRT is an ...

22 days ago | 2

| accepted

PID for fixed distance

Hi @Andrea Tonelli I think your control design part is okay. But the divergence issue is probably related to the way you setup ...

22 days ago | 0

Why does matlab plot the unit step like a straight line?

Hi @Mark S System 1: s = tf('s'); sys1 = 1/s; % integrator system step(sys1) System 2: sys2 = zpk([], [...

23 days ago | 1

| accepted

Minimization of cost function on MPC

Hi @Chandrakanth Pavanaskar You have a system model sys and I presume that you have written your own code for the ODE_solver to...

24 days ago | 0

How can i get smooth sine wave in MATLAB R2020b with any frequency.

Hi @Rohit To get a smooth sine wave, you are suggested to use this Sine Wave Function block: https://www.mathworks.com/help/...

24 days ago | 0

Implement these expressions in OCTAVE and plot on the same figure, the two functions: f=3t2 +2t-0.5 , g=2t cos(t) where the variable t varies from 0 to 10 with step 0.5.

@Jignasa, I typed exactly the same equations as you knowingly put on the description. But it gives error. Please check if the...

25 days ago | 0