Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9129487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:45:31+00:00 2026-06-17T07:45:31+00:00

I have the following odeint program: #include <boost/array.hpp> #include <boost/numeric/odeint.hpp> using namespace std; typedef

  • 0

I have the following odeint program:

#include <boost/array.hpp>
#include <boost/numeric/odeint.hpp>
using namespace std;

typedef boost::array< double , 1 > state_type;

void eqsystem(const state_type &x, state_type &dxdt, double t) {
    dxdt[0] = 3;
}

void write_system( const state_type &x , const double t ) {
    cout << t << '\t' << x[0] << endl;
}

int main(){
    double t0=0, t1=100;
    double tstep0=0.01;
    state_type x = {{ 0 }};
    cout<<"t\tValue"<<endl;
    boost::numeric::odeint::integrate( eqsystem , x , t0 , t1 , tstep0 , write_system );
}

Every time t is a multiple of 10, I would like to set x[0]=0.1.

That is, I’d like to have a recurring delta function.

Alternatively, if I could have the delta function occur at a finite number of time points, I would be able to approximate the recurrence.

Unfortunately, I was unable to find a documentation of delta functions in odeint. Does anyone know how to achieve this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:45:32+00:00Added an answer on June 17, 2026 at 7:45 am

    This is not possible in odeint, at least not generically. You have two alternatives:

    First approximate the delta peaks by very sharp Gaussians.

    Second, integrate to the time-point of the peak. Apply the delta peak, i.e. add a step to your existing solution and starting integrate from this point to the next peak an so on.

    There are als “exotic” methods for ODEs with discontinuities, but they usually treat the case when you ODE itself has discontinuities and not your external driving.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following nested objects. I am using @Valid for validation in my controller.
I have following batch file code: @echo off SET INSTALL_PATH=c:\program files\ :ask_again if exist
have following problem with validate checkbox array. The validation is bypassed, have taken the
I have following code: Tools::Logger.Log(string(GetLastError()), Error); GetLastError() returns a DWORD a numeric value, but
i have following data as an associative array array 'abc' => array 'label' =>
I have following code: typedef int (*t_Function) (int x); t_Function Functions[MAX_FUNCTIONS]; int f(int x)
I have following problem: My program should decide at runtime to load an function
I have following script to prevent a button from submitting twice by double clicking.
I have following plist: <?xml version=1.0 encoding=UTF-8?> <!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
I have following source. In insertMessage(..), it calls selectMessage to check whether duplicate record

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.