Azzera filtri
Azzera filtri

Modifying A Variable in an ODEFUN/Boundary Value Problem

2 visualizzazioni (ultimi 30 giorni)
I am trying to modify with each step across my odefun the values of k, mu, and c.
I'd like for these variables for change with each step based on the value calculated for Sxint(4,j)
clc
clear all
close all
function yprime = odefun(eta,y)
yprime = zeros(5,1);
global m etainf Pr mu k c
%% Plotting Velocity and Temperature
etainf = 20; % Find Convergence for both Temp and Velocity
Pr = 0.7; % Enter Pr
for m = [0]
solinit = bvpinit(linspace(0,etainf,100),[0 0 0 1 0]);
sol = bvp4c(@odefun, @odefun_bc,solinit);
xint = linspace(0,etainf,100);
Sxint = deval(sol,xint);
for j = 1:etainf
mu = (Sxint(4,j))^0.7;
c = (Sxint(4,j))^0.19;
k = (Sxint(4,j))^0.85;
figure(1)
hold on
title('Velocity vs Eta, Pr = 0.1')
xlabel('Eta')
ylabel('Velocity')
plot(xint,Sxint(2,:)); % plots f' (velocity)
figure(2)
hold on
title('Temperature vs Eta, Pr = 0.1')
xlabel('Eta')
ylabel('Temperature')
plot(xint,Sxint(4,:)); % plots q (temp profile)
end
end
  2 Commenti
Torsten
Torsten il 8 Mag 2023
Modificato: Torsten il 8 Mag 2023
I'm totally lost on what you are trying to do with this code - especially what the "yprime" are you have to supply in function "odefun".
Tony Stianchie
Tony Stianchie il 8 Mag 2023
Sorry - I was vague in my question. I solved my problem, but appreciate the quick response.

Accedi per commentare.

Risposte (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by