Skip to main content
1-Visitor
March 24, 2017
Solved

Solving of ODE with variable parameter

  • March 24, 2017
  • 4 replies
  • 5675 views

Hi,

I have a new problem. I want to solve a ODE-system with variable parameter. In the picture you see a minimal example.

I want solve the ODE with variable a so that i get 5 different solutions of the ODE-system. Is there a solution without to use a program? AN if I need a program, how looks it.

thanks for helping!

Best answer by Fred_Kohlhepp

4 replies

21-Topaz II
March 24, 2017

Hi Fabian G.

Could we know what's the differential equation or is it top secret?

25-Diamond I
March 24, 2017

Why do you think its a secret?

We see the function f and the vector D, So we know which ODE system is to be solved.

Fabian already wrote that its just a very simple minimal system for demonstration purpose and the goal is not to solve THIS system, I guess, but rather find a way ro make the solution dependent from a parameter a.

21-Topaz II
March 24, 2017

... evidently I missed something ...

23-Emerald I
March 24, 2017
25-Diamond I
March 24, 2017

I fear you can't use a range variable for a and plot all resulting functions, but you sure can make the result of Radau dependent of a variable argument a.

Here is a way to do it (I changed the system a little bit to make it more interesting :):

fgörlich1-VisitorAuthor
1-Visitor
March 24, 2017

Hey Werner Exinger

first, thanks for the help. Your solution works, but now i have a problem with units. I try to model a chemical kinetic. Here i give a simply form of it.
It is a first order reaction combined with the arrhenius combination to find a solution for the reaction temperatur X_1 and mol X_0. THerefore i solve a material balance and energy balance. With the fuction U(t,X) i want to simulate a cooling failure. That means at a specific time point a, the cooling is stopping (With Cooling U(t,X)=5, with cooling failure U(t,X)=0).

without units it works fine: (i choose some random number to see something) So know i have a cooling failure after 150 and 400.

with units i get this

21-Topaz II
March 25, 2017

Hi

there must be an inconsistency in the measurement unit:

example 25317.jpg

assuming that there are 5000m ^ 2, we get:

example 25317-1.jpg

25-Diamond I
March 24, 2017

If you really need to plot all functions for a set of given parameters with just one command (and in all the same color) you can call the function DGL from my last post with a vector (not a range) as argument and use small routine to separate the various result vectors and create a suitable data structure: