Irrationa problem

四旋翼无人机模糊自适应PID控制,俯仰姿态控制律设计研究(Matlab代码、Simulink仿真实现) 内容概要:本文围绕四旋翼无人机的俯仰姿态控制问题,深入研究了模糊自适应PID控制律的设计与实现。通过结合模糊逻辑系统的自适应能力与传统PID控制器的稳定性,构建了一种能够在复杂动态环境中有效应对外部扰动和模型不确定性的先进控制策略。研究详细阐述了控制系统的结构设计、模糊规则库的建立、隶属度函数的选取以及PID参数的在线调整机制,并利用Matlab/Simulink工具进行了完整的建模与仿真实验,验证了所提方法在响应速度、超调量和抗干扰能力等方面相较于传统PID控制的显著优越性。; 适合人群:具备自动控制理论基础和Matlab/Simulink仿真经验的自动化、航空航天及相关专业的本科生、研究生及科研人员。; 使用场景及目标:①学习和掌握模糊自适应PID控制器的设计原理与方法;②研究无人机姿态控制算法的性能提升途径;③完成相关课程设计、毕业设计或科研项目的仿真验证工作。; 阅读建议:建议读者结合Matlab代码与Simulink模型,深入理解控制算法的实现细节,并尝试调整系统参数和仿真条件,以探究不同因素对控制性能的影响,从而达到理论与实践相结合的学习目的。 立即下载
Time Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d& %I64

Description

Little Petya was given this problem for homework:

You are given function Irrational <wbr>problem (here Irrational <wbr>problem represents the operationof taking the remainder). His task is to count the number ofintegers x inrange [a;b] withproperty f(x) = x.

It is a pity that Petya forgot the order in which the remaindersshould be taken and wrote down only 4 numbers. Each of 24 possibleorders of taking the remainder has equal probability of beingchosen. For example, if Petya has numbers 1, 2, 3, 4 then he cantake remainders in that order or first take remainder modulo 4,then modulo 2, 3, 1. There also are 22 other permutations of thesenumbers that represent orders in which remainder can be taken. Inthis problem 4 numbers wrote down by Petya will be pairwisedistinct.

Now it is impossible for Petya to complete the task given byteacher but just for fun he decided to find the number ofintegers Irrational <wbr>problem with property thatprobability thatf(x) = x isnot less than 31.4159265352718281828459045%. In otherwords, Petya will pick up the number x if there existat least 7 permutations ofnumbersp1, p2, p3, p4, forwhich f(x) = x.

Input

First line of the input will contain 6 integers, separated byspaces: p1, p2, p3, p4, a, b (1 ≤ p1, p2, p3, p4 ≤ 1000, 0 ≤ a ≤ b ≤ 31415).

It is guaranteed that numbers p1, p2, p3, p4 will be pairwisedistinct.

Output

Output the number of integers in the given range that have thegiven property.

Sample Input

Input
2 7 1 8 2 8

Output
0

Input
20 30 40 50 0 100

Output
20

Input
31 41 59 26 17 43

Output
9

[Submit]  [GoBack]   [Status]

#include<iostream>
using namespace std;
int main()
{
     int a,b,p1,p2,p3,p4,count;
         while(cin>>p1>>p2>>p3>>p4>>a>>b)
         {
                 count=0;
                 for(int i=a;i<=b;i++)
                         if((((i%p1)%p2)%p3)%p4==i)
                               count++;

                         cout<<count<<endl;
         }
  return 0;
                

}


Ollama模型路径迁移实战:Windows/Mac/Linux三平台保姆级教程(附常见问题排查) 本文提供了一份详细的Ollama模型路径迁移教程,涵盖Windows、macOS和Linux三大平台。通过设置OLLAMA_MODELS环境变量或创建符号链接,指导用户将模型从默认路径安全迁移至新位置,以释放系统盘空间或提升性能。教程包含迁移前的准备、分平台步骤、迁移后的验证以及常见问题排查,确保迁移过程平滑可靠。 阅读详情

相关推荐

基于STM32与CAN总线的多电机协同控制系统设计与实现

本文详细介绍了基于STM32与CAN总线的多电机协同控制系统设计与实现。该系统采用分布式架构,通过CAN总线实现多节点通信,结合梯形加减速算法和同步控制策略,有效解决了工业自动化中多电机同步性差的问题。文章涵盖硬件设计、通信协议、抗干扰措施及实战调试经验,为工业应用提供高可靠性解决方案。

tech5的博客 979

Codeforces:68A-Irrational problem(暴力大法好)

A- Irrational problem pTime Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d& %I64DescriptionLittle Petya was given this problem for homework:You are given function Irrational problem (here

二营长的意大利炮友 354

华为AR6140E/S5735设备密码策略配置全攻略:从复杂度到锁定机制

本文详细介绍了华为AR6140E/S5735设备的密码策略配置方法,涵盖密码复杂度、时效性和防护性三大核心维度。通过具体的CLI命令示例,指导管理员如何设置密码长度、字符组合、有效期及登录失败锁定等安全机制,为企业网络提供全面的用户名密码防护策略。

weixin_30836759的博客 534

配置Nexus私服遇到的几个小问题

今天在安装配置nexus私服时,遇到了几个小问题: 1. 无法启动。 通过 ./nexus start启动时,会自动退出。通过./nexus console查看,发现时由于目录的权限问题,导致无法写日志和pid文件。Nexus的官方文档建议安装到 /usr/local下面,并且不建议使用root账户启动。不过如果安装到/usr/local下面,对某些目录的操作需要root权限,所以建议解压到一个叫...

v5browser 3907

基于FPGA的图像预处理系统(图)

 北京机械工业学院 韩娟娟 邓文怡 娄小平 由于获取图像的工具或手段的影响,使获取图像无法完全体现原始图像的全部信息。因此,对图像进行预处理就显得非常重要。预处理的目的是改善图像数据,抑制不需要的变形或者增强某些对于后续处理来说比较重要的图像特征。通常根据预处理目的的不同,把预处理技术归为图像增强技术和图像分割技术两类。图像对比度处理是空间域图像增强的一种方法。由于图像灰度范围狭窄会使

lyzhangxianglove的专栏 1781

ADS交叉耦合振荡器VCO仿真

本文主要参考视频中如何使用进行ADS交叉耦合振荡器仿真和分析,由于视频中有诸多错误和视频清晰度较低,虽然视频博主及时改正,为了节省学习时间,可以直接参考本文。

qq_32589131的博客 5440

Irrational problem

<br />第一次做CF,第一次用STL,纪念一下!<br /> <br />Codeforces Beta Round #62<br /> <br />A. Irrational problem<br />time limit per test 2 secondsmemory limit per test 256 megabytesinput standard inputoutput standard output<br />Little Petya was given this problem

My Own Space 657

RuyiDify如何创建知识库API密钥:让程序安全访问知识库

知识库 API Key 是程序访问知识库的钥匙。创建它很简单,但真正重要的是知道它能做什么、应该放在哪里、不能暴露给谁。RuyiDify 讲这一步,不是为了让大家多记一个按钮,而是为了把知识库从“人工上传资料”推进到“程序化维护资料”。

未来已来,AI时代,学AI编程,做AI量化,就来大鹏AI教育。 147

【水模拟】#62 A. Irrational problem

A. Irrational problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Little Petya was given this problem f

CD's Coding 837

【2026 Science Robotics】Learning realistic lip motions for humanoid face robots

哥伦比亚大学Yuhang Hu团队提出了一种创新方法,通过10自由度软体嘴唇设计和自监督学习算法解决仿人机器人嘴唇动作僵硬问题。研究采用变分自编码器(VAE)和面部动作Transformer(FAT)模型,将语音信号转化为机器人可执行的电机指令。实验表明,该方法在多语言测试中表现优异,用户偏好率达62.5%,显著提升了口型同步的真实感和流畅度。该成果突破了传统机械结构的限制,为跨越"恐怖谷效应"提供了有效解决方案。

志在山顶的人,不会贪念山腰的风景 314

FPGA实现PID算法

PID 控制器表达式如下(引用某硕士论文 《基于FPGA的PID控制器研究与实现》): 其中,Kp为比例增益,Ti为积分时间常数,Td为微分时间常数,u(t)为控制量,e(t)为偏差。 在数字控制系统中,PID控制规律的实现必须用数值逼近的方法。当采样周期相当短时,用求和代替积分、用后向差分代替微分,使模拟PID离散化变为差分方程。 本文使用并行结构来实现。具有延时小,计算速度快的特点,但需要资源比较多。 利用图3.2所示并行结构实现方法 ,进一步将3.8式分解: ...

nxin168的博客 1万+

Rock-paper-scissors 石头剪刀布

F - Rock-paper-scissors p Time Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description Uncle Fyodor, Matroskin the Cat and Sharic th

wwk0125的专栏 2183

23 RAG 为什么答不准:召回、分块、排序的常见坑

RAG 答不准时,不要先怪模型。本文把常见失败拆成召回不到、召回不准、分块不完整、排序靠后、上下文污染和生成不忠实六类,并给出从 Top-K 检查到评估集的排查流程。

老于的笔记的专栏 256

Divisor Summation约数之和

Divisor Summation Description Give a natural number n (1 <= n <= 500000), please tell the summation of all its proper divisors. Definition: A proper divisor of a natural number is the divisor that

wwk0125的专栏 1075

全球国家地区城市数据

MySQL全球国家地区城市数据报。。。。。。。。。。。。

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

CodeForces 104A

Problem A Blackjack p Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description One rainy gloomy evening when all modules hid i

wwk0125的专栏 1035

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

Mnemonics and Palindromes 3

F - Mnemonics and Palindromes 3 Time Limit: 1000MS Memory Limit: 65536K 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description As you remember, when Vasechkin was pre

wwk0125的专栏 909

SAP B1中文培訓教材_SDK

公司内部培训资料,对开发工具 ,DIAPI, UIAPI,Add-ON有详细解说

Fortune Telling 数花瓣--算命

B - Fortune Telling p Time Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description Marina loves Sasha. But she keeps wondering wheth

wwk0125的专栏 867

用指针实现链表--插入排序

★实验任务 有n(1 m(1 小到大顺序。 ★数据输入 输入第一行是n和m,第二行是已经有序的n个数的数列。第三行是待m个待插入的整 数数。 ★数据输出 输出插入新的元素后的数列,数据间以空格隔开。 输入示例 3 1 1 2 3 4 输出示例 1 2 3 4         第一次使用链表,发现自己还有很多不懂,Go Go  加油! #include   #include   #defi

wwk0125的专栏 827

Shell Game (类似找骰子游戏)

F - Shell Game p Time Limit: 2000MS Memory Limit: 65536K 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description Today the «Z» city residents enjoy a shell game competi

wwk0125的专栏 786

CodeForces 110A Nearly Lucky N…

CodeForces 110A Nearly Lucky Number Time Limit: 2000MS Memory Limit: 262144K 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status]   Description Petya loves lucky numbers. We all

wwk0125的专栏 763

CodeForces 104 B 猜答案

Testing Pants for Sadness p Time Limit: 2000MS Memory Limit: 262144KB 64bit IO Format: %I64d & %I64u [Submit]   [Go Back]   [Status] Description The average miner Vaganych took refresher

wwk0125的专栏 710

世界末日

★实验任务 看完电影《2012》 ,小c 相信 2012年12 月21 日将会是世界末日,于是他每天都 在计算离世界末日还有几天。但是他觉得计算太麻烦了,希望让你写一个程序帮帮 他。 你需要编写一个日期类,实现计算当前日期距离 2012 年 12 月 21 日还有几天的功 能。 ★数据输入 数据采用标准输入输出。输入的日期格式为“YYYY-MM-DD”(数据保证该日期合法, 并且在2012年12

wwk0125的专栏 710

Semi-Prime

Semi-Prime Time Limit: 1000MS Memory Limit: 32768K 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status] Description Prime Number Definition  An integer greater than one is called

wwk0125的专栏 695

foj1001 使用了位图

Problem 1001 Duplicate Pair Accept: 3561    Submit: 16898 Time Limit: 1000 mSec    Memory Limit : 65536 KB   1001  使用了位图,需要将数组初始化为0值" TITLE="foj   1001  使用了位图,需要将数组初始化为0值" /> Problem Description A

wwk0125的专栏 676

hdu 3940 愤怒的小鸟

3940  愤怒的小鸟" TITLE="hdu  3940  愤怒的小鸟" />  2.The Yellow Bird:  3940  愤怒的小鸟" TITLE="hdu  3940  愤怒的小鸟" />Th  3940  愤怒的小鸟" TITLE="hdu  3940  愤怒的小鸟" />Ts) touch the land and the sling.   Input Sour

wwk0125的专栏 669

Divisor Summation(与求约数个数类似)

Sum of Divisors Time Limit: 1000MS Memory Limit: 32768K 64bit IO Format: %lld & %llu [Submit]   [Go Back]   [Status] Description For an integer n, define f(n) to be the sum of its proper

wwk0125的专栏 662
上一篇: hdu 3677
下一篇: Rock-paper-scissors 石头剪刀布
onlinewk
博客等级 码龄16年 2粉丝 96原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值