Using MATLAB (779505), страница 64

Файл №779505 Using MATLAB (Using MATLAB) 64 страницаUsing MATLAB (779505) страница 642017-12-27СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 64)

Mesh selectionand error control are based on the residual of this solution, such that thecomputed solution S ( x ) is the exact solution of a perturbed problemS′ ( x ) = f ( x, S ( x ) ) + res ( x ) . On each subinterval of the mesh, a norm of theresidual in the ith component of the solution, res(i), is estimated and isrequired to be less than or equal to a tolerance.

This tolerance is a function ofthe relative and absolute tolerances, RelTol and AbsTol, defined by the user.(res(i)/max(abs(f(i)),AbsTol(i)/RelTol))≤ RelTol15-7715Differential EquationsThe following table describes the error tolerance properties. Use bvpset to setthese properties.BVP Error Tolerance PropertiesPropertyValueDescriptionRelTolPositive scalar{1e-3}A relative error tolerance that applies to all components of theresidual vector. It is a measure of the residual relative to thesize of f ( x, y ) .

The default, 1e-3, corresponds to 0.1%accuracy.AbsTolPositive scalaror vector {1e-6}Absolute error tolerances that apply to the correspondingcomponents of the residual vector. AbsTol(i) is a thresholdbelow which the values of the corresponding components areunimportant. If a scalar value is specified, it applies to allcomponents.VectorizationThe following table describes the BVP vectorization property. Vectorization ofthe ODE function used by bvp4c differs from the vectorization used by the ODEsolvers:• For bvp4c, the ODE function must be vectorized with respect to the firstargument as well as the second one, so that F([x1 x2 ...],[y1 y2 ...])returns [F(x1,y1) F(x2,y2) ...].• bvp4c benefits from vectorization even when analytical Jacobians areprovided.

For stiff ODE solvers, vectorization is ignored when analyticalJacobians are used.15-78Boundary Value Problems for ODEsUse bvpset to set this property.PropertyValueDescriptionVectorizedon | {off}Set on to inform bvp4c that you have coded the ODE function Fso that F([x1 x2 ...],[y1 y2 ...]) returns[F(x1,y1) F(x2,y2) ...].

This allows the solver to reducethe number of function evaluations, and may significantlyreduce solution time.With MATLAB’s array notation, it is typically an easy matterto vectorize an ODE function. In the shockbvp example shownpreviously, the shockODE function has been vectorized usingcolon notation into the subscripts and by using the arraymultiplication (.*) operator.function dydx = shockODE(x,y,e)pix = pi*x;dydx = [ y(2,:)-x/e.*y(2,:)-pi^2*cos(pix)-pix/e.*sin(pix) ];Analytical Partial DerivativesBy default, the bvp4c solver approximates all partial derivatives with finitedifferences.

bvp4c can be more efficient if you provide analytical partialderivatives ∂f ⁄ ∂y of the differential equations, and analytical partialderivatives, ∂bc ⁄ ∂ya and ∂bc ⁄ ∂yb , of the boundary conditions. If the probleminvolves unknown parameters, you must also provide partial derivatives,∂f ⁄ ∂p and ∂bc ⁄ ∂p , with respect to the parameters.The following table describes the analytical partial derivatives properties. Usebvpset to set these properties.15-7915Differential EquationsBVP Analytical Partial Derivative PropertiesPropertyValueDescriptionFJacobianFunctionThe function computes the analytical partial derivatives off ( x, y ) .

When solving y′ = f ( x, y ) , set this property to @fjac ifdfdy = fjac(x,y) evaluates the Jacobian ∂f ⁄ ∂y . If the probleminvolves unknown parameters p , [dfdy,dfdp] = fjac(x,y,p)must also return the partial derivative ∂f ⁄ ∂p .BCJacobianFunctionThe function computes the analytical partial derivatives ofbc ( ya, yb ) . For boundary conditions bc ( ya, yb ) , set thisproperty to @bcjac if [dbcdya,dbcdyb] = bcjac(ya,yb)evaluates the partial derivatives ∂bc ⁄ ∂ya , and ∂bc ⁄ ∂yb .

If theproblem involves unknown parameters p ,[dbcdya,dbcdyb,dbcdp] = bcjac(ya,yb,p) must also returnthe partial derivative ∂bc ⁄ ∂p .Mesh Size Propertybvp4c solves a system of algebraic equations to determine the numericalsolution to a BVP at each of the mesh points. The size of the algebraic systemdepends on the number of differential equations (n) and the number of meshpoints in the current mesh (N). When the allowed number of mesh points isexhausted, the computation stops, bvp4c displays a warning message andreturns the solution it found so far. This solution does not satisfy the errortolerance, but it may provide an excellent initial guess for computationsrestarted with relaxed error tolerances or an increased value of NMax.15-80Boundary Value Problems for ODEsThe following table describes the mesh size property.

Use bvpset to set thisproperty.BVP Mesh Size PropertyPropertyValueDescriptionNMaxpositive integer{floor(1000/n)}Maximum number of mesh points allowed when solving theBVP, where n is the number of differential equations in theproblem. The default value of NMax limits the size of thealgebraic system to about 1000 equations. For systems of afew differential equations, the default value of NMax shouldbe sufficient to obtain an accurate solution.Solution Statistic PropertyThe Stats property lets you view solution statistics.The following table describes the solution statistics property.

Use bvpset to setthis property.BVP Solution Statistic PropertyPropertyValueDescriptionStatson | {off}Specifies whether statistics about the computations aredisplayed. If the stats property is on, after solving theproblem, bvp4c displays:• The number of points in the mesh• The maximum residual of the solution• The number of times it called the differential equationfunction odefun to evaluate f ( x, y )• The number of times it called the boundary conditionfunction bcfun to evaluate bc ( y ( a ), y ( b ) )15-8115Differential EquationsPartial Differential EquationsThis section describes how to use MATLAB to solve initial-boundary valueproblems for partial differential equations (PDEs).

It provides:• A summary of the MATLAB PDE functions and examples• An introduction to PDEs• A description of the PDE solver and its syntax• General instructions for representing a PDE in MATLAB, including anexample• A discussion about changing default integration properties to improve solverperformance• An example of solving a real-life problemPDE Function SummaryMATLAB PDE SolverThis is the MATLAB PDE solver.PDE Initial-Boundary Value Problem SolverpdepeSolve initial-boundary value problems for systems of parabolicand elliptic PDEs in one space variable and time.PDE Helper FunctionPDE Helper FunctionpdevalEvaluate the numerical solution of a PDE using the output ofpdepe.PDE ExamplesThese examples illustrate some problems you can solve using the MATLABPDE solver. From the MATLAB Help browser, click the example name to seethe code in an editor.

Type the example name at the command line to run it.15-82Partial Differential EquationsNote The Differential Equations Examples browser enables you to view thecode for the PDE examples, and also run them. Click on the link to invoke thebrowser, or type odeexamples('pde')at the command line.ExampleDescriptionpdex1Simple PDE that illustrates the straightforward formulation,computation, and plotting of the solutionpdex2Problem that involves discontinuitiespdex3Problem that requires computing values of the partialderivativepdex4System of two PDEs whose solution has boundary layers atboth ends of the interval and changes rapidly for small tpdex5System of PDEs with step functions as initial conditionsIntroduction to PDE Problemspdepe solves systems of PDEs in one spatial variable x and time t , of the form∂u ∂u∂u∂u–m ∂  m ------ x f x, t, u, -------  + s  x, t, u, -------c  x, t, u, ------- ------- = x∂x ∂t∂x ∂ x∂x (15-3)The PDEs hold for t 0 ≤ t ≤ t f and a ≤ x ≤ b .

The interval [ a, b ] must be finite.m can be 0, 1, or 2, corresponding to slab, cylindrical, or spherical symmetry,respectively. If m > 0 , then a ≥ 0 must also hold.In Equation 15-3, f ( x, t, u, ∂u ⁄ ∂x ) is a flux term and s ( x, t, u, ∂u ⁄ ∂x ) is asource term. The coupling of the partial derivatives with respect to time isrestricted to multiplication by a diagonal matrix c ( x, t, u, ∂u ⁄ ∂x ) .

The diagonalelements of this matrix are either identically zero or positive. An element thatis identically zero corresponds to an elliptic equation and otherwise to aparabolic equation. There must be at least one parabolic equation. An elementof c that corresponds to a parabolic equation can vanish at isolated values of x15-8315Differential Equationsif they are mesh points. Discontinuities in c and/or s due to material interfacesare permitted provided that a mesh point is placed at each interface.At the initial time t = t 0 , for all x the solution components satisfy initialconditions of the formu ( x, t 0 ) = u 0 ( x )(15-4)At the boundary x = a or x = b , for all t the solution components satisfy aboundary condition of the form∂up ( x, t, u ) + q ( x, t )f  x, t, u, ------- = 0∂x (15-5)q ( x, t ) is a diagonal matrix with elements that are either identically zero ornever zero.

Характеристики

Тип файла
PDF-файл
Размер
6,57 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Зачем заказывать выполнение своего задания, если оно уже было выполнено много много раз? Его можно просто купить или даже скачать бесплатно на СтудИзбе. Найдите нужный учебный материал у нас!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6987
Авторов
на СтудИзбе
262
Средний доход
с одного платного файла
Обучение Подробнее
{user_main_secret_data}