answersLogoWhite

0

#include <stdafx.h>

04#include "impeuler.h"

05

06double solveodimpeuler(double t, const double& tspan, double y, cont int& N, double tfinal)

07

08{

09 double result;

10 int i;

11 double h;

12

13 double f1;

14 double y1*;

15 double y1;

16

17 double f2;

18 double y2*;

19 double y2;

20

21 f1(t,y)=y2;

22 f2(t,y)=-4y1;

23 y=f1(t,y)+f2(t,y);

24

25 h= (tspan-t)/N;

26 y1(0)=0.01;

27 y2(0)=0.0;

28

29 tfinal=2pi/y;

30 N=tfinal/h;

31

32

33 i=1;

34 do

35 {

36 y1*(n+1)=y1(n)+h*y2(n);

37 y2*(n+1)=y2(n)+h*(-4y1(n));

38

39 y1(n+1)=y1(n)+(h/2)*[y2(n)+y2*(n+1)];

40 y2(n+1)=y2(n)+(h/2)*[-4y1(n)-4y1*(n+1)];

41 }

42 while(i<=N);

43 result=y;

44 return result;

45}

User Avatar

Wiki User

13y ago

What else can I help you with?

Related Questions

What has the author Ralph C Smith written?

Ralph C. Smith has written: 'A fully Galerkin method for the recovery of stiffness and damping parameters in Euler-Bernoulli beam models' -- subject(s): Sinc-Galerkin method, Damping, Stiffness 'Sinc-Galerkin estimation of diffusivity in parabolic problems' -- subject(s): Diffusion, Diffusivity, Sinc-Galerkin method, Galerkin methods 'A fully Sinc-Galerkin method for Euler-Bernoulli beam models' -- subject(s): Galerkin method, Partial Differential equations


The method used to calculate depriciationfor income tax purposes is A sum of years method Bdeclining balance method C units of production method D modified accelerated cost recovery system method?

D) MACRSSilly accounting students posting questions for their homework....


What has the author H C Chen written?

H. C. Chen has written: 'Developing and utilizing an Euler computational method for predicting the airframe/propulsion effects for an aft-mounted turboprop transport' -- subject(s): Airplanes, Eulerian graph theory, Turbine-propeller engines 'An installed nacelle design code using a multiblock Euler solver' -- subject(s): Nacelles, Airplanes, Design and construction


Your LimeWire says you have a previous version of LimeWire running on your PC when you try to install it even though this is your first LimeWire download?

LimeWire version 4.12.3 Pro Java version 1.6.0_05 from Sun Microsystems Inc. Windows Vista v. 6.0 on x86 Free/total memory: 3041656/4128768 com.limegroup.gnutella.gui.GUILoader$StartupFailedException: invalid update.ver at com.limegroup.gnutella.gui.GUILoader.sanityCheck(GUILoader.java:270) at com.limegroup.gnutella.gui.GUILoader.load(GUILoader.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.limegroup.gnutella.gui.Main.main(Main.java:44) STARTUP ERROR! FILES IN CURRENT DIRECTORY: C:\Program Files\LimeWire\clink.jar LAST MODIFIED: 1150901928906 SIZE: 307949 C:\Program Files\LimeWire\commons-httpclient.jar LAST MODIFIED: 1150901929859 SIZE: 459988 C:\Program Files\LimeWire\commons-logging.jar LAST MODIFIED: 1150901930375 SIZE: 59154 C:\Program Files\LimeWire\commons-net.jar LAST MODIFIED: 1150901932218 SIZE: 355370 C:\Program Files\LimeWire\daap.jar LAST MODIFIED: 1150901934906 SIZE: 388504 C:\Program Files\LimeWire\GenericWindowsUtils.dll LAST MODIFIED: 1150901913109 SIZE: 12279 C:\Program Files\LimeWire\hs_err_pid256.log LAST MODIFIED: 1227143936485 SIZE: 12691 C:\Program Files\LimeWire\hs_err_pid3836.log LAST MODIFIED: 1229478222329 SIZE: 14807 C:\Program Files\LimeWire\hs_err_pid4140.log LAST MODIFIED: 1227581940126 SIZE: 14616 C:\Program Files\LimeWire\hs_err_pid5496.log LAST MODIFIED: 1227129175835 SIZE: 12690 C:\Program Files\LimeWire\hs_err_pid6064.log LAST MODIFIED: 1229645903486 SIZE: 13547 C:\Program Files\LimeWire\i18n.jar LAST MODIFIED: 1150901935390 SIZE: 25678 C:\Program Files\LimeWire\icu4j.jar LAST MODIFIED: 1150901936671 SIZE: 741440 C:\Program Files\LimeWire\id3v2.jar LAST MODIFIED: 1150901937656 SIZE: 94430 C:\Program Files\LimeWire\jcraft.jar LAST MODIFIED: 1150901938500 SIZE: 136693 C:\Program Files\LimeWire\jl011.jar LAST MODIFIED: 1150901939406 SIZE: 255016 C:\Program Files\LimeWire\jmdns.jar LAST MODIFIED: 1150901941875 SIZE: 69306 C:\Program Files\LimeWire\LimeWire.exe LAST MODIFIED: 1150901913593 SIZE: 159744 C:\Program Files\LimeWire\LimeWire.jar LAST MODIFIED: 1150901926781 SIZE: 7109498 C:\Program Files\LimeWire\LimeWire20.dll LAST MODIFIED: 1150901913187 SIZE: 40960 C:\Program Files\LimeWire\log4j.jar LAST MODIFIED: 1150901943031 SIZE: 677952 C:\Program Files\LimeWire\looks.jar LAST MODIFIED: 1150901944078 SIZE: 630634 C:\Program Files\LimeWire\MessagesBundles.jar LAST MODIFIED: 1150901927484 SIZE: 2720591 C:\Program Files\LimeWire\mp3sp14.jar LAST MODIFIED: 1150901944546 SIZE: 40064 C:\Program Files\LimeWire\ProgressTabs.jar LAST MODIFIED: 1150901928031 SIZE: 5786 C:\Program Files\LimeWire\themes.jar LAST MODIFIED: 1150901944937 SIZE: 741477 C:\Program Files\LimeWire\tritonus.jar LAST MODIFIED: 1150901945625 SIZE: 152711 C:\Program Files\LimeWire\vorbis.jar LAST MODIFIED: 1150901946062 SIZE: 27215 C:\Program Files\LimeWire\WindowsFirewall.dll LAST MODIFIED: 1150901913218 SIZE: 61440 C:\Program Files\LimeWire\xerces.jar LAST MODIFIED: 1150901948328 SIZE: 2147687 C:\Program Files\LimeWire\xml-apis.jar LAST MODIFIED: 1150901949062 SIZE: 207655 LimeWire version 4.12.3 Pro Java version 1.6.0_05 from Sun Microsystems Inc. Windows Vista v. 6.0 on x86 Free/total memory: 3041656/4128768 com.limegroup.gnutella.gui.GUILoader$StartupFailedException: invalid update.ver at com.limegroup.gnutella.gui.GUILoader.sanityCheck(GUILoader.java:270) at com.limegroup.gnutella.gui.GUILoader.load(GUILoader.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.limegroup.gnutella.gui.Main.main(Main.java:44) STARTUP ERROR! FILES IN CURRENT DIRECTORY: C:\Program Files\LimeWire\clink.jar LAST MODIFIED: 1150901928906 SIZE: 307949 C:\Program Files\LimeWire\commons-httpclient.jar LAST MODIFIED: 1150901929859 SIZE: 459988 C:\Program Files\LimeWire\commons-logging.jar LAST MODIFIED: 1150901930375 SIZE: 59154 C:\Program Files\LimeWire\commons-net.jar LAST MODIFIED: 1150901932218 SIZE: 355370 C:\Program Files\LimeWire\daap.jar LAST MODIFIED: 1150901934906 SIZE: 388504 C:\Program Files\LimeWire\GenericWindowsUtils.dll LAST MODIFIED: 1150901913109 SIZE: 12279 C:\Program Files\LimeWire\hs_err_pid256.log LAST MODIFIED: 1227143936485 SIZE: 12691 C:\Program Files\LimeWire\hs_err_pid3836.log LAST MODIFIED: 1229478222329 SIZE: 14807 C:\Program Files\LimeWire\hs_err_pid4140.log LAST MODIFIED: 1227581940126 SIZE: 14616 C:\Program Files\LimeWire\hs_err_pid5496.log LAST MODIFIED: 1227129175835 SIZE: 12690 C:\Program Files\LimeWire\hs_err_pid6064.log LAST MODIFIED: 1229645903486 SIZE: 13547 C:\Program Files\LimeWire\i18n.jar LAST MODIFIED: 1150901935390 SIZE: 25678 C:\Program Files\LimeWire\icu4j.jar LAST MODIFIED: 1150901936671 SIZE: 741440 C:\Program Files\LimeWire\id3v2.jar LAST MODIFIED: 1150901937656 SIZE: 94430 C:\Program Files\LimeWire\jcraft.jar LAST MODIFIED: 1150901938500 SIZE: 136693 C:\Program Files\LimeWire\jl011.jar LAST MODIFIED: 1150901939406 SIZE: 255016 C:\Program Files\LimeWire\jmdns.jar LAST MODIFIED: 1150901941875 SIZE: 69306 C:\Program Files\LimeWire\LimeWire.exe LAST MODIFIED: 1150901913593 SIZE: 159744 C:\Program Files\LimeWire\LimeWire.jar LAST MODIFIED: 1150901926781 SIZE: 7109498 C:\Program Files\LimeWire\LimeWire20.dll LAST MODIFIED: 1150901913187 SIZE: 40960 C:\Program Files\LimeWire\log4j.jar LAST MODIFIED: 1150901943031 SIZE: 677952 C:\Program Files\LimeWire\looks.jar LAST MODIFIED: 1150901944078 SIZE: 630634 C:\Program Files\LimeWire\MessagesBundles.jar LAST MODIFIED: 1150901927484 SIZE: 2720591 C:\Program Files\LimeWire\mp3sp14.jar LAST MODIFIED: 1150901944546 SIZE: 40064 C:\Program Files\LimeWire\ProgressTabs.jar LAST MODIFIED: 1150901928031 SIZE: 5786 C:\Program Files\LimeWire\themes.jar LAST MODIFIED: 1150901944937 SIZE: 741477 C:\Program Files\LimeWire\tritonus.jar LAST MODIFIED: 1150901945625 SIZE: 152711 C:\Program Files\LimeWire\vorbis.jar LAST MODIFIED: 1150901946062 SIZE: 27215 C:\Program Files\LimeWire\WindowsFirewall.dll LAST MODIFIED: 1150901913218 SIZE: 61440 C:\Program Files\LimeWire\xerces.jar LAST MODIFIED: 1150901948328 SIZE: 2147687 C:\Program Files\LimeWire\xml-apis.jar LAST MODIFIED: 1150901949062 SIZE: 207655


Can you declare a method within a method in c or c plus plus?

C: there are no methods in C. C++: no.


Delphi is an A. quantitative method B. economic method C. judgment method D. social method E. none of the above?

C. judgment method


Can a graph have a euler circuit but not a hamiltonian circuit?

Yes. Example: .................................................... ...A * ........................................... ......|.\ ......................................... eg Euler circuit: ACDCBA ......|...\ ........... --------- ............. ......|.....\........./...............\............ The Hamilton circuit is impossible as it has two ......|.......\...../...................\.......... halves (ACD &amp; CD) connected to each other only ......|.........\./.......................\........ at vertex C. Once vertex C has been reached in ......|.......C *........................* D.... one half, it can only be used to start a path in ......|........./.\......................./......... the other half, or complete the cycle in the ......|......./.....\.................../........... current half; or if the path starts at C, it will end ......|...../.........\.............../............. without the other half being visited before C is ......|.../ ........... --------- .............. revisited. ......|./ ........................................... ...B *.............................................. ......................................................


How can you defined differential equations in C programming?

In C programming, differential equations can be defined and solved using numerical methods, such as Euler's method, Runge-Kutta methods, or the Adams-Bashforth method. You typically represent the differential equation as a function that calculates the derivative and use loops to iteratively compute the values of the dependent variable over specified intervals. Libraries like GSL (GNU Scientific Library) can also be utilized for more complex solutions. The key is to discretize the problem and implement the chosen numerical method in code.


What has the author Darcy C Burns written?

Darcy C. Burns has written: 'Structural studies of azobenzene-modified proteins'


What is difference between constant in c plus plus and final in java?

The final keyword can be used to modify a class, method, or variable.When used on a variable, it means that variable cannot be changed once set.When used on a method, it means that no subclasses may override that method.


What is formatted functions in c?

functions which have been modified by using different return types


What is the teaching method to develop social charcterstics in students?

A Project Method B Socialised Method C Problem solving Method D Lecturer Method