# Questions tagged [matlab]

Use of Matlab to solve engineering problems.

53 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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 ...
• 51
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 ...
• 141
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: ...
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 ...
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 ...
• 31
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 ...
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 ...
• 121
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 ...
• 121
1 vote
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 ...
• 11
1 vote
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/...
• 23
1 vote
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 ...
• 11
1 vote
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, ...
• 111
1 vote
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.
1 vote
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 (...
1 vote
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 ...
1 vote
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 ...
1 vote
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 ...
1 vote
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 ...
1 vote
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,...
1 vote
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 ...
• 111
1 vote
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 ...
• 121
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....
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 ...
• 1
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) ...
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 ...
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 ...
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 ...
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. ...
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 ...
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 "...
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 ...
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. ...
• 19
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 ...
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 ...
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 ...
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 ...
79 views

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
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%...
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]. ...
• 101
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 ...
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" ...
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 ...
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 ...
• 1
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 +/- ...