Results for
Hi everyone,
I need deep orientation to make calculation of speed and Angle for the absolute encoder RM22SC with signal (data+, Data-, Clock +, Clock -) using Launchpad F28379D and Simulink.
I did interface the absolute encoder with IC DS26LS32CN and I did get signal Data and Clock. I did use the GPIO20 for Data and GPIO21 for Clock and connect both to the Matlab Function block to get as output the position. See the code on attached.  The output of the Matlab function times 2*pi/8192 to get the angle. However, I don't get anything as value. 
Matlab Fuction Block code
function position = decodeSSI(data, clock)
    %#codegen
    persistent bitCounter shiftRegister prevClock
    if isempty(bitCounter)
        bitCounter = uint32(0);
        shiftRegister = uint32(0);
        prevClock = uint32(0);
    end
    % Parameters
    numBits = 13; % Number of bits in the SSI word
    % Rising edge detection for clock
    clock = uint32(clock);  % Ensure clock is of type integer
    clockRisingEdge = (clock == 1) && (prevClock == 0);
    prevClock = clock;
    if clockRisingEdge
        bitCounter = bitCounter + 1;
        % Shift in the data bit
        shiftRegister = bitor(bitshift(shiftRegister, 1), uint32(data));
        % Check if we have received the full word
        if bitCounter == numBits
            position = shiftRegister;
            % Reset for the next word
            bitCounter = uint32(0);
            shiftRegister = uint32(0);
        else
            position = uint32(0); % or NaN to indicate incomplete data
        end
    else
        position = uint32(0); % or retain the last valid position
    end
end
Problem statement:  I've written a visualization that I'd like to use on potentially hundreds of different channels in my commerical account. Because it contains code that's unique to the channel (channel id, read API key, etc.) I have to create and maintain a duplicate visualization for each channel. This is wasteful,  a source of errors, and almost intractable for a commercial customer with a high channel count.
My request is that MATLAB Visualizations be extended to support parameters, but only a predefined set to reduce the scope. I would propose a subset of the parameters currently supported by the ThingSpeak API.  For example, thingSpeakRead supports (requires)  readChannelID, NumPoints, and a ReadKey etc. If those were elevated to also be allowed as Visualization parameters, I imagine it would satisfy a large subset of user needs.
The poor man's version of this would be if ThingSpeak supported just one special parameter, such as %CHANNEL_ID%. If this was available within the visualization code one could use it as a key into table to get the other pieces of data like API keys, etc. It would be have to be passed on the visualization url (https://thingspeak.com/apps/matlab_visualizations/573779?readChannelID=xxxxx). Not sure how the visualization would pick it up in the use case where it's called from the ThingSpeak website under the user's list of MATLAB Visualizations. Perhaps it can be prompted for.
I initially considered user defined functions or libraries but they are not supported and I can see that that would require even more development work to support. The workarounds described in this thread aren't suitable for me. https://www.mathworks.com/matlabcentral/answers/2102981-how-to-use-private-functions-lib-in-thingspeak?s_tid=srchtitle_community_thingspeak_14_libraries
thanks!
Tom
Hello everyone, i hope you all are in good health. i need to ask you about the help about where i should start to get indulge in matlab. I am an electrical engineer but having experience of construction field. I am new here. Please do help me. I shall be waiting forward to hear from you. I shall be grateful to you. Need recommendations and suggestions from experienced members. Thank you.
I recently wrote up a document which addresses the solution of ordinary and partial differential equations in Matlab (with some Python examples thrown in for those who are interested). For ODEs, both initial and boundary value problems are addressed. For PDEs, it addresses parabolic and elliptic equations. The emphasis is on finite difference approaches and built-in functions are discussed when available. Theory is kept to a minimum. I also provide a discussion of strategies for checking the results, because I think many students are too quick to trust their solutions. For anyone interested, the document can be found at https://blanchard.neep.wisc.edu/SolvingDifferentialEquationsWithMatlab.pdf 
hello i'm working on simulation using simulink which is my title is ENHANCING BATTERYENERGY STORAGE SYSTEMSTHROUGH MODULAR MULTILEVEL CONVERTER WITH STATE-OF-CHARGE BALANCING CONTROL. i already build 9 level mmc. but i dont have any idea for state of charge balancing control.please any suggestion and explain.
how can I link a chinese flow meter to this website
Kindly link me to the Channel Modeling Group.
I read and compreheneded a paper on channel modeling "An Adaptive Geometry-Based Stochastic Model for Non-Isotropic MIMO Mobile-to-Mobile Channels" except the graphical results obtained from the MATLAB codes. I have tried to replicate the same graphs but to no avail from my codes. And I am really interested in the topic, i have even written to the authors of the paper but as usual, there is no reply from them. Kindly assist if possible.  
Hi, I'm looking for sites where I can find coding & algorithms problems and their solutions. I'm doing this workshop in college and I'll need some problems to go over with the students and explain how Matlab works by solving the problems with them and then reviewing and going over different solution options. Does anyone know a website like that? I've tried looking in the Matlab Cody By Mathworks, but didn't exactly find what I'm looking for. Thanks in advance.
Die Anzeige der Werte in den einzelnen Feldern ist nicht aktuell.
So werden z.B. um 18:00 Uhr nur die Werte bis 14:00 Uhr angezeigt, auch das verändern des Zeitfensters bringt keine Abhilfe.
Hat jemand eine Idee wie ich die der Uhrzeit ensprechenden Werte zur Anzeige bringe.
Die Werte werden von Shellies und BitShake kontinuierlich übertragen.
My thingSpeak channel kept on updateing the same signal as early eventhough my simulink have update the new signal. How to solve this?
Any one have deep learning reinforcement based speed control of induction motor?
Hi ThingSpeak Community,
I hope you are all doing well.
I am currently setting up a Vodafone ACL for a SIM card that will be used in a device destined for a remote charity deployment in a week. The goal is to ensure that the device can reliably upload data to ThingSpeak without any connectivity issues.
Here are the details of my current ACL setup:
- FQDN: api.thingspeak.com (specified as the API endpoint)
- IPv4 Address: 184.106.153.149 (found online)
- Port: (left empty)
I've attached a photo of the setup for reference.
Could you please confirm if the above ACL settings are correct? Additionally, if there are any other considerations or settings I should be aware of for ensuring reliable connectivity with ThingSpeak, I would greatly appreciate your guidance.
Currently, all I am using for the device credentials is the PIN number. Do I need to adjust any settings in the Arduino code or the ACL to maintain stable connectivity with ThingSpeak, especially considering the device will be in a remote location and difficult to access for adjustments?
Your prompt assistance and advice will be immensely valuable, as I want to ensure everything is correctly configured before deployment.
Thank you very much!
Best regards,
Arthur
What do you think about the NVIDIA's achivement of becoming the top giant of manufacturing chips, especially for AI world?

错误使用 ipqpdense
The interior convex algorithm requires all objective and constraint values to be finite.
出错 quadprog 
                ipqpdense(full(H), f, A, B, Aeq, Beq, lb, ub, X0, flags, ...
出错 MPC_maikenamulun
     [X, fval,exitflag]=quadprog(H,f,A_cons,B_cons,[],[],lb,ub,[],options);
Twitch built an entire business around letting you watch over someone's shoulder while they play video games. I feel like we should be able to make at least a few videos where we get to watch over someone's shoulder while they solve Cody problems. I would pay good money for a front-row seat to watch some of my favorite solvers at work. Like, I want to know, did Alfonso Nieto-Castonon just sit down and bang out some of those answers, or did he have to think about it for a while? What was he thinking about while he solved it? What resources was he drawing on? There's nothing like watching a master craftsman at work.
I can imagine a whole category of Cody videos called "How I Solved It". I tried making one of these myself a while back, but as far as I could tell, nobody else made one.
Here's the direct link to the video: https://www.youtube.com/watch?v=hoSmO1XklAQ
I hereby challenge you to make a "How I Solved It" video and post it here. If you make one, I'll make another one.
The Ans Hack is a dubious way to shave a few points off your solution score. Instead of a standard answer like this
function y = times_two(x)
  y = 2*x;
end
you would do this
function ans = times_two(x)
  2*x;
end
The ans variable is automatically created when there is no left-hand side to an evaluated expression. But it makes for an ugly function. I don't think anyone actually defends it as a good practice. The question I would ask is: is it so offensive that it should be specifically disallowed by the rules? Or is it just one of many little hacks that you see in Cody, inelegant but tolerable in the context of the surrounding game?
Incidentally, I wrote about the Ans Hack long ago on the Community Blog. Dealing with user-unfriendly code is also one of the reasons we created the Head-to-Head voting feature. Some techniques are good for your score, and some are good for your code readability. You get to decide with you care about.
While searching the internet for some books on ordinary differential equations, I came across a link that I believe is very useful for all math students and not only. If you are interested in ODEs, it's worth taking the time to study it.
A First Look at Ordinary Differential Equations by Timothy S. Judson is an excellent resource for anyone looking to understand ODEs better. Here's a brief overview of the main topics covered:
- Introduction to ODEs: Basic concepts, definitions, and initial differential equations.
- Methods of Solution:
- Separable equations
- First-order linear equations
- Exact equations
- Transcendental functions
- Applications of ODEs: Practical examples and applications in various scientific fields.
- Systems of ODEs: Analysis and solutions of systems of differential equations.
- Series and Numerical Methods: Use of series and numerical methods for solving ODEs.
This book provides a clear and comprehensive introduction to ODEs, making it suitable for students and new researchers in mathematics. If you're interested, you can explore the book in more detail here: A First Look at Ordinary Differential Equations.
I have lon and lat  and signal stengths plotting from my roaming GPS Lora module that reports signal strength to Thingspeak at it's location. I got GEOSCATTER plotting location circles.But i want extrapulate?Interp?Heatmap. the stengths between the points. When i use Interp i end up timiming out. How do i modify my code to do this?
Public Channel 214526
Cheers Andy
The study of the dynamics of the discrete Klein - Gordon equation (DKG) with friction is given by the equation : 

In the above equation, W describes the potential function:

to which every coupled unit  adheres. In Eq. (1), the variable $
 adheres. In Eq. (1), the variable $ $ is the unknown displacement of the oscillator occupying the n-th position of the lattice, and
$ is the unknown displacement of the oscillator occupying the n-th position of the lattice, and  is the discretization parameter. We denote by h the distance between the oscillators of the lattice. The chain (DKG) contains linear damping with a damping coefficient
 is the discretization parameter. We denote by h the distance between the oscillators of the lattice. The chain (DKG) contains linear damping with a damping coefficient  , while
, while is the coefficient of the nonlinear cubic term.
is the coefficient of the nonlinear cubic term.
 adheres. In Eq. (1), the variable $
 adheres. In Eq. (1), the variable $ $ is the unknown displacement of the oscillator occupying the n-th position of the lattice, and
$ is the unknown displacement of the oscillator occupying the n-th position of the lattice, and  is the discretization parameter. We denote by h the distance between the oscillators of the lattice. The chain (DKG) contains linear damping with a damping coefficient
 is the discretization parameter. We denote by h the distance between the oscillators of the lattice. The chain (DKG) contains linear damping with a damping coefficient  , while
, while is the coefficient of the nonlinear cubic term.
is the coefficient of the nonlinear cubic term.For the DKG chain (1), we will consider the problem of initial-boundary values, with initial conditions

and Dirichlet boundary conditions at the boundary points  and
 and  , that is,
, that is,
 and
 and  , that is,
, that is,
Therefore, when necessary, we will use the short notation  for the one-dimensional discrete Laplacian
 for the one-dimensional discrete Laplacian
 for the one-dimensional discrete Laplacian
 for the one-dimensional discrete Laplacian
Now we want to investigate numerically the dynamics of the system (1)-(2)-(3). Our first aim is to conduct a numerical study of the property of Dynamic Stability of the system, which directly depends on the existence and linear stability of the branches of equilibrium points.
For the discussion of numerical results, it is also important to emphasize the role of the parameter  . By changing the time variable
. By changing the time variable  , we rewrite Eq. (1) in the form
, we rewrite Eq. (1) in the form
 . By changing the time variable
. By changing the time variable  , we rewrite Eq. (1) in the form
, we rewrite Eq. (1) in the form . We consider spatially extended initial conditions of the form:
. We consider spatially extended initial conditions of the form: where
 where  is the distance of the grid and
is the distance of the grid and  is the amplitude of the initial condition
 is the amplitude of the initial condition We also assume zero initial velocity:

 the following graphs for  and
and 
 and
and 
% Parameters
L = 200;  % Length of the system
K = 99;  % Number of spatial points
j = 2;  % Mode number
omega_d = 1;  % Characteristic frequency
beta = 1;  % Nonlinearity parameter
delta = 0.05;  % Damping coefficient
% Spatial grid
h = L / (K + 1);
n = linspace(-L/2, L/2, K+2);  % Spatial points
N = length(n);
omegaDScaled = h * omega_d;
deltaScaled = h * delta;
% Time parameters
dt = 1; % Time step
tmax = 3000; % Maximum time
tspan = 0:dt:tmax; % Time vector
% Values of amplitude 'a' to iterate over
a_values = [2, 1.95, 1.9, 1.85, 1.82];  % Modify this array as needed
% Differential equation solver function
function dYdt = odefun(~, Y, N, h, omegaDScaled, deltaScaled, beta)
    U = Y(1:N);
    Udot = Y(N+1:end);
    Uddot = zeros(size(U));
    % Laplacian (discrete second derivative)
    for k = 2:N-1
        Uddot(k) = (U(k+1) - 2 * U(k) + U(k-1)) ;
    end
    % System of equations
    dUdt = Udot;
    dUdotdt = Uddot - deltaScaled * Udot + omegaDScaled^2 * (U - beta * U.^3);
    % Pack derivatives
    dYdt = [dUdt; dUdotdt];
end
% Create a figure for subplots
figure;
% Initial plot
a_init = 2;  % Example initial amplitude for the initial condition plot
U0_init = a_init *  sin((j * pi * h * n) / L); % Initial displacement
U0_init(1) = 0; % Boundary condition at n = 0
U0_init(end) = 0; % Boundary condition at n = K+1
subplot(3, 2, 1);
plot(n, U0_init, 'r.-', 'LineWidth', 1.5, 'MarkerSize', 10); % Line and marker plot
xlabel('$x_n$', 'Interpreter', 'latex');
ylabel('$U_n$', 'Interpreter', 'latex');
title('$t=0$', 'Interpreter', 'latex');
set(gca, 'FontSize', 12, 'FontName', 'Times');
 xlim([-L/2 L/2]);
ylim([-3 3]);
grid on;
% Loop through each value of 'a' and generate the plot
for i = 1:length(a_values)
    a = a_values(i);
    % Initial conditions
    U0 = a * sin((j * pi * h * n) / L); % Initial displacement
    U0(1) = 0; % Boundary condition at n = 0
    U0(end) = 0; % Boundary condition at n = K+1
    Udot0 = zeros(size(U0)); % Initial velocity
    % Pack initial conditions
    Y0 = [U0, Udot0];
    % Solve ODE
    opts = odeset('RelTol', 1e-5, 'AbsTol', 1e-6);
    [t, Y] = ode45(@(t, Y) odefun(t, Y, N, h, omegaDScaled, deltaScaled, beta), tspan, Y0, opts);
    % Extract solutions
    U = Y(:, 1:N);
    Udot = Y(:, N+1:end);
    % Plot final displacement profile
    subplot(3, 2, i+1);
    plot(n, U(end,:), 'b.-', 'LineWidth', 1.5, 'MarkerSize', 10); % Line and marker plot
    xlabel('$x_n$', 'Interpreter', 'latex');
    ylabel('$U_n$', 'Interpreter', 'latex');
    title(['$t=3000$, $a=', num2str(a), '$'], 'Interpreter', 'latex');
    set(gca, 'FontSize', 12, 'FontName', 'Times');
      xlim([-L/2 L/2]);
ylim([-2 2]);
    grid on;
end
% Adjust layout
set(gcf, 'Position', [100, 100, 1200, 900]); % Adjust figure size as needed

Dynamics for the initial condition ,  , for
, for  , for different amplitude values. By reducing the amplitude values, we observe the convergence to equilibrium points of different branches from
, for different amplitude values. By reducing the amplitude values, we observe the convergence to equilibrium points of different branches from  and the appearance of values
 and the appearance of values  for which the solution converges to a non-linear equilibrium point
for which the solution converges to a non-linear equilibrium point  Parameters:
 Parameters: 
 , for
, for  , for different amplitude values. By reducing the amplitude values, we observe the convergence to equilibrium points of different branches from
, for different amplitude values. By reducing the amplitude values, we observe the convergence to equilibrium points of different branches from  and the appearance of values
 and the appearance of values  for which the solution converges to a non-linear equilibrium point
for which the solution converges to a non-linear equilibrium point  Parameters:
 Parameters: 

 Detection of a stability threshold  : For
: For  , the initial condition ,
, the initial condition ,  , converges to a non-linear equilibrium point
, converges to a non-linear equilibrium point .
.
 : For
: For  , the initial condition ,
, the initial condition ,  , converges to a non-linear equilibrium point
, converges to a non-linear equilibrium point .
.Characteristics for  , with corresponding norm
, with corresponding norm  where the dynamics appear in the first image of the third row, we observe convergence to a non-linear equilibrium point of branch
 where the dynamics appear in the first image of the third row, we observe convergence to a non-linear equilibrium point of branch  This has the same norm and the same energy as the previous case but the final state has a completely different profile. This result suggests secondary bifurcations have occurred in branch
 This has the same norm and the same energy as the previous case but the final state has a completely different profile. This result suggests secondary bifurcations have occurred in branch 
 , with corresponding norm
, with corresponding norm  where the dynamics appear in the first image of the third row, we observe convergence to a non-linear equilibrium point of branch
 where the dynamics appear in the first image of the third row, we observe convergence to a non-linear equilibrium point of branch  This has the same norm and the same energy as the previous case but the final state has a completely different profile. This result suggests secondary bifurcations have occurred in branch
 This has the same norm and the same energy as the previous case but the final state has a completely different profile. This result suggests secondary bifurcations have occurred in branch 
By further reducing the amplitude, distinct values of  are discerned: 1.9, 1.85, 1.81 for which the initial condition
are discerned: 1.9, 1.85, 1.81 for which the initial condition  with norms
with norms  respectively, converges to a non-linear equilibrium point of branch
 respectively, converges to a non-linear equilibrium point of branch  This equilibrium point has norm
 This equilibrium point has norm  and energy
 and energy  . The behavior of this equilibrium is illustrated in the third row and in the first image of the third row of Figure 1, and also in the first image of the third row of Figure 2. For all the values between the aforementioned a, the initial condition
. The behavior of this equilibrium is illustrated in the third row and in the first image of the third row of Figure 1, and also in the first image of the third row of Figure 2. For all the values between the aforementioned a, the initial condition  converges to geometrically different non-linear states of branch
 converges to geometrically different non-linear states of branch  as shown in the second image of the first row and the first image of the second row of Figure 2, for amplitudes
 as shown in the second image of the first row and the first image of the second row of Figure 2, for amplitudes  and
 and  respectively.
 respectively. 
 are discerned: 1.9, 1.85, 1.81 for which the initial condition
are discerned: 1.9, 1.85, 1.81 for which the initial condition  with norms
with norms  respectively, converges to a non-linear equilibrium point of branch
 respectively, converges to a non-linear equilibrium point of branch  This equilibrium point has norm
 This equilibrium point has norm  and energy
 and energy  . The behavior of this equilibrium is illustrated in the third row and in the first image of the third row of Figure 1, and also in the first image of the third row of Figure 2. For all the values between the aforementioned a, the initial condition
. The behavior of this equilibrium is illustrated in the third row and in the first image of the third row of Figure 1, and also in the first image of the third row of Figure 2. For all the values between the aforementioned a, the initial condition  converges to geometrically different non-linear states of branch
 converges to geometrically different non-linear states of branch  as shown in the second image of the first row and the first image of the second row of Figure 2, for amplitudes
 as shown in the second image of the first row and the first image of the second row of Figure 2, for amplitudes  and
 and  respectively.
 respectively. Refference:
There are a host of problems on Cody that require manipulation of the digits of a number. Examples include summing the digits of a number, separating the number into its powers, and adding very large numbers together.
If you haven't come across this trick yet, you might want to write it down (or save it electronically):
digits = num2str(4207) - '0'
That code results in the following:
digits =
     4     2     0     7
Now, summing the digits of the number is easy:
sum(digits)
ans =
    13

















