MATLAB (an abbreviation of "matrix laboratory") is a proprietary multi-paradigm programming language and numeric computing environment developed by MathWorks. MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages.
Although MATLAB is intended primarily for numeric computing, an optional toolbox uses the MuPAD symbolic engine allowing access to symbolic computing abilities. An additional package, Simulink, adds graphical multi-domain simulation and model-based design for dynamic and embedded systems.
As of 2020, MATLAB has more than 4 million users worldwide. MATLAB users come from various backgrounds of engineering, science, and economics.
I have to plot the conductivity dependence of temperature and I have problems with obtaining the right dependency of \mu and n. But let's focus only on carrier concentration first.
For n I used the third equation. From what I understand N_D is a constant. I want my plot to look like this:
But...
I am performing extraction flash calculations for 4 component and 2 phase system. For anyone somewhat shaky with what extraction flash calculation is; extraction is performed, feed composition is known and we are calculating compositions of both phases at equilibrium, mole fraction of every...
Equation:
, where matrix D, C, G and F can be represented by
I'm supposed to design a control system that looks like this:
I am given that the dynamic model = fcn(D,C,G,dq) where the dq is the same as 𝑞̇ and d2q in the diagram is the same 𝑞̈. The default initial value of [𝑞(0), 𝑞̇(0)] is...
The method I employed was based on a nested loop. I ran into two issues with this approach
1. The code took way too long to run, easily going for over 7 minutes.
2. In the end, it didn't even completely work, due to the "index exceeding the array length". This confuses me
For the relevant...
First of all, I'm an absolute beginner in MATLAB.
Secondly, I have 2 MATLAB files, one entitled as a "main file" and the other one as a helping .m file, which is called by the main file. I need to run the main file in order to obtain 3 plots. What is the exact procedure that I should follow in...
Hello!.
I am new to the forum and I am also a newbie to programming. I want to convert a Mathematica code to Matlab, but I don't understand how to translate these lines. This code is Mathematica 5.0.
defvar := Module[{a},
Clear[ cN, cNf, ginix ];
Clear[ Nh, Nhf, gini ];
cN =...
Hello everyone. I am trying to construct a functioning version of randomfields (specifically 2D_karhunen_loeve_identification_example.py) in Matlab. For that, I have to calculate the Karhunen-Loève expansion of 2D data, since this is what it says in the documentation. I also have some sample...
hi guys
i build a little function that outputs a symbolic expression like that below, this is only a part of it:
(105*(x(5)^2/r^2 - 1)^2)/8 + (210*x(5)^2*(x(5)^2/r^2 - 1))/r^2))/(r^2)^(9/2) + (8*R^7*u*x(5)
the problem is the only way to integrate this output is to expand the function externally...
i am new to matlab and and as shown below I have a second order differential equation M*u''+K*u=F(t) where M is the mass matrix and K is the stifness matrix and u is the displacement.
and i have to write a code for matlab using ODE45 to get a solution for u. there was not so much information on...
Hello everyone. I want to calculate the covariance matrix of a stochastic process using Matlab as
cov(listOfUVValues)
being the dimensions of listOfUVValues 211302*50. I get the following error:
Requested 211302x211302 (332.7GB) array exceeds maximum array size preference. Creation of...
I am trying to simulate and process the Doppler signals. My main problem is a little more complex so I am only posting a simple version of it. Task1: I have a time-domain signal with the velocity of the target as mu. I need to change the velocity to mu cos(theta) where theta is a vector from 0...
Hello everyone. I am trying to implement the mcKL expansion proposed in this article using Matlab and two vectors of correlated data of size 1000*50, meaning 50 realizations of two random processes measured 1000 times. As the article says, if two stochastic processes are correlated, one cannot...
function Asteroid_Mining
clc
%Initial conditions
g0 = 9.81; %gravity (m/s^2)
p = 1.225; %atmospheric density at sea level (kg/m3)
Re = 6378; %radius of Earth (km)
Ra = 7.431e7; %distance of Bennu from Earth in (km) [August 2023]
G = 6.674e-11/1e9; % Gravitational constant (km3/kg.s2)
mu =...
Using MATLAB, I am trying to calculate the time taken for a spacecraft to travel from Earth to a near earth asteroid and then returning back to Earth but so far I have had no luck. Furthermore, I want to plot a Hohmann transfer and calculate the mass of fuel required for this mission. If...
The assignment is to find the optimal operating temperature and maximum product concentration of reactant B, assuming a constant temperature across the PFR length. Please could someone help? thanks
the reaction is a series reaction: A → B → C (liquid phase)
Here is my current code which is...
The problem I am having is simple. I have a Gaussian spectrum initially. Like this,
Process 1:
S = m0/sqrt(2*pi*sigma^2) * exp(-(vel_axis - mu).^2/(2*sigma^2));
Here, mu is the mean velocity (frequency) and sigma is the standard deviation. vel_axis is the axis on which I am calculating this...
Hi, 2 part question trying to get tetrahedron Finite Element shape functions working: 1) How do I properly setup the shape coefficient matrix and 2) How do I build the coefficient quantities in the shape functions properly? ANY tips or corrections may unblock me and would be of much value...
hi guys
i was trying to use this shooting algorithm from Xue and Chen Scientific Computing with MATLAB book :
to solve this non linear temperature distribution problem :
i checked my Matlab function multiple times but i am keep getting a nonsense graph for the temperature , can someone cheak...
We have to submit a Matlab (my worst module) assignment to show the heat transfer on a plate. However, I have the 2 codes almost done but I am struggling to write the report. To calculate the temperature on a 2D aluminum plate we need to use the Explicit Finite Difference Method. The problem...
hi guys
i was trying to solve this non linear ode using the shooting algorithm in Matlab :
i am not sure how to solve it using the normal shooting algorithm i have , since no other boundary at x = L/2 was given to check the shooting ?!
function dTdx = bar_temp(x,y)
k = 72;
h = 2000;
epsilon =...
I am trying to solve a PDE (which I believe can be approximated as an ODE). I have tried to solve it using 4th Order Runge-Kutta in MATLAB, but have struggled with convergence, even at an extremely high number of steps (N=100,000,000). The PDE is:
\frac{\partial^2 E(z)}{\partial z^2} +...
Hi! First off, I'm just an upcoming junior in Civil Engineering, and I have little teaching experience. I have done well in engineering classes so far though, and I've thought about ways to improve how classes are taught. While there are some widgets for engineering, like those in MATHTAB and...
Hi,
So i am in a fix now. I have a discrete time signal which is produced by a device with Nyquist frequency as 50MHz and 1088 samples (there is nothing i can do with the device to change the frequency or number of samples). I have an analytical signal which is produced in the frequency domain...
Introduction: I am writing a Matlab program that solves the Kepler problem for any Elliptical, Hyperbolic, or Circular orbit. Given an initial position vector, velocity vector, find the position vector and velocity vector after some given time. I am not doing this for any class, I have been...
Here is the documentation for the 2DFFT:
https://www.mathworks.com/help/matlab/ref/fft2.html
how would I go about creating this formula on matlab to apply it on an image? My guess is that I need to create the equation and then multiply it to the image I need such as:
$$U = VI$$
where V is my...
I researched the solar collectors implemented in practice for water detoxification and I found out that the preferred design is the Compound Parabolic Concentrator. Knowing that I have no information regarding radiation beyond what's taught generally in heat transfer courses in chemical...
Hello PF,
I need some guide points to help me formulate a project idea on the topic of optical fibers.
Namely, the professor suggested I should look for topics on modeling of optical fibers, analysis of different optical fibers, characteristics etc. and to work in a simulator, or perform a...
I am trying to model an evaporator which evaporates water to steam in Matlab/simulink. Are there any governing equations i need to know and follow when modelling the evaporator mathematically? Please let me know.
%My code:
%Type of signal: square
T = 40; %Period of the signal [s]
F=1/T; % fr
D = 23; % length of signal(duration)
dt=(D/T)*100;
N = 50; %Number of coefficients
w0 = 2*pi/T; %signal pulse
t1= 0:0.002:T; % original signal sampling
x1 = square((2*pi*F)*(t1),dt);%initial square signal...
Hello.
So, I must provide a solution for an image processing course I am taking (implemented in MATLAB).
The task is as follows:
1. I must provide a MATLAB script that takes in a DISCRETE N x N matrix (Greyscale picture) and does Bilinear spline interpolation on it.
This is the spline...
I know these software packages were discussed a lot in the past, but I have not seen much input from the last couple years.
I have used Matlab for many years, but remember using Maple in University Physics courses many years ago. I'm interested in a software package for symbolic math to use...
Mentor node: Added code tags
From=menu('select:','c', 'g', 'a', 's:'); This is part of my code and I'm not coming up with anything close
l=input('input wire length') %current copper=12.5572...
After completing my sophomore year at college as a Physics major and I realized that the laptop I currently have is not able to keep up with the demand I put it under for school. The laptop I currently have has a <2 hour battery life and has been known to crap out (didn't know how else to...
So, Basic premise is I have 1 input and one output, Energy friom the gunpower burning is input, and the output is the force which pushes the bullet after it is reduced by the friction.
m = 12.96 g
s = 0.6985 m (barrel lenght)
E = 6734 J
k = 0.5 (friction coeffcient)
I am sorry for lack of...
I am new to Simulink and I wanted to start practicing using a spring mass damper system. My first tutorial was this:
Later, I wanted to model a spring system where a mass moving at a known velocity hits the spring. The governing equation and a similar modeling method given in the previous...
Hello, I am trying to find the solution of Schrödinger equation on matlab. However, when I apply boundary conditions, MATLAB only gives me the solution with both coefficients 0. I want to find the solution : Asin(n*pi*x/L)
You can see my code below. Could you please tell me where is my mistake...
I am trying to write an algorithm that generates two random numbers in a given interval such that their ratio is an irrational number. I understand that all numbers stored on a computer are rational, so it is not possible to have a truly irrational number in a simulation. So, instead I am...
For simplicity, let ##N=1##. The following histograms show my results. The generated random numbers are initially exponentially distributed. But after re-scaling they become almost uniformly distributed.
What is the cause of that, and is there a solution?
P.S. Here is my code in Matlab...
WHAT HAPPENS IS That I need to model the example of A Protein G example, using a function f in Matlab, but when I execute the script, the graphics I get do not correspond to those of the example.
The problem is that I can not understand what the model seeks to represent, besides that I do not...
There is an original image test1.jpg. The problem is to show axes in the image and retain image quality.
I am running the following code:
img = imread('test1.jpg');
% define variables
imgsize1 = size(img,1); % size on screen
imgsize2 = size(img,2);
xreal = 1; % meter
yreal = 1; %...
I wrote the following code in MATLAB:
t = [0:0.001:0.1];
noise = randn(1,size(t,2));
a = 15*10^9;
b = 15*10^(-3);
c = 7*10^8;
y = a*exp(-t/b)+c+noise*100000000;
fun = @(p,t)p(1)*exp(-t/p(2))+p(3);
p0 = [15.5*10^9, 14*10^(-3), 6*10^8];
p = lsqcurvefit(fun, p0, t, y);
t_fit = [0:0.0001:0.1];
y_fit...
Hello all:
I am reading a comutacomputa physics book and trying a code from it in MATLAB it is not working and due to my lack of knowledge in this field I can't see where is the mistake hope you can take a look
import java.lang .*;
public class Motion {
static final int n = 100000, j =...
Homework Statement
Hi,
I am new to MATLAB and have an assignment where I have to construct a Hamiltonian matrix, apply boundary conditions, then find corresponding eigenvalues and eigenvectors for the electron in a box problem. I am stumped where to start. From our class we learned that you...
Hello,
I am trying to do the following:
I have two inputs that are very large files - I extract the first column of each so I have two vectors of ~2-5mil by 1. This is timing information. The goal is to extract the indices of each vector where the time in one vector is within a certain...
I have experimental spectrum in which y-axis is intensity values, and x-axis is frequency values. Int - array of experimental intensities (y-axis). w - array of frequencies (x-axis). I know the view of theoretical function that must describe the obtained spectrum. I explicitly set the function...
Dear Sirs,
I have a signal which has an attenuation of 20dB per decade, how do I remove this attenuation using SCIPY? Alternatively how to do it in MATLAB if there are no SCIPY users here?
I'm a SCIPY/MATLAB novice fyg.
Thank you for your kind assistance
Abim