Setting Initial Conditions for ode45() with f(1.5) Known

Click For Summary

Discussion Overview

The discussion revolves around setting initial conditions for the MATLAB function ode45() when the value of the function at a specific point (f(1.5)) is known, but the value at the starting point (f(0)) is not. Participants explore issues related to function definitions and error messages encountered during implementation.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant inquires about how to set initial conditions for ode45() given that f(1.5) is known but f(0) is not.
  • Another participant suggests that the error may stem from the function definition used in ode45(), prompting a request for clarification on the function's structure.
  • A later reply indicates that the initial error was resolved by changing the division operator from / to ./ in the function definition.
  • Additional posts introduce unrelated MATLAB questions, including issues with quantization techniques and constructing a pentadiagonal matrix.
  • Another participant raises a separate issue regarding an undefined function error in MATLAB, seeking assistance.

Areas of Agreement / Disagreement

The discussion primarily focuses on the initial conditions for ode45() and the associated error, with some participants agreeing on the nature of the error while others introduce different topics without consensus on the original question.

Contextual Notes

Participants do not fully resolve the initial inquiry about setting conditions for ode45(), and the discussion includes unrelated MATLAB programming questions that may distract from the main topic.

Who May Find This Useful

Individuals working with MATLAB, particularly those dealing with numerical methods like ode45(), or those encountering similar programming errors may find this discussion relevant.

TalonStriker
Messages
14
Reaction score
0
Hey guys,

I was just wondering if anyone knows how to set the initial conditions for ode45() if you know f(1.5) but NOT f(0)


Currently I have
>> ode45(f, [0 1 1.8 2.1], [1.5 .5])

But this creates the following error:

? Error using ==> funfun/private/odearguments
@(T,Y) (T-EXP(-T))/(Y+EXP(Y)) must return a column vector.


Thanks.
 
Physics news on Phys.org
You should be able to solve on arbitrary time intervals [ta,tb] going forwards or backwards in time. Your error looks like it's coming from your function f. What does it look like?
 
I was able to fix it. Apparently i was using / in f() instead of ./.

Thanks for your help.
 
i'm novice to the MATLAB i want to do the quantization techniques in the MATLAB so please help me out.
 
Hi There
I was wondering if anyone knows how to write pentadiagonal matrix of any dimension in Matlab with maindiagoanl 10, super diagonal 3, -3 and lower diagonal 2, -2.

Thanks
 
Dear Friends,

I have a problem in MATLAB programming. I need to know how to correct this error,
Undefined function or method 'imp' for input arguments of type
'double'.

Error in ==> FilterRealizationRadar at 9
fil(i)=imp(n-i+1);

Please can anyone help this problem out?
Sincerely
Elangoven Sundrason Pillai (ESP)
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K