Skip to main content

Questions tagged [matlab]

Use of Matlab to solve engineering problems.

53 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
1 answer
168 views

dSPACE compiler linker error -- fscanf undefined

I'm dealing with a somewhat intractable problem. We're running dSPACE 7.4 (RTI 1006) on MATLAB 2011a, which I understand uses the dSPACE DS1006 C Compiler v. 2.2. When I try to compile one of our ...
ZStamler's user avatar
3 votes
0 answers
132 views

Mathematical transformation of a heading angle to a roll angle

I'm trying to understand a function in a SIMULINK example of a path following UAV simulation. The gist is that, the UAV Waypoint Follower block provides a required heading from a list of waypoints and ...
Chryron's user avatar
  • 141
3 votes
0 answers
110 views

LQR Implementation in MATLAB

I am trying to implement a simple LQR controller in MATLAB for a purely deterministic system. The code is shown below: ...
Josh Pilipovsky's user avatar
3 votes
0 answers
368 views

3 DOF SISO state space control

As part of a control systems course I have to implement control for a 3 DOF SISO mass spring damper model of a robotic cutter arm. The arm is to follow a 5Hz triangle wave reference which is ...
Hieronymus Blois's user avatar
3 votes
0 answers
75 views

How to solve LMIs with equality constraints using MATLAB?

I would like to find n by n matrices P and Q that minimize J = norm(P) + w*norm(Q), where w is a given weight, subject to P>=0, Q>=0, and f(P,Q)=0, where f(P,Q)=0 is a given function of P and R. I ...
David's user avatar
  • 31
2 votes
0 answers
41 views

Discretise this transport equation

I am trying to discretise the PDE: $$\phi \frac{\partial c}{\partial t}+\frac{\partial j}{\partial x}=0$$ where $c$ is a function of $x$ and $t$, and $j=qc-D(q)\frac{\partial c}{\partial x}$, $q$ is ...
Vincent Tang's user avatar
2 votes
0 answers
65 views

calculate output $y(t)$ from $Y(z)$ having discrete closed loop model with sine input - residue method

I have closed loop - discrete model. This is how it looks in matlab: I need to compute analitically output $y(t)$ (same as in the Matlab's scope) having $Y(z)$. Where $Y(z)=U(z)*G(z)$ Input is sine ...
mdkdy's user avatar
  • 121
2 votes
0 answers
699 views

Export simulink sdi dataset from MATLAB 2015b

I have used the Simulation Data Inspector in Simulink to log a dataset of two time varying signals. The only option I see concerning exporting is to .mat or to workspace, which basically produce the ...
fluxmodel's user avatar
  • 121
1 vote
1 answer
72 views

Optimizing Launch to LEO

I recently decided I would try to develop my own launch to LEO optimizer, as I have always been fascinated with the complexity of that problem. I have been using matlab, as I am very comfortable with ...
Frank's user avatar
  • 11
1 vote
0 answers
350 views

Errors obtained in the numerical solution of the 1D convection-diffusion equation

I have been trying to solve the 1D convection-diffusion equation In implementing the above, I have tried to follow closely the method described here: https://uk.mathworks.com/support/search.html/...
gary105's user avatar
  • 23
1 vote
0 answers
30 views

Slow integration of system ODE under specific conditions in adsorption problem

I am trying to solve the system of ODEs below. I am applying the finite differences to z, so I get a system of ODE that I can solve with a solver like ode45. The problem is that under the conditions ...
Synergix's user avatar
1 vote
1 answer
521 views

How to calculate initial concentration of first-order reaction in CSTR?

(This question comes from a Chemical Engineering background, but basic Math and Programming knowledge is also required. I hope it still falls in the scope of engineering.stackexchange.com If not, ...
winkmal's user avatar
  • 111
1 vote
0 answers
11 views

how to implement an encoder in matlab

How can I encode a quantized vector in matlab ? This is a part of a problem where I am asked to implement a communication block using matlab.
user23713's user avatar
1 vote
0 answers
22 views

Unexpected Closed-Loop System Response of Longitudinal Aircraft Dynamics

I have a closed-loop system that represents the longitudinal dynamics of an aircraft with states x velocity, z velocity, pitch rate, pitch, and x and z inertial positions. The outputs of the system (...
ian.cooke's user avatar
1 vote
0 answers
42 views

How can I measure the impact of noise on a FFT?

Please, I have to solve a problem and I really need some help. I have to give an efficient method to consider a maximum amplitude as a starting point to consider as noise the whole spectrum below ...
André Rocha's user avatar
1 vote
0 answers
326 views

Designing a PID Controller for Satellite Control

As an Aerospace Engineering Student, I have been trying to make a project of a PID Controller to control the attitude response of a satellite using the parameters from a project called Kufasat. The ...
user3081005's user avatar
1 vote
0 answers
163 views

Method to simulate a dipole antenna in salt water?

I am looking to simulate the radiation pattern of a 2.7Ghz half-wavelength dipole antenna immersed in salt water. I've been using Altair FEKO software to try and accomplish this. I've tried two ...
Scott Hall's user avatar
1 vote
0 answers
97 views

Maintaining constant speed of a CVT engine during a slope

I am not sure if this question is related to this community. But nevertheless. I work on CVT engines, I had a new idea of modifying my controller during a slope or a gradient on the road so that the ...
user5603723's user avatar
1 vote
0 answers
71 views

Temperature distribution

First of all I am just a starter in Matlab, so the program is not optimized. For now I just want to get it running. This is a 3D heat problem with boundary conditions. Fixed temperature from the north,...
Rachid Brah's user avatar
1 vote
0 answers
45 views

Simulink analysis of data parallel to generation

I would like to simulate the following scenario with Simulink/Matlab(/Stateflow): A random number generator is running. Every 10 seconds the numbers that were generated during the last 10 seconds are ...
ec-m's user avatar
  • 111
1 vote
0 answers
26 views

Linear Guidance law into X-Y axis

Im currently writing a model for a guidance law named Maintaining Guidance law. The law looks as following: $$ a_{M} = [K_1,K_2]*[\dot{\lambda_T} ,\dot{\lambda_D}]'$$ Since im using a linear model I ...
Ben's user avatar
  • 121
0 votes
0 answers
40 views

Temperature profile in a pipe flow with Matlab pdepe solver

I’m currently trying to solve the heat equation for the Ohmic heating of a pipe flow using the MATLAB pdepe solver. The problem is described in the following paper: https://doi.org/10.4236/ojmsi.2021....
arnaud2547's user avatar
0 votes
0 answers
15 views

How to implement ESN layers or more generally reservoir computing approach in MATLAB DDPG agent

Is it possible to use echo state neural networks and generally reservoir computing approach as actor and critic networks in MATLAB with DDPG agent? Does MATLAB support this feature? If yes, how to do ...
AMS's user avatar
  • 1
0 votes
0 answers
11 views

High-level sun sensor modelling for satellite

I am searching for some references on how to model at high level a sensor in terms of the statistical interpretation of the errors (bias, noise, ecc). Do someone have any reference (books or papers) ...
daniele__'s user avatar
0 votes
0 answers
25 views

Designing transfer function compensator to create a stable response

I am working on create a control system to control a satellite to be fixed with respect to a distant start (theoretically). The transfer function of the dynamic model of the system is shown below in ...
Oliver's user avatar
  • 1
0 votes
0 answers
25 views

Autonomous vehicle lateral control

I am working on a control system for autonomous vehicles, i am using a kinematic bicycle model simulated on matlab simulink and the formula i used for the steering angle is given in the figures below ...
Asmaa GZ's user avatar
0 votes
0 answers
25 views

Calculating noise floor level and SNR

I have N samples of a baseband IQ signal that I took from an SDR (Pluto) with a certain fs (BW = fs). How can I accurately calculate the noise floor level of that signal in dBm, SNR in dB and Peak To ...
Daniel Cohen's user avatar
0 votes
1 answer
61 views

Genetic Algorithm (GA) MATLAB

I want to find the point that a two variable function has a maximum using a genetic algorithm in MATLAB. The following code implements my function. The initial function has no minus sign. ...
Pavlos Papanikolaou's user avatar
0 votes
0 answers
15 views

81 Level Inverter Problem when using a Motor as a Load (Simulink)

i made a VFD based on (See reference 1). The problem is that, when connecting a Motor (Asyncrhonous Machine SI) as the load... the Noise just goes crazy. First, using an RLC Series Load (Default) i ...
MastergGM's user avatar
0 votes
0 answers
16 views

Signal processing and modulation in Simulink

I want to add input to my Simulink model from PC / Laptop keyboard. I found a few similar s-functions in which this opportunity is implemented but the problem is that it only shows a discrete "...
syat-cd's user avatar
0 votes
0 answers
12 views

How to add wireless capability to DC Electric Charging Vehicle Diagram?

I am using this DC EV Charger model as a base for research provided by Mathworks: https://www.mathworks.com/help/sps/ug/dc-fast-charger.html I want to add some wireless receiver/transciever to the ...
ADAS20's user avatar
  • 1
0 votes
0 answers
66 views

How to implement H-infinity controller in STM32 platform?

I used matlab to simulate some H infinity controllers, and I have some understanding of the related theory. But I don't know how to implement H-infinite controller on STM32 platform using C/C++ code. ...
zymaster's user avatar
0 votes
0 answers
30 views

Is a vibrating Euler beam supposed to behave in this way?

I am a student of mathematics and for my modelling seminar, I need to dip a little bit into engineering in order to model the movements of a suspension bridge under influence of wind. This will be ...
Eriol's user avatar
  • 1
0 votes
0 answers
37 views

steering wheel angle control

I am working on an autonomous vehicle's control, specifically the steering wheel angle control. Knowing that I used kinematic bicycle model, my questions are: How do I choose the actuator for my ...
Asmaa GZ's user avatar
0 votes
1 answer
68 views

Orientation and horizontal position control of a bar in 2D

I have a scenario where I have a bar of 0.1 m in length, 10N weight is applied in the center. Two forces are applied on the bar at both ends vertically, right one if 5.1 N and the left one is at ...
Jack L's user avatar
  • 1
0 votes
1 answer
93 views

Proposing a Transfer Function from a Response Graph

I need to propose a transfer function from the following graph. The K value (or amplifier gain?) we were given is 2 and it has a step response of 2 as well. When looking at the graph though it looks ...
CluelessEng's user avatar
0 votes
0 answers
79 views

Simulink models comparison issue

I'm comparing two simulink models and in the report i'm getting the following difference. I don't really figure out what that difference is. Any idea is appreciated
Mohammad's user avatar
0 votes
0 answers
54 views

What is the solutions of the following 1D diffusion equality using Crank–Nicolson method?

Through my research I faced to the following equality and need to find $c_i^{t+1}$. Moreover, I found that it can be solved by Crank–Nicolson method (see here: https://en.wikipedia.org/wiki/Crank%...
soodehMehboodi's user avatar
0 votes
0 answers
74 views

Structured trianglar finite element mesh in MATALB

The available triangular mesh in the MATLAB PDE tool box here gives an unstructured triangular mesh. How can I get a structured triangular mesh from the tool box with a similar data structure [p,e,t]. ...
Morcus's user avatar
  • 101
0 votes
0 answers
107 views

Double Summation of Matrices in Convex Optimization in CVX

I want to implement the following optimization problem from the following paper Randomized Gossip Algorithms, Page 10 Eq. 53\ 1- In this problem, $W$, $P$, and $P_{ij}$ are $n\times{n}$ matrices. I ...
Spring Breeze's user avatar
0 votes
1 answer
447 views

Simulink Treating Discrete-Time State-Space as Continuous-Time?

I have a MATLAB script wherein I take a second-order ODE on $\mathbb{R}^3$ (vector field on the phase space), then, at a critical point, take the Jacobian matrix $A$, use a "fully-actuated" ...
Jeffrey Rolland's user avatar
0 votes
1 answer
83 views

"Roll My Own" Integrator Block for Multiple Signals

Is it possible to create a user-defined block in Simulink (and, later, XCos) that accepts a variable number of signals (I anticipate working with mainly 12 signals but not necessarily that number of ...
Jeffrey Rolland's user avatar
0 votes
0 answers
118 views

How do I find the gain from the root locus with given perfomance, where I know the real part of the poles?

I have an exercise to draw a root locus plot and determine its gain to make sure that it fulfills the performance requirements. the given system G(s) is $$G(s) = \frac{1}{s^2+s}$$ And the given ...
Zain's user avatar
  • 1
0 votes
0 answers
33 views

Process disturbance in PI controller help

This is the project i'm working on and i'm struggling to understand one sentence which is stopping me from progressing the project. I'm struggling to understand what it means when it says to add +/- ...
Samuel Pappalardo's user avatar
0 votes
0 answers
49 views

Mixed Sensitivity Problem

I have plant, $$P(s) = \frac{1-s/5}{(s^2 + s/4 +1/4)}$$ I am taking a mixed sensitivity approach for that I have chosen $V$,$W_1$ and $W_2$ as follows: For bandwidth, $\omega$ =1 so I chose M as, $M = ...
Rip97's user avatar
  • 1
0 votes
0 answers
171 views

Plotting S parameters on Matlab

I have equations for S11 and S21 parameters for a bandpass filter which are obviously frequency dependent. I know there are commands like sparameters() and rfplot() used specifically for plotting S ...
JOHN's user avatar
  • 11
0 votes
0 answers
96 views

How to model a double transfer function in Simulink?

I'm trying to model an actuator in Simulink based transfer functions previously derived. One of functions is $$\omega_p=G_2(K_cG_1V_c-c)$$ where $$G_1=\frac{K_e}{\tau_es+1}$$ $$G_2=\frac{1}{c+...
square potato's user avatar
0 votes
0 answers
608 views

How to obtain transfer function of servo?

I am using a servo motor and controlling it via arduino. Servo motor is part of a control system and I have to use System Identification techniques in order to obtain the servo's transfer function. ...
Teo Protoulis's user avatar
0 votes
0 answers
74 views

effect of coupling in MIMO systems

I have a MIMO system with a 2x2 transfer matrix, for example consider: $\begin{pmatrix} \frac{2}{s+1} & \frac{1}{(s+1)(s+2)}\\ \frac{1}{(s+1)(s+2)}&\frac{2}{s+2} \end{pmatrix}$ I would ...
J.D.'s user avatar
  • 225
0 votes
0 answers
71 views

Tool to simulate sensor data

Say I have a light source at a distance of 1Km from a light detector (photo detector). Right in front of the sensor, I keep a rotating reticle with some sort of pattern. To better appreciate the ...
Ashwin Kumar k's user avatar